I am wondering if there is a way of uploading a lua script remotely to an autopilot - i have been using the file upload method traditionally with a lift and shift of lua scripts into the scripts folder but im wondering if there is a way of doing this via a mavlink connection string in python? would be useful to no have to have a physical connection to the AP each time i want to update a script, thanks!
Thanks @LupusTheCanine
Was looking at the MAV FTP protocol - but can’t seem to find any examples of this being done from a remote source - only via mission planner - any chance you know of a guide / example you could point me towards?
For example you can use pymavlink mavutil.
Establish a connection, then use that to establish a mavftp connection and cmd_put the lua script.
You could probably check the code of the Methodical Configurator for a concrete example, or use any LLM for examples
I don’t understand what you mean by “remote source.” Mission Planner was designed to connect both locally (USB/serial) and remotely (serial radio or networked). You can use MP to transfer script files via MAVFTP over nearly any telemetry connection.
by remote i just mean something that doesn’t have a serial connection to the autopilot and is not a GCS with under the hood methods of wireless upload i.e
a machine running some custom python code with a mavlink connection string (pymavlink) as its only path to the AP
@WARGRaph the AMC uses the “mavftp.py” from pymavlink. That mavftp.py was first developed inside AMC for AMC based on the mavproxy code, but I have now moved it upstream to pymavlink so that other software can use it as well.
It is a command line executable so you can call it from bash or powersell scripts and also a python module meaning you can import it in your python code: