alufers / dreame_mcu_protocol

10 stars 2 forks source link

snapshot of rgb camera possible? #1

Open NiklasVoigt opened 1 week ago

NiklasVoigt commented 1 week ago

I have been trying to retrieve an RGB image from the camera using various .so files such as node_camera_ai.so and node_camera_streamer.so. However, I'm facing issues understanding the correct way to use these files or which commands to issue in order to capture an RGB image.

I successfully used the following command to open/close the camera: avacmd streamer '{"cmd":"open_camera"}' avacmd streamer '{"cmd":"close_camera"}'

Any help on this issue would be greatly appreciated!

alufers commented 1 week ago

Sorry, don't have a robot with a RGB camera. You can try to use the commands that work for the IR camera, but with the AVA node changed:

avacmd streamer '{"cmd":"open_camera"}'
avacmd streamer '{"cmd":"take_photo", "path":"/tmp/photo.bmp"}'
avacmd streamer '{"cmd":"close_camera"}'

There is a slim chance that it will work.

Otherwise, you will need to discover the commands using Ghidra. You can open the .so files in Ghidra, and then search for the AvaJsonMsgProcess method. It is responsible for decoding the JSON commands. Unfortunately it's C++, so ghidra really struggles with decompiling it, but with some guesswork and looking at the strings it should be possible to reconstruct the commands.