.DAT file for the P4?

I found a way to access a file system on the P4 with FTP.

1) Start the P4 and connect it with USB
2) Start Wireshark with administrator rights (Wireshark · Download)
3) Double click the connection to the P4, on my PC it is named 'Local Area Connection 2'. If you can not find your connection, start Wireshark first without connecting the P4 to the PC, and check which connection appears if you have it connected.
4) Scroll down the live capturing protocol to see the newest messages
5) Start the DJI Assistant and choose the Phantom 4 device
6) In Wireshark appears a FTP request from user 'anonymous' to a destination IP
7) Now you can ftp the P4 as user 'anonymous' and the given IP

There are three folders in the root directory: 'blackbox', 'flyctrl' and 'upgrade'. Interesting is, that 'flyctrl' is empty at first, but if you click in the DJI Assistant on 'Flight Record', several dat-files named 'FLY###.DAT' appear in that folder. There are more files than listed in the DJI Assistant, but most of them have the same size/date, maybe some of them had been splitting.

I have uploaded a dat-file retrieved this way here
FLY010.DAT
 
Thank you for your good idea. I had only success with Firefox for downloading the .DAT-files. And only the big ones are flight logs
of a right flight. May be, the IP 192.168.42.2 is every where and every time the same.
But DatCon says, the files are not compatible. I am not an expert. The file begins with a header? I hope, BudWalker can help us.
H.
 
Subbed


Sent from my iPhone using PhantomPilots mobile app
 
Thank you for your good idea. I had only success with Firefox for downloading the .DAT-files. And only the big ones are flight logs
of a right flight. May be, the IP 192.168.42.2 is every where and every time the same.
But DatCon says, the files are not compatible. I am not an expert. The file begins with a header? I hope, BudWalker can help us.
H.
I looked at @josch 's file and it's not the right format. I need to look some more but I suspect it looks like the file you would get from using the DJI Assistant.

The file on the SD card will have ascii text that specifies the build date. That text starts at byte 16

0000000 \v \0 \0 \0 003 \0 \0 \0 016 \0 \0 \0 \0 \0 \0 \0
0000016 B U I L D M a r 1 1 2 0 1
0000032 6 0 2 : 3 6 : 5 9 \0 \0 \0 \0 \0 \0

I'll look some more at the file @josch supplied.
 
BudWalker - Great effort in decoding the .DAT files for the Phantom 3 range.

Have you managed to make any progress with regards to the Phantom 4 range please?

All the best.
 
Sorry, no.

Also, please note that the DJI Go App is now encrypting the log file. You can avoid this by not updating the Go App if you are running version 2.8.3 or older.
 
I think the only way is to read the internal SD card of the P4. I opened it up, but the SD card is glued to the slot; I think using hot glue. I don't know what is below the card so I think it's almost impossible to remove it. See picture below. My P4 is currently open for a battery mod, so I could try...

DJI-Phantom4-Teardown-07-flight-controller-heatsink.jpg
It is NOT glued, There is a metal tab that stops the SD card from "coming out" CAREFULLY bend it downwards, so it is all flat...the card will come out. BUT: REMEMBER that this will VOID your warranty.
 
The P4 and P3 .DAT files are similar. They both get recorded onto an internal SD card that is very difficult to access physically. They are both encoded which allows the internal bus to be more efficient. In the case of the P3 the .DAT can be directly accessed via the USB port. All it takes is a file copy.

If we were able to access the P4 .DAT in the same way; i.e., just a file copy then it should be relatively simple to determine the format and DatCon would work for P4 .DAT files. @FredzMaxxUAV obtained a set of these P4 .DAT files when he had the P4 disassembled and was able to physically extract the SD card. I was then able to use some of the tools that I developed to reverse engineer the P3 .DAT file. The P3 and P4 .DATs use the same kind of format but are different enough that it would require some work to to determine the format.

The real problem is that, so far, we've been unable to get a copy of the internal SD card's .DAT file. Unlike the P3, there is no way to directly view and retrieve the internal .DAT files on the P4. Instead the P4 .DAT files are retrieved via the DJI Assistant app which then produces three files that can be sent to DJI. I've looked at these files and they are either encoded, compressed or encrypted. It doesn't make much sense to encode them. There isn't much to be gained by compressing the internal .DAT file since it already has a lot of entropy, i.e. it can't be compressed much further. But, I did look at the obvious compression schemes.

I think the files that the DJI Assistant produces are probably an encryption of the internal .DAT file. If so, then it's effectively impossible to retrieve the internal .DAT file from these files.

One possibility is to determine how the DJI Assistant produces the three file from the internal .DAT. If the bits coming across the USB to the DJI Assistant aren't encrypted then it should be possible to mimic the DJI Assistant and get those unencrypted bits. @Hans 75 attempted to use a USB sniffer but didn't get very far.



The FLYXXX.DAT files are stored on the internal SD CARD onboard the Phantom 4.
The SD CARD sits inside the support slot, and is held in place with part of the metal slot bent upwards to secure the SD card in place. CAREFULLY prise downwards, and once the metal tab is flat, the SD CARD can be removed, whereby the FLYXXX.DAT files can be seen. The next trick is to be able to read these .DAT files, so they show a comprehensive list of data inputs/readings/levels. Any Hex editor can give a little bit of an insight into the P4 file structure. but I do not know much about this. I do have a few. DAT files I would certainly love to have a look at. Like the last flight, when a HELISTAR non OEM Prop flew apart MID-FLIGHT.....That was the end of my 2 week old P4!!!!!! deadset really PISSED OFF. cheers guys.
 
I found a way to access a file system on the P4 with FTP.

1) Start the P4 and connect it with USB
2) Start Wireshark with administrator rights (Wireshark · Download)
3) Double click the connection to the P4, on my PC it is named 'Local Area Connection 2'. If you can not find your connection, start Wireshark first without connecting the P4 to the PC, and check which connection appears if you have it connected.
4) Scroll down the live capturing protocol to see the newest messages
5) Start the DJI Assistant and choose the Phantom 4 device
6) In Wireshark appears a FTP request from user 'anonymous' to a destination IP
7) Now you can ftp the P4 as user 'anonymous' and the given IP

There are three folders in the root directory: 'blackbox', 'flyctrl' and 'upgrade'. Interesting is, that 'flyctrl' is empty at first, but if you click in the DJI Assistant on 'Flight Record', several dat-files named 'FLY###.DAT' appear in that folder. There are more files than listed in the DJI Assistant, but most of them have the same size/date, maybe some of them had been splitting.

I have uploaded a dat-file retrieved this way here
FLY010.DAT
Forget all that above rigamarole!!!
Just remove the INTERNAL SD CARD,,,, held in place with a metal tab....push down gently and CAREFULLY...till all flat, then the SD card can be removed.... BUT REMEMBER this: You will VOID any DJI warranty that you may have. ( if they see what you have done that is!!!!)
 
The P4 and P3 .DAT files are similar. They both get recorded onto an internal SD card that is very difficult to access physically. They are both encoded which allows the internal bus to be more efficient. In the case of the P3 the .DAT can be directly accessed via the USB port. All it takes is a file copy.

If we were able to access the P4 .DAT in the same way; i.e., just a file copy then it should be relatively simple to determine the format and DatCon would work for P4 .DAT files. @FredzMaxxUAV obtained a set of these P4 .DAT files when he had the P4 disassembled and was able to physically extract the SD card. I was then able to use some of the tools that I developed to reverse engineer the P3 .DAT file. The P3 and P4 .DATs use the same kind of format but are different enough that it would require some work to to determine the format.

The real problem is that, so far, we've been unable to get a copy of the internal SD card's .DAT file. Unlike the P3, there is no way to directly view and retrieve the internal .DAT files on the P4. Instead the P4 .DAT files are retrieved via the DJI Assistant app which then produces three files that can be sent to DJI. I've looked at these files and they are either encoded, compressed or encrypted. It doesn't make much sense to encode them. There isn't much to be gained by compressing the internal .DAT file since it already has a lot of entropy, i.e. it can't be compressed much further. But, I did look at the obvious compression schemes.

I think the files that the DJI Assistant produces are probably an encryption of the internal .DAT file. If so, then it's effectively impossible to retrieve the internal .DAT file from these files.

One possibility is to determine how the DJI Assistant produces the three file from the internal .DAT. If the bits coming across the USB to the DJI Assistant aren't encrypted then it should be possible to mimic the DJI Assistant and get those unencrypted bits. @Hans 75 attempted to use a USB sniffer but didn't get very far.

If you need P4 FLYXXX.DAT files my friend, let me know how I can get one to you 340Mb though!!! I removed the internal SD CARD and copied all of the files across to my PC. It is VERY easy to access the internal SD card.
 
Last edited:
I think the only way is to read the internal SD card of the P4. I opened it up, but the SD card is glued to the slot; I think using hot glue. I don't know what is below the card so I think it's almost impossible to remove it. See picture below. My P4 is currently open for a battery mod, so I could try...

DJI-Phantom4-Teardown-07-flight-controller-heatsink.jpg
DEf. NOT glued in my friend. Just bend the metal tab downwards GENTLY...till all flat, the SD card can then be removed
 
@VK5PO First of all, welcome to the forum.
Seems that your P4 is different than those P4s owned by other pilots. I don't own a P4 but have been told that the internal SD card is glued in place. Maybe there has been a change in the fabrication process and the newer P4s will allow easier removal of the SD card.

The P4 .DAT files on the internal SD card have a similar, but different, record structure to those of the P3 .DAT file. The P4 .DAT record structure would have to be reverse engineered like what was done with the P3 .DAT file. I don't own a P4 so I couldn't do the reverse engineering. If someone else wanted to do that I could provide some of the tools that were developed to reverse engineer the P3 .DAT file. A good place to start would be with the publicly available DatCon source.

I just received my Mavic and haven't had a chance to see if the SD is easily accessible. I'm thinking probably not. But, if it were easily accessible and it had the same record structure as the P4 .DAT then I would probably have a go at reverse engineering it.
 
Hi Bud, Thanks.
The SD cards are not glued in. the metal "structure", that holds the SD card in place has a silicon based "glue" around it, but the card can be removed reasonably easy if care is taken. If you want a look at P4 .DAT files, let me know how I can upload a large file to you. Chances are the Mavic and P4 .dat files will be the same, also slightly different headers perhaps.
Thanks for the response. PS, I took
P4_SD_CARD_onTOP.jpg
a picture to show that the P4 SD card situation is identical to other pictures I have seen on this forum.
 
Hi Bud, Thanks.
The SD cards are not glued in. the metal "structure", that holds the SD card in place has a silicon based "glue" around it, but the card can be removed reasonably easy if care is taken. If you want a look at P4 .DAT files, let me know how I can upload a large file to you. Chances are the Mavic and P4 .dat files will be the same, also slightly different headers perhaps.
Thanks for the response. PS, I tookView attachment 67928 a picture to show that the P4 SD card situation is identical to other pictures I have seen on this forum.
Thanks, I already have several of the P4 .DAT files.
 
I was able to decompile Android version of DJI GO 3.0.1 and to find a part of the code, where the "Enter flight data mode" button is being hidden for P4
I edited it and compiled it back into apk file
I was able to install it and run it on my phone
but I have P3A

so question is, if there is any volunteer with P4, who would install this apk on his phone and try to look, if that button is there and what will happen after click on it
there is a chance that P4 will then go into the flight data mode just like P3 goes and that those DAT files could be retrieved via USB
 
  • Like
Reactions: BudWalker
Regarding all this issue of DAT files stored in an internal card, does any of you know if those 4 Gb of memory are enough to save thousand of flights? Or hundreds? ... Does the system start to erase the earlier flights when the card is full like in the case of video cache
?


Sent from my iPhone using PhantomPilots
 
Regarding all this issue of DAT files stored in an internal card, does any of you know if those 4 Gb of memory are enough to save thousand of flights? Or hundreds? ... Does the system start to erase the earlier flights when the card is full like in the case of video cache
?


Sent from my iPhone using PhantomPilots
Don't know about the P4 but on the P3 the SD starts recycling when it gets to 2.5 Gb. The size of a .DAT is about .19 MB for every second the battery is on.
 
Many thanks, BudWalker. If the rates are the same in P4, this means that every 3.5 hours of batteries ON the maximum capacity is reached, and older .DAT files start to dissapear to give place to new ones.


Sent from my iPhone using PhantomPilots
 

Recent Posts

Members online

No members online now.

Forum statistics

Threads
143,086
Messages
1,467,528
Members
104,965
Latest member
Fimaj