Hi there,
I wanted to make a simple lua script for the copter to make some simple things, one of which is move the course camera down, etc.
With the “servo:set_output(VAR)” syntax.
Here are the messages:
“08.10.2025 10:29:24 : ex a nil value (global ‘servo’)
08.10.2025 10:29:24 : Lua: /APM/scripts/down_mode.lua:31: attempt to ind”
Meaning the global variable servo was not defined in the current scripting environment.
Then I’ve run some scripts to test GCS, increased heap size, etc.
AI advised me to run the following script to test lua modules:
function update()
if servo and rc and vehicle and gps then
gcs:send_text(6, "ALL Lua modules OK")
else
gcs:send_text(6, tostring(servo) .. "," .. tostring(rc) .. "," .. tostring(vehicle) .. "," .. tostring(gps))
end
return update, 2000
end
return update, 2000
I’ve got the following message among others:
nil,rc: 0x24034CE8,vehicle: 0x24035E90,gps: 0x2403…
which, according to AI, shows that the servo module is nil, while rc, vehicle, and gps are present and working (as evidenced by the hexadecimal memory addresses).
Meaning the servo module is absent, and I can’t script servos at all.
After that, I checked the bdshot and normal firmwares up to 4.4.4 to find maybe the one with full scripting support, but to no avail.
Maybe I did something wrong, or are the devs leaving out the servo scripting support due to, maybe, hardware limitations?