Example Firmware_Update_Attachment #311
-
Hello everyone. I wanted to create a mechanism for firmware updates through email. The reason is that I don't want to keep a server constantly running for updates, and I prefer a semi-offline mechanism. The idea is that when I upload the firmware, the device, when turned on, will check the email for attachments and update itself. I decided to use this library.Conveniently, there's an example available at https://github.com/mobizt/ESP-Mail-Client/tree/master/examples/IMAP/Firmware_Update_Attachment. However, I encountered an issue, and the example didn't work for me. I'm getting the following message:
I want to mention that the same firmware uploads correctly through the regular server-based update process, so the issue doesn't seem to be with the file or the firmware process. Here's what I noticed in the ESP_Mail_IMAP.h file from the library: the result of a successful update is if: BUT! attach_data_size accumulates cumulatively, which ideally should not happen, and octetCount never reaches octetLength, probably because of a miscount in the beginning:
where printf("Downloaded: %u\n", cPart(imap)->firmware_downloaded_byte); in parseAttachmentResponse before if (!imap->_isFirmwareUpdated && update_result_ok && My question is: Has anyone tried using this library for firmware updates, and if so, what adjustments were needed? If not, has anyone attempted to implement a similar mechanism? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
The library was tested in this firmware attachment update feature on ESP32, ESP8266 and Raspberry Pi Pico W under different IMAP servers and it works fine for all tests. I think it depends on how you send the message as there are missing an important header field or improperly encoded in the SMTP message you sent to SMTP mail server based on the email client you used. |
Beta Was this translation helpful? Give feedback.
-
You can test with a blank firmware attachment and post your message source from your email client app here for validation. |
Beta Was this translation helpful? Give feedback.
-
You can't conclude this based on your understanding as it is not right.
|
Beta Was this translation helpful? Give feedback.
-
In your case, I think the Then the Then the ESP-Mail-Client/src/ESP_Mail_IMAP.h Lines 4086 to 4090 in 008b4f1 This causes the condition from Now I wonder why this condition Can you download the firmware file as normal attachment to SD storage and compare the size and its content with original bin file? |
Beta Was this translation helpful? Give feedback.
You can test with a blank firmware attachment and post your message source from your email client app here for validation.