Please select Into the mobile phone version | Continue to access the computer ver.
Importing DSP files?
Uploading and Loding Picture ...(0/1)
o(^-^)o
Lake
lvl.1
Offline

Hi, all, I'm a science department chair at a school and we recently bought an RMS1 to use with our programming students. Our ideal scenario is having students work on Python code independently on their own computers, then sending code files to test on the bot.

We just got the Windows beta working and I love the ease of use vs. the iPad, especially for programming. I'm excited to be able to import files - DSP? - to run, but they're apparently not just .PY Python files with a different extension. Does anyone know this format? Can anyone share what a well-formed DSP that imports correctly looks like?


Thanks in advance!
2019-9-23
Use props
BGA
First Officer
Offline

Figuring the file format of the .dsp files is actually a holy grail. When I fnish the library I am working on to help with development outside the app (https://git.bug-br.org.br/bga/robomasters1), knowing the actual file format would allow programs to be exported in a ways that would be usable in the robot itself.

Because of this, I started investigating it and the file seems to be encoded in something akin to base64 (although it is not). At least based on the file sizes and what I *GUESS* they contain, the file is most likely only encoded, not compressed.

I guess the answer to your specific question is: No, the format of the file is not known at this time (by anyone outside of DJI, that is).
2019-9-23
Use props
Lake
lvl.1
Offline

BGA Posted at 9-23 11:23
Figuring the file format of the .dsp files is actually a holy grail. When I fnish the library I am working on to help with development outside the app (https://git.bug-br.org.br/bga/robomasters1), knowing the actual file format would allow programs to be exported in a ways that would be usable in the robot itself.

Because of this, I started investigating it and the file seems to be encoded in something akin to base64 (although it is not). At least based on the file sizes and what I *GUESS* they contain, the file is most likely only encoded, not compressed.

Ah, good to know, I'm glad someone's on it! I'll try to figure it out as well. Do we have an example DSP file?  I'll check out your git.
2019-9-23
Use props
BGA
First Officer
Offline

Lake Posted at 9-23 11:33
Ah, good to know, I'm glad someone's on it! I'll try to figure it out as well. Do we have an example DSP file?  I'll check out your git.

I just shared one of the sample programs via email and am using that to try to figure things up.
2019-9-23
Use props
BGA
First Officer
Offline

BGA Posted at 9-23 11:43
I just shared one of the sample programs via email and am using that to try to figure things up.

It appears that the file is also compressed (or, at least, encoded using a feedback loop). It also uses some padding.

I shared a script, added a single byte to it and them compared the 2 files:

$ cmp -b -l Twister00e1375a496c4f938ae2736ec06dfb96_* | head
  65 110 H    116 N
  66 164 t    116 N
  67 144 d    105 E
  68 121 Q    157 o
  69 157 o    107 G
  70 114 L    125 U
  71 146 f    130 X
  72 114 L    131 Y
  73 112 J    164 t
  74 106 F    102 B

All bytes up to byte 62 are identical. Then almost all bytes change after that:

$ cmp -b -l Twister00e1375a496c4f938ae2736ec06dfb96_* | wc -l
1309

(File size is 1388 bytes)

Then I shared a completely empty program. it is still 664 bytes in size. When comparing it to the other 2 programs, the first 43 bytes are identical (so I assume the first 43 bytes are a header of some type).

Another interesting data point is that the same program in Scratch is several times bigger.

2019-9-23
Use props
BGA
First Officer
Offline

BGA Posted at 9-23 11:23
Figuring the file format of the .dsp files is actually a holy grail. When I fnish the library I am working on to help with development outside the app (https://git.bug-br.org.br/bga/robomasters1), knowing the actual file format would allow programs to be exported in a ways that would be usable in the robot itself.

Because of this, I started investigating it and the file seems to be encoded in something akin to base64 (although it is not). At least based on the file sizes and what I *GUESS* they contain, the file is most likely only encoded, not compressed.

Forget it. I just figured out that the file *IS* base64 encoded. Decoding it results in an obviously compressed file. Now I am trying to figure out compression. One layer figured at least.
2019-9-23
Use props
Lake
lvl.1
Offline

Nice detective work! I'll try a few things as well but it seems you have a great angle on cracking it. Thanks for the info and program, it'll be exciting to figure this out.
2019-9-23
Use props
BGA
First Officer
United States
Offline

Lake Posted at 9-23 13:29
Nice detective work! I'll try a few things as well but it seems you have a great angle on cracking it. Thanks for the info and program, it'll be exciting to figure this out.

See https://forum.dji.com/forum.php? ... D702%26typeid%3D702

I wrote a codec for dsp files that might help you with what you want.
2019-11-13
Use props
DanMan32
lvl.4
Flight distance : 2011066 ft
United States
Offline

What was the point of the DSP anyway?   Seems the DSP is larger than the PY file, almost double.
My Google research on the file extension turned up that DSP is Microsoft Visual Studio 6.0 C++ project file.
6-5 14:07
Use props
BGA
First Officer
United States
Offline

DanMan32 Posted at 6-5 14:07
What was the point of the DSP anyway?   Seems the DSP is larger than the PY file, almost double.
My Google research on the file extension turned up that DSP is Microsoft Visual Studio 6.0 C++ project file.

The DSP format for the Robomaster is not related to the Microsoft thing. Anyway, it is mostly python code with some added metadata. Or, put in a different way, it is a XML file that contains metadata and the code itself that is encrypted and then has base64 encoding applied to it.
6-5 15:27
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules