ARK Documentation
  • ARK Electronics Docs
  • Embedded Computers
    • ARK Just A Jetson
      • Pinout
      • Block Diagram
      • Flashing Guide
      • 3D Model
  • Flight Controller
    • ARK FPV
      • Pinout
      • PX4 Instructions
      • ArduPilot Instructions
      • Betaflight Instructions
      • Bootloader Flashing Using DFU
      • 3D Models
    • ARKV6X
      • PX4 Instructions
      • ArduPilot Instructions
      • 3D Models
    • ARK Pixhawk Autopilot Bus Carrier
      • 3D Models and Case Files
      • Pinout
      • PX4 Instructions
    • ARK Jetson PAB Carrier
      • Getting Started
      • Block Diagram
      • Pinout
      • 3D Models and Case Files
      • Flashing Guide
      • ARK Software
        • Services
      • Autopilot Connections
      • Updating the Flight Controller Firmware
      • Micro USB Console
      • Power Cycling USB Ports
      • Mini DisplayPort
      • USB Wi-Fi Adapters
      • USB Bluetooth Adapters
    • ARK Pi6X Flow
      • Block Diagram
      • Pinout
      • 3D Models
      • Flashing Guide
        • Pi CM4 Lite with Micro SD
        • Pi CM4 with EMMC
        • After Flashing, Before Installing
        • Wi-Fi Setup
        • SSH
      • ARK Software
        • Services
      • Autopilot Connections
      • Updating the Flight Controller Firmware
    • ARK VOXL2 RTK PAB Carrier
      • Pinout
      • Connectors and Cables
      • 3D Models
      • Autopilot Connections
  • Electronic Speed Controller
    • ARK 4IN1 ESC
      • Pinout
      • Firmware
      • PWM Calibration
      • 3D Models
  • Radio
    • ARK M.2 LTE
      • OpenVPN
    • ARK Microhard DDL Carrier
      • 3D Model
  • Sensor
    • ARK Flow
      • Ardupilot Instructions
      • PX4 Instructions
      • 3D models & Case files
    • ARK Flow MR
      • Ardupilot Instructions
      • PX4 Instructions
      • 3D models & Case files
    • ARK CANnode
      • PX4 Instructions
      • 3D Models
  • GPS
    • ARK GPS
      • PX4 Instructions
      • 3D Models
    • ARK MOSAIC-X5 RTK GPS
    • ARK RTK Base
      • 3D Model
    • ARK RTK GPS
    • ARK TESEO GPS
    • ARK SAM GPS
      • PX4 Instructions
      • Ardupilot Instructions
      • Betaflight Instructions
      • 3D Model
  • Power
    • ARK PAB Power Module
      • PX4 Instructions
      • ArduPilot Instructions
      • 3D Model
    • ARK 12S PAB Power Module
      • PX4 Instructions
      • ArduPilot Instructions
      • 3D Model
  • IMU
    • ARK ADIS16507
      • PX4 Instructions
      • ArduPilot Instructions
      • 3D Model
    • ARK SCH16T
      • PX4 Instructions
      • ArduPilot Instructions
      • 3D Model
  • ROS2 & PX4
    • Mastering Precision Landing with PX4 & ROS2
    • Aruco Detectios Tutorial
    • Custom Modes Hardware Demo with PX4 & ROS2
    • Utilizing Custom Modes in PX4 with ROS2 and QGC
    • Simulated Offboard Mode
  • PX4 Log Encryption
  • Radio Integration
    • Doodle Labs Nimble Integration Guide for ARK Jetson PAB Carrier
  • Resources
    • Links
    • About
Powered by GitBook
On this page
  • Creating PX4 Board files for Encrypted logs
  • Downloading and Decrypting log files
  • Flight Review

PX4 Log Encryption

This section guides you through setting up log encryption in PX4 on our flight controllers, and then explains how to access, decrypt, and view the encrypted logs.

PreviousSimulated Offboard ModeNextRadio Integration

Last updated 1 month ago

Creating PX4 Board files for Encrypted logs

git clone --recurse-submodules git@github.com:PX4/PX4-Autopilot.git

Generate your Private and Public Key

cd PX4-Autopilot/Tools/log_encryption
python3 generate_keys.py

You can find your keys in

PX4-Autopilot/
│
├── keys/ 
│ ├── private/
│ │ ├── private_key.pem # RSA private key (2048-bit)
│ │
│ ├── public/ 
│ │ ├── public_key.der # Public key in DER format
│ │ ├── public_key.pub # Public key in hex format

The ARK flight controllers have targets setup for encryption

You should navigate to

PX4-Autopilot/boards/ark
  • ARK FPV

  • ARKV6X

  • ARKPI6X

You should replace the Dummy Key with your own Public Key in the following file

encrypted_logs.px4board
CONFIG_PUBLIC_KEY1="../../../keys/public/public_key.pub"

Then you can go ahead and make your board file

make ark_fpv_encrypted_logs
OR
make ark_fmu-v6x_encrypted_logs
OR
make ark_pi6x_encrypted_logs

Once that is done you can find your build file in

PX4-Autopilot/build/*.px4

You can go ahead and flash it on your flight controller.

Downloading and Decrypting log files

The encrypted logs can be found on the SD card in .ulge format.

You can either extract the files directly from the SD card our use the log tool provided below

Addresses might need to be adjusted

cd PX4-Autopilot/Tools/log_encryption

python3 download_logs.py /dev/ttyACM0 --baudrate 57600

OR

python3 download_logs.py udp:0.0.0.0:14550

To Decrypt the logs you can use

cd PX4-Autopilot/Tools/log_encryption

AND
# Uses default key + default folder
python3 decrypt_logs.py

OR
# Use --help to get all the options
python3 decrypt_logs.py --help

Your logs can be found in the following structure

PX4-Autopilot/
│
├── logs/ 
│ ├── encrypted/ 
│ │ ├── log-YYYY-MM-DD_HH-MM-SS_ID.ulge 
│ │
│ ├── decrypted/
│ │ ├── log-YYYY-MM-DD_HH-MM-SS_ID.ulg

Once you've decrypted your logs, you can view them using your preferred method.

Flight Review

If you choose to use Flight Review, you can embed your Private Key on your local Flight Review server, allowing your encrypted logs to be decrypted automatically when the .ulge is uploaded .

git clone --recurse-submodules git@github.com:PX4/flight_review.git

You should follow these steps

cd flight_review/app
pip install -r requirements.txt
# Note: preferably use a virtualenv
./app/setup_db.py

Add your Private Key to

flight_review/app/private_key/private_key.pem

Then you need to edit, the config file. There you can define your own network setup (Domain, VPN, etc).

flight_review/app/config_default.ini

You have to update the Private Key path with your own.

ulge_private_key = ../private_key/private_key.pem

Once you are done you can just open your server using

cd app
./serve.py --show

Once you have your server ready you can upload the Encrypted logs and view them.

Optionally you can also integrate logloader developed by ARK.

You should specify your server in the config file

logloader/config.toml

https://github.com/ARK-Electronics/logloader