espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
433 stars 146 forks source link

OTA via dashboard and arduino IDE (MEGH-3772) #161

Open Michiel-FMI-ImProvia opened 1 year ago

Michiel-FMI-ImProvia commented 1 year ago

Is it possible to do the OTA updates via the https://dashboard.insights.espressif.com when using the Arduino IDE? up until now I get an Error when using RMaker.enableOTA(OTA_USING_TOPICS); and the ESP reboots

JohnMacrae commented 1 year ago

I raised it in 2021 here( https://github.com/espressif/arduino-esp32/issues/5420) It has been studiously ignored despite prodding. Problem is that Arduino version is precompiled so we're pretty powerless to help

Michiel-FMI-ImProvia commented 1 year ago

Yeah, I saw your item. It would be amazing if it was possible to upload via the dashboard and all the devices get the new firmware. Another option is to try it via the ESP-IDF but then I need time to learn how this works. It's just that there is some OTA code in the arduino examples, and it bugs me that it seems to have no functionality.

shahpiyushv commented 1 year ago

Low heap memory seems to be the root cause for this. Since Arduino has pre compiled libraries which are common across all esp32 specific modules, there are quite some things pulled in even when not used actively. Getting to a stage wherein the RAM usage will be reduced, but without affecting any other functionality/examples of Arduino will take some time.

JohnMacrae commented 1 year ago

It works fine in idf.

On Mon, 22 Aug 2022, 12:27 Michiel-FMI-ImProvia, @.***> wrote:

Yeah, I saw your item. It would be amazing if it was possible to upload via the dashboard and all the devices get the new firmware. Another option is to try it via the ESP-IDF but then I need time to learn how this works. It's just that there is some OTA code in the arduino examples, and it bugs me that it seems to have no functionality.

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-rainmaker/issues/161#issuecomment-1222221512, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHTIDKHYTUSZ5ERJKDUDRTV2NPZ7ANCNFSM57GY2TAA . You are receiving this because you commented.Message ID: @.***>

Michiel-FMI-ImProvia commented 1 year ago

Low heap memory seems to be the root cause for this. Since Arduino has pre compiled libraries which are common across all esp32 specific modules, there are quite some things pulled in even when not used actively. Getting to a stage wherein the RAM usage will be reduced, but without affecting any other functionality/examples will take some time.

I can imagine that this is not a simple problem. Maybe mention this in the Arduino examples to not get people's hopes up. In short if I want to use Rainmaker OTA it's smarter to learn the ESP-IDF language.

JohnMacrae commented 1 year ago

There is a workaround @Michiel-FMI-ImProvia . Use Arduino OTA https://youtu.be/V-g45CFSFr4

Michiel-FMI-ImProvia commented 1 year ago

Oh I am so exited!! Will watch that video with intense attention!!!

JohnMacrae commented 1 year ago

I hope this will give some impetus to the Espressif team. If the Arduino OTA works the surely it's not a heap collision?

On Mon, 22 Aug 2022, 12:27 Michiel-FMI-ImProvia, @.***> wrote:

Yeah, I saw your item. It would be amazing if it was possible to upload via the dashboard and all the devices get the new firmware. Another option is to try it via the ESP-IDF but then I need time to learn how this works. It's just that there is some OTA code in the arduino examples, and it bugs me that it seems to have no functionality.

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-rainmaker/issues/161#issuecomment-1222221512, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHTIDKHYTUSZ5ERJKDUDRTV2NPZ7ANCNFSM57GY2TAA . You are receiving this because you commented.Message ID: @.***>

me-chiel commented 1 year ago

exactly....

sanketwadekar commented 1 year ago

Hi @JohnMacrae, We are aware of this crash and are working on the fixes. We will fix this issue in the upcoming release of ESP32 Arduino. Regards, Sanket

Michiel-FMI-ImProvia commented 1 year ago

Hi @JohnMacrae, We are aware of this crash and are working on the fixes. We will fix this issue in the upcoming release of ESP32 Arduino. Regards, Sanket

any idea when this release will happen? This functionality sounds so amazing.

JohnMacrae commented 1 year ago

Thank you!

On Fri, 9 Sept 2022, 05:33 Sanket Wadekar, @.***> wrote:

Hi @JohnMacrae https://github.com/JohnMacrae, We are aware of this crash and are working on the fixes. We will fix this issue in the upcoming release of ESP32 Arduino. Regards, Sanket

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-rainmaker/issues/161#issuecomment-1241488129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHTIDJCQM2WSCWPH2KW67LV5K42ZANCNFSM57GY2TAA . You are receiving this because you were mentioned.Message ID: @.***>

sanketwadekar commented 1 year ago

Hello, Arduino 2.0.6 has been released, which fixes the OTA crash issues seen previously. If you face low memory errors like esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00, please reboot your device once. Doing a reboot after successful provisioning and then starting OTA is recommended. Thanks!