New To forum with a OTA question

username
Posts: 477
Joined: Thu May 03, 2018 1:18 pm

New To forum with a OTA question

Postby username » Thu May 03, 2018 1:47 pm

Hello guys! Started playing with ESP32 last week. Just loving it so far. Concerning ESP-IDF OTA, I am a bit puzzled why the OTA demo folder has just one example in it which is to connect to a server to get its .bin file. This does not seem like the most common use case for the average user starting out. I would imagine a IDF example much like Arduino's OTA, or even serve up a web page to then choose a file to download.

I would think that most people would like to take advantage of OTA than USB. I realize that Arduino has OTA, but I am trying to stick with IDF. Or, am i just being a too greedy here to have it already done ;) I just thought this is the one feature that is most common to everyone to use and there would be examples of this littered throughout this forum about it.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: New To forum with a OTA question

Postby kolban » Sat May 05, 2018 4:44 am

My 2 cents ... with my WROVER DevKit I can crank my baud rate up to 2100000. At that rate, I can flash an ESP32 over serial in about 30 seconds for a 1MByte image. Using the serial connection, no matter what state my ESP32 might be in, I can always flash it. If we wish to use OTA on an ESP32, then we always have to have the ability to WiFi connect and send data. Because I'm such a poor programmer, I crash my ESP32 a lot. In that state, I would have to fall back to serial flashing and now I have to juggle two techniques for loading a new image.

For me, the notion of OTA is one of "produtization" and the ability to dynamically load a new image as opposed to a development productivity boon for less latency between the "edit" and "test" steps.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: New To forum with a OTA question

Postby chegewara » Sat May 05, 2018 5:27 am

Because i like to have control over my devices and like to have it on my own server I am in middle of building OTA example that is using mqtt protocol to control esp32. Features:
- android app to control many esp32 boards,
- each esp32 can be pinged, carry software version, remote reseted etc
- each individual esp32 can be triggered to start ota update with new ota file name send thru mqtt
- mqtt broker can be either any public available or on LAN installed
- in addition its possible to build website to control all esp32 with mqtt over websocket (if you like to write some html)

There is a lot services that allows to do the same, but having it on my own server with full control is what i like.

username
Posts: 477
Joined: Thu May 03, 2018 1:18 pm

Re: New To forum with a OTA question

Postby username » Sat May 05, 2018 5:31 am

@kolban, if i can play devils advocate. Even with OTA running, and it crashes you still have serial available. I don't know if this idea is even possible yet as still very new to this platform. Coulden't one use OTA1 as say a boot mode for the getting the Wi-Fi connected, and OTA running. Once that is complete, jump to OTA2 to run your application. You would always use OTA2 for your application, and never mess with OTA1.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: New To forum with a OTA question

Postby kolban » Sun May 06, 2018 4:07 am

Howdy @username,
Absolutely no disagreement with the theory. However in my experience, I go through edit, compile, flash, test cycles in a continuous manner. If things work well then edit, compile flash, test ... can be followed by edit, compile, OTA, test ... however ... since I am inept and crash my ESP32 all the time, then when the ESP32 crashes, I can no longer OTA until I restart it and hope that it doesn't enter the crashed state again. This now means I have to be cognizant of what state the ESP32 is in so that after edit, compile ... I have to check that I am ready for an OTA receive. If I exclusively use serial flash in my workflow ... I have a consistent path to follow with can then be automated. If the cost of performing a serial flash were significantly longer then I would fully agree with the idea of going down the OTA path when ever possible ... but for me ... (and maybe just me) ... having OTA isn't a core need during development. Again ... don't let me rain on the parade ... if that is the path for you and others ... go for it. I don't think there is a wrong answer.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

username
Posts: 477
Joined: Thu May 03, 2018 1:18 pm

Re: New To forum with a OTA question

Postby username » Sun May 06, 2018 4:20 am

@Kolban. I understand you point of view. Still curious as to the "why" there is not more OTA examples is all. IMHO if you are a company that makes a Wi-Fi product you second focus would be to update it OTA.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: New To forum with a OTA question

Postby fly135 » Sun May 06, 2018 3:33 pm

I like using OTA to update my firmware. The board I'm using doesn't automatically connect to download mode, so I have to play the buttons game to flash. If my board crashes immediately because I screwed up then I just run a sh file with a command to erase the OTADATA partition and flash again.

The example program was fine for me. I have a computer running Apache and just put my bin file in it's default www directory, then type OTA at the command prompt provided by the lineconsole component. That calls my ota function.

John A

Who is online

Users browsing this forum: No registered users and 97 guests