migrating Arduino OTA to ESP-IDF

Posts: 40
Joined: Thu Nov 16, 2017 6:04 pm

migrating Arduino OTA to ESP-IDF

Postby dmaxben » Tue Jul 09, 2019 5:36 pm

Hi, ive been working on porting a large Arduino ESP32 project over to ESP-IDF. Im a newbie to the ESP-IDF, but would like to learn so I can transition away from depending so heavily on the Arduino "training wheels", and get better at "real" C/CPP programming.

Probably a stupid question, but Ive been messing with it/reading/trying to teach myself for 20+ hours and havent gotten anywhere.

Im having some trouble getting the OTA working. The OTA stuff works fine in the Arduino program; I have a custom server setup using Django to serve the firmware bin, as well as automatically tracking each device's serial number etc.

The Arduino "httpUpdate" and Arduino WiFi-Manager libraries I was previously using dont seem to work correctly in ESP-IDF.

https://github.com/espressif/arduino-es ... HTTPUpdate

Which is fine, because I would like to migrate to this much better "non-arduino" WiFi Manager anyways:



The main question is, which actual OTA code bits should I be using?

There are three OTA examples in the ESP-IDF github, and I cant really figure out what the differences are between them.

https://github.com/espressif/esp-idf/tr ... system/ota

"advanced OTA", "simple OTA", "native OTA".

Which one would you guys recommend for my application? IE, which is the proper one that would "directly replace"/function like the Arduino "httpUpdate" library?


Second question is, in integrating the "tonyP" WiFiManager stuff into my "arduino converted" ESP-IDF program, Im getting a ton of redeclaration errors.

Im suspecting that I dont have my directory structure setup correctly...or Im missing some files that tell the ESP-IDF compiler where to look. Or that there are simply some things in the Arduino "component" that are conflicting with the ESP-IDF libraries.

Does everything in here: https://github.com/tonyp7/esp32-wifi-ma ... nager/main
go into the "components" folder...?


Who is online

Users browsing this forum: No registered users and 20 guests