ArduPilot found no place to load scripts from, or no scripts
What ArduPilot says:
- Lua: open directory (…) failed
- Lua: All directory's disabled see SCR_DIR_DISABLE
- Lua: No scripts to run
- Scripting: failed to create (…)
With SCR_ENABLE 1, ArduPilot loads every file whose name ends in “.lua” from two places at start-up: the folder APM/scripts on the microSD card, and the scripts built into the firmware itself. SCR_DIR_DISABLE can switch either off (bit 0 the built-in ones, bit 1 the card folder). The lines say the card folder could not be created or opened, that both places are switched off, or (only with SCR_DEBUG_OPTS bit 0) that no script is running.
What to do, most likely first
There is no microSD card, or it cannot be written.
CheckIs logging failing too?
FixFit a working card; ArduPilot creates APM/scripts itself at the next start. On a board with no card slot, scripts have to be built into the firmware with the Firmware Builder.
The scripts are in the wrong place or have the wrong name.
CheckThey must be directly in APM/scripts, not in a sub-folder, with names ending in “.lua” and not starting with a dot.
FixMove them and reboot.
SCR_DIR_DISABLEswitches off the place your scripts are in.FixSet
SCR_DIR_DISABLEto 0 and reboot.
Parameters to look at
| Parameter | What it is |
|---|---|
SCR_ENABLE | Enable Scripting |
SCR_DIR_DISABLE | Directory disable |
SCR_DEBUG_OPTS | Scripting Debug Level |
Where to do it:Lua Applet CatalogFirmware Builder
The code that sends it
Lua: open directory (…) failed
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::load_all_scripts_in_dir() · Open in ArduPilot Copter-4.7.1
Lua: All directory's disabled see SCR_DIR_DISABLE
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::run() · Open in ArduPilot Copter-4.6.3
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::run_engine() · Open in ArduPilot Copter-4.7.1
Lua: No scripts to run
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::run() · Open in ArduPilot Copter-4.6.3
libraries/AP_Scripting/lua_scripts.cpp lua_scripts::run_engine() · Open in ArduPilot Copter-4.7.1
Scripting: failed to create (…)
libraries/AP_Scripting/AP_Scripting.cpp AP_Scripting::init() · Open in ArduPilot Copter-4.7.1