Hi Lorenz and Michael,
I've created a set of patches to make it possible to download SD card or
dataflash logs over MAVLink. The idea is to avoid having to boot into
the CLI on APM to download logs from the APM2, and also to make it
possible to pull all the binary logs off a PX4 without having to pull
the microSD card out of the board.
I've implemented the client side of this in MAVProxy for testing, and
I'd now like to get comments from the two of you on the protocol
changes, as it adds 6 new MAVLink messages to common.xml. I include the
new XML code below for you to get an idea of the protocol.
Lorenz, are you happy to have these 6 new messages in common.xml?
MichaelO, are you OK with the protocol structure and do you think you
could implement it reasonably in MissionPlanner? Bill, can you have a
look too?
One of the motivations for this work is it is another step towards
getting rid of the CLI on the APM2, which would save us a lot of flash
space. I also want to fix problems with the text download of logs via
the CLI, which leads to log corruption, doesn't work over a radio and is
generally ugly :-)
Full implementation is here:
https://github.com/tridge/ardupilot/tree/mavlink-log-wip
https://github.com/tridge/MAVProxy/commits/master
Cheers, Tridge
<message id="117" name="LOG_REQUEST_LIST">
<description>Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called.</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="start">First log id (0 for first available)</field>
<field type="uint16_t" name="end">Last log id (0xffff for last available)</field>
</message>
<message id="118" name="LOG_ENTRY">
<description>Reply to LOG_REQUEST_LIST</description>
<field type="uint16_t" name="id">Log id</field>
<field type="uint16_t" name="num_logs">Total number of logs</field>
<field type="uint16_t" name="last_log_num">High log number</field>
<field type="uint32_t" name="time_utc">UTC timestamp of log in seconds since 1970, or 0 if not available</field>
<field type="uint32_t" name="size">Size of the log (may be approximate) in bytes</field>
</message>
<message id="119" name="LOG_REQUEST_DATA">
<description>Request a chunk of a log</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="id">Log id (from LOG_ENTRY reply)</field>
<field type="uint32_t" name="ofs">Offset into the log</field>
<field type="uint32_t" name="count">Number of bytes</field>
</message>
<message id="120" name="LOG_DATA">
<description>Reply to LOG_REQUEST_DATA</description>
<field type="uint16_t" name="id">Log id (from LOG_ENTRY reply)</field>
<field type="uint32_t" name="ofs">Offset into the log</field>
<field type="uint8_t" name="count">Number of bytes (zero for end of log)</field>
<field type="uint8_t[90]" name="data">log data</field>
</message>
<message id="121" name="LOG_ERASE">
<description>Erase all logs</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
</message>
<message id="122" name="LOG_REQUEST_END">
<description>Stop log transfer and resume normal logging</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
</message>