Download Log Files
This tutorial will help you copy log files from Ardupilot and PX4 on the OcPoC. We also provide a script to help automate the log download over either Wifi or from a mounted SD Card.
The process in this tutorial assumes the user is running Ubuntu on their Host machine. Any copying over SSH also requires a WiFi and SSH connection, see Connecting OcPoC to WiFi and Connecting over SSH.
Ardupilot and PX4 store their flight logs in two different locations on the OcPoC's root file system:
- Ardupilot: /var/APM/logs
- Ardupilot stores logs as *.BIN files in the same folder no matter the time/date of the log.
- PX4: /root/rootfs/fs/microsd/log
- PX4 stores logs as *.ulg files which are separated into directories corresponding to the date of the flight (based on GPS time).
From the SD Card
With the OcPoC's SD card mounted to your host computer, you can simply copy any (or all) of the log files located in the appropriate directory. For example:
sudo cp /media/$USER/rootFs/var/APM/logs/*.BIN /path/to/desired/location/.
You'll first need to connect the battery and WiFi dongle to the OcPoC. If you don't already know, make sure you check the OcPoC's IP address:
ifconfig wlan0 | grep "inet addr"
With WiFi working and a known IP address, you can copy log files/directories with the scp command from your host computer as shown here:
sudo scp -r [email protected]:/root/rootfs/fs/microsd/log /path/to/desired/location/.
You'll be asked to enter the password for the OcPoC, which if unchanged is root.
In our github repo Aerotenna/OcPoC_Mini_Zynq_Files/User_Hub_Scripts, we have provided a script 'log_download.sh' to automate the process of copying log files from the OcPoC. The script is written for Ubuntu bash, and will check you're already downloaded log files against all logs that reside on the OcPoC, only downloading new log files. When calling the script, it needs to know what flight stack (Ardupilot or PX4) to look for, and it needs the OcPoC's IP address if you're downloading over WiFi.
Below are instructions for calling the script. You will be prompted for your sudo password, as well as the OcPoC's login password for any ssh/scp tasks.
# To Copy PX4 Logs from SD Card (mounted to host computer) ./log_download.sh PX4 # To Copy Ardupilot Logs from SD Card (mounted to host computer) ./log_download.sh APM # To Copy PX4 Logs over WiFi ./log_download.sh PX4 192.168.2.8 # To Copy APM Logs over WiFi ./log_download.sh APM 192.168.2.8
From the Ground Station (over Mavlink)
This is technically possible over the telemetry radio, but the download takes a very long time to complete. If downloading flight logs via the Ground Station is the only method available to you, we recommend connecting via the USB port. Follow these steps to download Ardupilot logs via Mission Planner:
- Connect to the OcPoC via the USB1 port (using PuTTY in Windows)
- From the terminal, stop the autorun of arducopter, then run arducopter with telemetry through the USB port using the following commands:
/etc/ardupilot stop ./arducopter -A /dev/ttyPS0 -B /dev/ttyS3
- With the USB cable still connected to the OcPoC, close the SSH program (e.g. PuTTY), open Mission Planner, and connect to the OcPoC using the correct COM port for the USB cable with a Baud Rate of 115200
- When you're connected via Mission Planner, you can download the flight logs. Follow Ardupilot's simple documentation for this step: Downloading flight logs from Mission Planner
Updated over 4 years ago