Lua scripting reports a problem and blocks arming
What ArduPilot says:
- Scripting: …
Lua scripts are small programs that run next to the flight code (SCR_ENABLE 1). After “Scripting:” comes one of three things: “out of memory” (the script engine could not get its memory), “failed to start” (its thread could not be created), or the text of the last script error. Any script error is kept and blocks arming until scripting is restarted or the board rebooted, because a script that stopped may be one the aircraft depends on. The warning “Required SCR_HEAP_SIZE over N” counts as such an error too.
What to do, most likely first
A script stopped with an error.
CheckLook back in the messages for the “Lua: …” line: it names the file and the line number. It is repeated every 10 seconds, ten times.
FixCorrect the script or replace it with the version made for your firmware (the Lua Applet Catalog lists them by version), then reboot.
The scripts need more memory than
SCR_HEAP_SIZEgives, or the board cannot provide that much.CheckThe text is “out of memory” or “Required
SCR_HEAP_SIZEover N”.FixSee the explanation of the scripting memory messages: raise
SCR_HEAP_SIZEabove N, or lower it to what the board has free, and reboot.Scripting is on but you use no scripts, and a leftover file on the card fails.
CheckLook in APM/scripts on the card.
FixRemove the leftover scripts; if you use none at all, set
SCR_ENABLEto 0 and reboot.
SCR_DEBUG_OPTS bit 4 switches this check off. Do not use it to get airborne: the script that failed is still not running.
Parameters to look at
| Parameter | What it is |
|---|---|
SCR_ENABLE | Enable Scripting |
SCR_HEAP_SIZE | Scripting Heap Size |
SCR_DEBUG_OPTS | Scripting Debug Level |
Where to do it:Lua Applet CatalogSetup & Tuning Guide
The code that sends it
Scripting: …
libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::arming_checks() · Open in ArduPilot Copter-4.7.1