← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

Lua scripting reports a problem and blocks arming

Stops itBoard, internal errors, CAN, scripting

What ArduPilot says:

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

  1. 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.

  2. The scripts need more memory than SCR_HEAP_SIZE gives, or the board cannot provide that much.

    CheckThe text is “out of memory” or “Required SCR_HEAP_SIZE over N”.

    FixSee the explanation of the scripting memory messages: raise SCR_HEAP_SIZE above N, or lower it to what the board has free, and reboot.

  3. 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_ENABLE to 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

ParameterWhat it is
SCR_ENABLEEnable Scripting
SCR_HEAP_SIZEScripting Heap Size
SCR_DEBUG_OPTSScripting Debug Level
The code that sends it

Scripting: …

libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::arming_checks() · Open in ArduPilot Copter-4.7.1

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer