Arducam Mega - Receiving image data through Serial

Hi, i am very happy with the various Arducam Mega cameras that I got from the kickstarter campaign. They work as I wished and i am diving deeper into the programming.

I use an ESP32 with the “full_feature” example. I am able to send various commands to the registers through Serial communication. Now, I am receiving a stream of image data, but i can not decode the data properly.

As far as I understand, the received image data is somewhat like: FF AA + COMMAND + IMAGELENGTH + IMAGEDATA + FILLER 00 + FF BB

But there are no starting/ending marks for the jpeg. neither can i see any metadata.

Here is a shortened example where the captured 96x96px JPG image should be mostly black.

b'\xff\xaa\x01(H\x00\x00\xa1\x10B\x10B\x10B\x10B\x10A\x10A\x10B\x10B\x10B\x10B\x10A\x10A\x10A\x10A\x10B\x10!\x10A\x10A\x10!\x10!\x08A\x08A\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!\x08!...............\x10!\x10!\x10\x01\x08!\x08\x01\x08!\x08\x01\x08\x01\x10!\x08!\x10!\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xbb'
  1. Can you point me to the right direction where I can find the documentation on the image data?

  2. Did you publish the source-code of the Arducam Mega GUI somewhere? (I took the win exe from here: Release Arducam mega sdk v2.0.4 · ArduCAM/Arducam_Mega · GitHub)

  3. I am receiving the shown binary data with a python script and want to save/view the image within python. is there some kind of example for that?

@Openscan
Hi,
Thanks for your interest of Arducam mega.
For the jpeg image, the image header is ''FF D8" and the image end is “FF D9”, which is a standard
jpeg image protocol.
About the GUI source code, sorry to tell you we just release close source version.
About a python script and want to save/view the image. I think the openCV is your best choise.
Feel free to let me know if you need more help.

Okay, thanks for the clarification. I indeed managed to receive the mentioned jpeg header and tail.

I did a little bit of messing with network monitoring and have a related question. Your provided GUI is sending the following command when connecting to the camera :

55 ff aa followed by three or four times 55 0f aa
According to your documentation Host communication protocol
the 55 ** aa are the required format (head - command - tail)

What is the first command 55 ff aa for ?

@Openscan
Hello,
About the 55 FF, this is our host communication protocol.This is our new protocol. We will update here as soon as possible.
For the detail, please refer to :
https://www.arducam.com/docs/arducam-mega/arducam-mega-getting-started/packs/HostCommunicationProtocol.html#communication-protocol-block-diagram