cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

OTA update with ESP32 #75

Open joroMaser opened 2 years ago

joroMaser commented 2 years ago

I will be happy if you can an example to update FW to esp32 OTA via telegram bot Thank you!

cotestatnt commented 2 years ago

Here you can find what you are asking for. The example are written for esp8266 only, but with some small edits (like in others examples) can run also with ESP32

https://github.com/cotestatnt/AsyncTelegram2/tree/master/examples/ESP8266

cotestatnt commented 2 years ago

Ok, now the same examples con compile with both ESP32 and ESP8266 MCUs

https://github.com/cotestatnt/AsyncTelegram2/tree/master/examples/ESP_OTA

joroMaser commented 2 years ago

@cotestatnt thank you so much. I will try and update you ASAP. I saw in your new example that for esp8266 you use WiFiClientSecure while in another example you used BearSSL::WiFiClientSecure client.

cotestatnt commented 2 years ago

It's the same. Since some releases ago, the default client with esp8266 is BearSSL so it's not needed anymore to write explicity.

joroMaser commented 2 years ago

@cotestatnt maybe it's more good to disable /remove "FLASH" button after use used thus button Otherwise it user press few time on this button,error will appear

By the way , lot of time I got File is unavailable. Maybe size limit 20MB was reached or file deleted and when I tried to send firmware.bin again it's work, why?

joroMaser commented 2 years ago

@cotestatnt I think there is an error on OTA with esp32 I send firmware.bin and click FLASH .. . I saw Serial logs and when I saw Updating 491520 of 892912 bytes... that stay there and not continue.

I test it lot of time and it's usually happend (each time on another bytes...) when the firmware sent from telegram web and I click FLASH in telegram web

secmask commented 8 months ago

@cotestatnt I have same issue on update OTA on ESP32, and this fix works on my ESP32 board,

https://github.com/cotestatnt/AsyncTelegram2/pull/131