strodgers / epomaker-controller

42 stars 3 forks source link

Support animated GIFs #27

Open strodgers opened 3 months ago

strodgers commented 3 months ago

Currently only support static images, but should work out how to do GIFs too

strodgers commented 2 months ago

This is turning out to be more difficult than I thought

I was hoping (naively) that the process would be something like uploading multiple rgb565 images with some meta data about frame timing, but turns out GIFs are more complicated than that

So far I have at least worked out another part of the image command initialization_data for a static image is actually a size:

initialization_data = "a5000100f4da008b0000a2ad"

the f4da (little endian) byte is actually 56052 in decimal, which is a familiar number since it's the number of bytes in a still image uploaded to the board (162x173, 2 bytes per pixel). However for GIFs the sniffed USB packet that would correspond to a initialization_data look more like:

a5001242682e00700f40936d

.. which puts the size at more like 11880 (the 0x682e), so I have no idea what process is going on when a GIF is uploaded.

I also see that some of the bytes are things like number of frames and a time between frames; in the example above the 0x12 is number of frames and 0x42 is time in ms between frames. Makes sense that for static images these numbers are just 0x01 and 0x00. No idea what the rest of it means though.