← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The Lua script engine stopped, restarted or could not start

WarningBoard, internal errors, CAN, scripting

What ArduPilot says:

“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

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

  2. The board does not have SCR_HEAP_SIZE bytes of free memory.

    Check“Unable to allocate memory” at start-up, and the pre-arm line “Scripting: out of memory”.

    FixLower SCR_HEAP_SIZE to what the board has free (the ground station shows free memory), or free memory by switching off features you do not use, and reboot.

  3. “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

ParameterWhat it is
SCR_ENABLEEnable Scripting
SCR_HEAP_SIZEScripting Heap Size
SCR_DEBUG_OPTSScripting Debug Level
SCR_LD_CHECKSUMLoaded script checksum
SCR_RUN_CHECKSUMRunning script checksum
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

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