Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.jpg file downloads with wrong header and file size #884

Open
3 tasks done
rsoric opened this issue Nov 6, 2024 · 1 comment
Open
3 tasks done

.jpg file downloads with wrong header and file size #884

rsoric opened this issue Nov 6, 2024 · 1 comment

Comments

@rsoric
Copy link

rsoric commented Nov 6, 2024

Answers checklist.

  • I have read the documentation ESP-AT Programming Guide and the issue is not addressed there.
  • I have used the latest released firmware or have updated my ESP-AT branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Greetings, I have this issue with ESP-AT on ESP32 model ESP32C3, AT version:3.4.0.0-dev, SDK version:v5.0.6.

We are driving the ESP32C3 by an STM32 via SPI communication which we wrote our own driver for. Things generally work fine and we can download files. There is a problem with .jpg files which are hosted on GitHub though. For example, when downloading this image, the image downloads, decoded with our library and display on our device without problem. The bytes length of the downloaded file as printed in a debug mode matches the bytes length on my PC (61136 bytes).

However, when attempting to download this image, the file size and contents don't match. On PC, the bytes size is 330040 bytes, and when downloaded via AT commands (in the same exact way as the other image) it's 329212 and our jpeg decoder can't decode the file and display it. Also the content-length header on ESP32 tells the byte size on PC (330040) but less bytes are received.

I've attempted to use a hex editor and a few days ago I was able to spot a couple different bytes in the header between the two files, but now I've just tried to recreate it to attach a screenshot to this issue and the headers of the file look exactly the same. I even tried going a couple thousand bytes deep and the files look the same. I compared the end of the file too and it's identical. So it's somewhere in the middle of the image data. I should also add that downloading files larger than the image works just fine and it retains the integrity of the file OK.

We have also tried to add headers Accept-Encoding: identity, Connection: close and Content-Type: image/jpeg - none of which worked. We thought it was a gzip issue and we had to ask the server for a non-gzipped file but this didn't work.

Any ideas as to what could be causing this?

@rsoric
Copy link
Author

rsoric commented Nov 22, 2024

Hi, any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant