maxbbraun / accent

Accent Smart Picture Frame
https://accent.ink
MIT License
199 stars 16 forks source link

Corrupted Image on Eink Display #17

Open KianYeo opened 3 years ago

KianYeo commented 3 years ago

Has one encountered problems with corrupted images on the eink display? Its seems like I am getting corrupted images quite often. I don't think its a hardware problem since I am able to have a standalone program that consistently displays an image on the eink from the ESP32 memory.

I am suspecting its the HTTP get request that receives corrupted bytes from the sever, but I don't know how to verify that. Any advice on this?

Thanks in advance!

maxbbraun commented 3 years ago

Hi! Do you have a picture of the issue?

KianYeo commented 3 years ago

Here are some example images of the issue.

https://ibb.co/KwYJVr2 https://ibb.co/9GSNtNR https://ibb.co/HXHNZxZ

KianYeo commented 3 years ago

The client is supposed to download 61440 bytes in total from the server. What I noticed is that it always show 61440 bytes read in total even though the eink image is corrupted. This is with the default RootCA in the original client codes.

However, when I changed the RootCA to another one from Google (https://pki.goog/repository/), I noticed that sometimes it downloads less than 61440 bytes gives the 'download complete' message, and this is when the image gets corrupted.

As a quick fix, I just added an extra few lines of code to check if the downloaded bytes is equals to 61440, if not, it will attempt to reconnect to the server and download again.