The lua script does not take effect

I wrote a simple lua script that receives a Hello, world! The lua script is placed in the /APM/scripts/ directory on the SD card, but this message is not displayed in QGC.

Hi!

I assume this is a Pixhawk.
Did you set the parameter SCR_ENABLE to 1 (Lua) ?

1 Like

Thank you. Yes, I’ve set SCR_ENABLE to 1, but it’s not working

Hi @835056842
Did you restart the autopilot after setting that parameter? Can you share what version of ArduRover or ArduSub you’re using?

Thank you for your reply! I am using ArduSub v4.5.0 and pixhawk2.4.8, is it a hardware problem? When I first started using lua scripts, I found that SCR_ENABLE was set to 1, but there was no scripts folder in the SD card, so I manually created the scripts folder. According to the official website, “Script is not available in F4-based autopilot”, is this the reason?

Hi @835056842 -
The Pixhawk is indeed the problem - lua scripts are not supported with this hardware. A Navigator will do the trick!