Hi All,
After some discussions with Philip Rowse yesterday I've pushed in a new
SERIAL_CONTROL MAVLink packet which allows for updating and control of
serial ports via MAVLink over USB.
This makes it possible to update the firmware on a 3DR radio (or RFD900)
embedded in an aircraft without removing it, by plugging into the USB
port on the board and running an updater that is able to use
SERIAL_CONTROL packets instead of normal serial operations.
I've also updated the uploader.py script that comes with SiK to support
mavlink updates of SiK firmware if you pass the --mavlink option. The
way it works is it instantiates a new MavlinkSerialPort object from
pymavlink, which behaves the same as a normal python Serial object, but
communicates via SERIAL_CONTROL mavlink packets. See the following
changes:
https://github.com/mavlink/mavlink/commit/81e75915856ace07989af8511f46b1e63848b075
https://github.com/tridge/SiK/commit/64071b935504ee09626e30e87708566f56cab97d
To use it, run something like this:
tools/uploader.py --port /dev/ttyACM3 new-firmware.ihx --mavlink --mavport=0
that would update the firmware on a radio attached to TELEM1 on a
Pixhawk. It takes about 1 minute to do the update (about 3x as long as
when you are directly attached to the radio). To stop users getting
bored I added a progress bar.
I've also added an example 'serial' command module to MAVProxy that
allows you to run AT commands on a radio attached to a PX4/Pixhawk so
you can change or reset settings on a radio without removing it from an
aircraft:
https://github.com/tridge/MAVProxy/commit/4cd4e0596f1736e64b1120a098809c5149c990cd
The idea behind that is to allow users to solve tricky situations where
their air radio is not able to talk to their ground radio, so they
couldn't previously change its settings without removing it from the
aircraft. Now they will be able to change the air radio settings using a
GCS connected to the USB port of their board.
I'm hoping that APMPlanner and MissionPlanner will implement this new
protocol. Michael? Bill?
The SiK changes also include updates from Luke Hovington to support
uploading firmware to the new RFD900u radios from RFDesign. The RFD900u
needs to use banked programming with 24 bit addresses.
Luke, I also tried to bring in some more of your changes from your SiK
branch to support the RFD900u fully in the master SiK tree, but ran
across the problem of the changed CRC. Can we make a time to discuss how
to bring RFD900u support into upstream?
The new SERIAL_CONTROL protocol also allows for remote manipulation of
GPS serial ports via MAVLink, which in principle will make it possible
to use GPS manipulation/config tools via MAVLink, or to update GPS
firmware via MAVLink. I think it would be possible to write a virtual
serial driver for Windows to make it possible to use u-Blox uCenter on a
remote GPS. It should also make it possible to update a Piksi firmware
via MAVLink. I haven't tested this though, so it will need someone to
write the interface code, test and document it.
Cheers, Tridge