How to Save Flight Logs to Raspberry Pi Instead of Onboard DataFlash Logging

Hi everyone,

I’m working with a setup where I have a Raspberry Pi 4B alongside a Pixhawk Cube Orange on my drone. I’d like to save the flight logs (BIN or TLOG formats, BIN primary) directly to the Raspberry Pi’s SD card, rather than using the onboard SD card of the Pixhawk.

Can anyone guide me on how to configure the Pixhawk to redirect log files to the Raspberry Pi? Are there specific settings or scripts that I need to use to make this work?

Any help would be greatly appreciated!

Thanks in advance!

See Downloading and Analyzing Data Logs in Mission Planner — Copter documentation and set LOG_BACKEND_TYPE = 3 to log to both SDCards or to 2 to only log to the RPi.

You do need to run software on your RPi that redirects MAVLink logging messages to the SDCard.

1 Like

Thank you for your answer. To be honest, I’m still a bit confused. To achieve this, I need to connect the Telem1 or Telem2 port to the GPIO pins on the RPi and receive telemetry data, then write it to a specified location in a certain format, correct? What exactly does adjusting the LOG_BACKEND_TYPE parameter change? I am able to receive MAVLink messages from the Telem port without changing this parameter.

yes.

Read the documentation, it sends dataflash log files over MAVLink.

Yes, you receive “telemetry” messages over MAVLink already, but you do not yet receive “Dataflash” messages over MAVLink.

1 Like

I performed the task using the mavlink-router library, and it worked well. I want to share results with community:

  1. Without MAVLink Streaming: When using LOG_BACKEND_PARAMETER without enabling MAVLink streaming, I observed that no .bin log files were saved. Only .tlog files were created, which were quite limited in comparison.
  2. With MAVLink Streaming Enabled: By enabling MAVLink streaming and setting LOG_BACKEND_TYPE to 2, I was able to generate .bin log files as expected. This setup provided more detailed and comprehensive logging.

In summary, enabling MAVLink streaming by configuring LOG_BACKEND_TYPE to 2 is necessary to properly save .bin log files.

1 Like