MicroOcpp icon indicating copy to clipboard operation
MicroOcpp copied to clipboard

Firmware Update ESP32 ([MO] info (FirmwareService.cpp:160): Installation timeout or failed! Retry)

Open engahmedaadel opened this issue 1 year ago • 3 comments

Hi Everyone, I have a problem when try to update the firmware, I use evse-test-tool to test the firmware update , any idea where is the problem? I use github to download the .bin file

Here the log data:

[MO] info (FirmwareService.cpp:209): Scheduled FW update! location = https://raw.githubusercontent.com/engahmedaadel/Update/main/main.bin retrieveDate = 2023-12-24T17:04:37.160Z retries = 1, retryInterval = 180 [MO] info (FirmwareService.cpp:60): Start update [MO] info (StatusNotification.cpp:50): New status: Unavailable (connectorId 0) [MO] info (FirmwareService.cpp:137): Installing [112035][E][HTTPUpdate.cpp:234] handleUpdate(): HTTP error: connection lost

[MO] warning (FirmwareService.cpp:343): HTTP_UPDATE_FAILED Error (-5): HTTP error: connection lost

[MO] info (Connection.cpp:65): Disconnected [MO] info (FirmwareService.cpp:160): Installation timeout or failed! Retry

Thanks.

engahmedaadel avatar Dec 24 '23 17:12 engahmedaadel

Hi @engahmedaadel,

The issue here is that the ESP firmware updater doesn't support TLS, it works over HTTP only. Sorry that its limitations are everything but clear. I will either add a meaningful warning statement in future or declare it as example code only.

To try the firmware update procedure with the ESP updater I always ran the Python Simple HTTP server locally (Howto) for hosting the binary. That did the job well.

matth-x avatar Dec 28 '23 10:12 matth-x

Btw. I did a short code review and it seems like HTTPS support could be enabled by just adding two lines.

This is the place in the OCPP lib to change manually:

https://github.com/matth-x/MicroOcpp/blob/735efa29805d33723d80cd351e4ca773b0d96a3e/src/MicroOcpp/Model/FirmwareManagement/FirmwareService.cpp#L334-L336

Here is what to add: https://github.com/espressif/arduino-esp32/blob/f6e12eb7e900fd6484e186b4b681f5b9504d2e85/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino#L95-L96

matth-x avatar Dec 28 '23 10:12 matth-x

Thank you @matth-x for your support, It mean a lot to me. I'll try your solution and give you a feedback

engahmedaadel avatar Dec 28 '23 20:12 engahmedaadel