Seeking Python Solution to Convert Phantom 4 .DAT Flight Logs to CSV

Joined
Mar 29, 2025
Messages
1
Reaction score
2
Age
23
I'm developing an app that processes Phantom 4 flight logs autonomously in the background using Python, and I've run into a problem with the flight log formats. While DJI apps save flight logs in a folder called "DJI" that other apps can access, alternative apps like Litchi store the logs in CSV format within the Android/data folder, which is restricted to other applications. This means that I can only use a DJI app (DJ Go/ Pilot) for this purpose, but the flight logs are saved in an encrypted .DAT format that Python can't directly read.

I've tried using the DROP code from GitHub (GitHub - dumbledrone/DROP) to convert the .DAT into .CSV data, but the files it produces are incomplete—they lack some parameters for every timestamp, and the specific timestamp for each measurement isn't available. What I'm really after is a Python-based solution that can convert the encrypted .DAT files from the Phantom 4 into a fully detailed CSV (or JSON) format, similar to what the Litchi app outputs.

If anyone has any ideas, suggestions, or code that can achieve this conversion, I'd greatly appreciate your help.
 
I'm developing an app that processes Phantom 4 flight logs autonomously in the background using Python, and I've run into a problem with the flight log formats. While DJI apps save flight logs in a folder called "DJI" that other apps can access, alternative apps like Litchi store the logs in CSV format within the Android/data folder, which is restricted to other applications. This means that I can only use a DJI app (DJ Go/ Pilot) for this purpose, but the flight logs are saved in an encrypted .DAT format that Python can't directly read.

I've tried using the DROP code from GitHub (GitHub - dumbledrone/DROP) to convert the .DAT into .CSV data, but the files it produces are incomplete—they lack some parameters for every timestamp, and the specific timestamp for each measurement isn't available. What I'm really after is a Python-based solution that can convert the encrypted .DAT files from the Phantom 4 into a fully detailed CSV (or JSON) format, similar to what the Litchi app outputs.

If anyone has any ideas, suggestions, or code that can achieve this conversion, I'd greatly appreciate your help.
Just for fun a couple weeks ago I asked AI (grok I think) to write some python code for a GIS task and within a few seconds it spit it out. I didn't test it so I don't know whether it worked.
 
  • Like
Reactions: RodPad
, but the flight logs are saved in an encrypted .DAT format that Python can't directly read.
Are they? I thought that all flight logs were stored as a text file that can be converted into CSV via airdata or phantom log viewer
 
  • Like
Reactions: RodPad
I thought that all flight logs were stored as a text file that can be converted into CSV via airdata or phantom log viewer
A TXT flight log is stored on the mobile device used to fly the drone. A DAT flight log is also stored on the drone itself.

Flight log readers (like Flight Reader) are only able to read TXT flight logs since DAT flight logs (for all drones DJI sells) can only be decrypted by DJI.
 
I'm developing an app that processes Phantom 4 flight logs autonomously in the background using Python, and I've run into a problem with the flight log formats. While DJI apps save flight logs in a folder called "DJI" that other apps can access, alternative apps like Litchi store the logs in CSV format within the Android/data folder, which is restricted to other applications. This means that I can only use a DJI app (DJ Go/ Pilot) for this purpose, but the flight logs are saved in an encrypted .DAT format that Python can't directly read.

I've tried using the DROP code from GitHub (GitHub - dumbledrone/DROP) to convert the .DAT into .CSV data, but the files it produces are incomplete—they lack some parameters for every timestamp, and the specific timestamp for each measurement isn't available. What I'm really after is a Python-based solution that can convert the encrypted .DAT files from the Phantom 4 into a fully detailed CSV (or JSON) format, similar to what the Litchi app outputs.

If anyone has any ideas, suggestions, or code that can achieve this conversion, I'd greatly appreciate your help.
Good luck with this. I'm the author of DatCon which is a Java app that converts a .DAT log file to .csv. The source code can be found at GitHub - BudWalkerJava/DatCon There have been a few attempts that I know of to convert the Java code to Python. AFAIK these attempts were not successful.

DatCon works for P4 .DAT logs since they are only encoded, not encrypted.
 
  • Like
Reactions: waterwin and RodPad

Members online

Forum statistics

Threads
143,518
Messages
1,471,084
Members
105,492
Latest member
Vtmadmax