The Lua script engine stopped, restarted or could not start
What ArduPilot says:
- Scripting: …
“Scripting: stopped”: the script engine has ended and no script is running any more; whatever the scripts did for the aircraft no longer happens. “restarted”: it started again from nothing, after SCR_ENABLE went to 0 and back to 1 or a restart command from the ground station. “Unable to allocate memory” and “failed to start”: it could not get its memory (SCR_HEAP_SIZE bytes) or its thread. “saved checksums”: SCR_DEBUG_OPTS bit 5 stored the checksums of the present scripts in SCR_LD_CHECKSUM and SCR_RUN_CHECKSUM. “unable to receive mission command”: a mission command meant for a script could not be queued.
What to do, most likely first
You, or the ground station, stopped or restarted scripting.
FixNothing to fix. After “stopped”, send the restart command or reboot to run the scripts again.
The board does not have
SCR_HEAP_SIZEbytes of free memory.Check“Unable to allocate memory” at start-up, and the pre-arm line “Scripting: out of memory”.
FixLower
SCR_HEAP_SIZEto what the board has free (the ground station shows free memory), or free memory by switching off features you do not use, and reboot.“stopped” came by itself, in flight or on the bench: the engine hit an error it could not survive.
CheckA “Lua: …” line just before it gives the reason.
FixIf the aircraft depends on a script (a failsafe, a payload, a custom mode), land and fix the script before flying again.
In a log, a line that begins “SRC=1/191:” or “GCS:” is text another MAVLink device (a companion computer, a camera, the ground station) sent to the flight controller; ArduPilot writes it into the log with that prefix. This page takes the prefix off and explains the rest when it is an ArduPilot message.
Parameters to look at
| Parameter | What it is |
|---|---|
SCR_ENABLE | Enable Scripting |
SCR_HEAP_SIZE | Scripting Heap Size |
SCR_DEBUG_OPTS | Scripting Debug Level |
SCR_LD_CHECKSUM | Loaded script checksum |
SCR_RUN_CHECKSUM | Running script checksum |
Where to do it:Lua Applet Catalog
The code that sends it
Scripting: …
libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::handle_mission_command() · Open in ArduPilot Copter-4.7.1
libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::init() · Open in ArduPilot Copter-4.7.1
libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::save_checksum() · Open in ArduPilot Copter-4.7.1