DataFlash file structure - HitecCS/KDataflashParser GitHub Wiki

What are DataFlash Logs?

Ardupilot/Px4 DataFlash files are log files generated by the autopilot during. In order to download them you can use Mission Planner, QGroundControl, Mission Control or a similar Mavlink GCS software after a flight. Dataflash logs can also be downloaded via Here are some directions of how to do that using Mission Planner: https://ardupilot.org/copter/docs/common-downloading-and-analyzing-data-logs-in-mission-planner.html

By default, the logs will likely be in a binary (.bin) format. To see your logs in a more human-readable format you can use Mission Planners "Convert .Bin to .Log" function. You can find this function on the Data Page (Top left corner) > DataFlash Logs Tab (Bottom half of left column, right most tab by default (use arrows)).

How are DataFlash Logs formatted?

DataFlash files use a self-describing format. Below is a sample .log file's contents. As you can see, the first line is a FMT message which describes the the format of a FMT message. This line can be read as follows: FMT message: Type = 128, Length = 89 bytes, Name = FMT, Format = BBnNZ, Columns = Type,Length,Name,Format,Columns

The Format column here is describes the C datatypes used and also useful for parsing the data. Here the format reads as follows: BBnNZ:

  1. B = unsigned char -> Kotlin Int
  2. B = unsigned char -> Kotlin Int
  3. n = char[4] -> Kotlin String
  4. N = char[16] -> Kotlin String
  5. Z = char[64] -> Kotlin String

You can find the full mapping used in the DFFormat class in this projects source.

The messages uses in a DataFlash file are variable between autopilots but here are a few helpful links:

ArduPlane: https://ardupilot.org/plane/docs/logmessages.html

ArduCopter: https://ardupilot.org/copter/docs/logmessages.html

FMT, 128, 89, FMT, BBnNZ, Type,Length,Name,Format,Columns
FMT, 219, 76, UNIT, QbZ, TimeUS,Id,Label
FMT, 218, 44, FMTU, QBNN, TimeUS,FmtType,UnitIds,MultIds
FMT, 220, 20, MULT, Qbd, TimeUS,Id,Mult
FMT, 129, 31, PARM, QNf, TimeUS,Name,Value
FMT, 130, 50, GPS, QBIHBcLLeffffB, TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,Alt,Spd,GCrs,VZ,Yaw,U
FMT, 131, 50, GPS2, QBIHBcLLeffffB, TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,Alt,Spd,GCrs,VZ,Yaw,U
FMT, 132, 50, GPSB, QBIHBcLLeffffB, TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,Alt,Spd,GCrs,VZ,Yaw,U
FMT, 212, 30, GPA, QCCCCfBIH, TimeUS,VDop,HAcc,VAcc,SAcc,YAcc,VV,SMS,Delta
FMT, 213, 30, GPA2, QCCCCfBIH, TimeUS,VDop,HAcc,VAcc,SAcc,YAcc,VV,SMS,Delta
FMT, 214, 30, GPAB, QCCCCfBIH, TimeUS,VDop,HAcc,VAcc,SAcc,YAcc,VV,SMS,Delta
FMT, 133, 53, IMU, QffffffIIfBBHH, TimeUS,GyrX,GyrY,GyrZ,AccX,AccY,AccZ,EG,EA,T,GH,AH,GHz,AHz
FMT, 134, 75, MSG, QZ, TimeUS,Message
...
UNIT, 125978890, 63, UNKNOWN
UNIT, 125978901, 65, A
UNIT, 125997320, 100, deg
UNIT, 125997332, 98, B
UNIT, 125997343, 107, deg/s
UNIT, 125997354, 68, deglatitude
UNIT, 125997366, 101, deg/s/s
UNIT, 125997377, 69, rad/s
UNIT, 125997388, 71, Gauss
UNIT, 125997481, 104, degheading
ATT, 126016961, -0.62, -0.18, 29.36, -2.17, 0, 339.01, 0.18, 0
PIDR, 126017058, -0.9777778, 0.03860957, 0, -0.4604835, 0, -0.2517601, 0
PIDP, 126017128, 70.06734, 0.04689513, 0, 38.92773, 0, 20.45574, 0
PIDY, 126017143, 0, 0, 0, 0, 0, 0, 0
PIDS, 126017230, 0, 0, 0, 0, 0, 0, 0
NKF1, 126017246, -0.18, -2.17, 339, 0.1767708, 0.1447524, -0.07210433, -0.0786199, -4.082229, -1.607058, -0.1206928, 0.04, 0.04, -0.01, 149.3
NKF2, 126017246, 0, 0, 0, 0, 0, 0, 300, -43, 403, 0, 0, 0, 0
NKF3, 126017246, -0.23, 0.07, 0.19, 0.16, 0.09, -0.26, 0, 0, 0, -0.27, 0
NKF4, 126017246, 0.06, 0, 0.01, 0, 0, 0.0004692867, 0, 0, 0, 16, 41791, 0, 0
NKF5, 126017246, 0, 0, 0, 0, 0.32, 0.23, 0, 0, 0.5, 0.0009612293, 0.00988167, 0.01565032
NKQ1, 126017246, 0.9830588, -0.003664318, -0.02046399, -0.1821082
NKF6, 126017246, -0.04, -1.49, 337.04, 0.02893924, 0.1757903, 0.06170472, -0.08881542, -4.23088, -1.578335, 0.1673338, -0.01, 0.2, -0.12, 149.3
NKF7, 126017246, -4, 0, 0, 0, 0, 0, 300, -43, 403, 0, 0, 0, 0
NKF8, 126017246, -0.37, 0.1, 0.32, 0.06, 0.1, -0.01, 0, 0, 0, -2.47, 0
NKF9, 126017246, 0.1, 0, 0, 0.02, 0, 0.0005283817, 0, 0, 0, 16, 41791, 0, 0
NKQ2, 126017246, 0.9798979, -0.001594872, -0.01477867, -0.1989454
POS, 126017747, 36.7279867, 127.4285631, 149.42, 0.1206928, 0.1206928