OTA update without internet/WiFi network

dmaxben
Posts: 108
Joined: Thu Nov 16, 2017 6:04 pm

OTA update without internet/WiFi network

Postby dmaxben » Wed Jan 30, 2019 1:43 pm

Had a question about doing ESP32 OTA firmware updates without internet access and without an existing WiFi network.

What I would like to do is have the ESP32 setup as a WiFi access point, and then you can connect to it with a laptop or phone and choose/upload a firmware .bin directly from the laptop or phone.

Im using ESP-IDF.

So the ESP32 configured as an access point will have to setup an http server to host a simple web interface with file-upload. Then you can connect directly to the ESP32 WiFi access point, point your browser to 192.168.1.1 (or whatever the ESP32's IP is), and be greeted with a simple html page that has "choose file" and "upload" buttons. Choose the firmware bin file, and click upload.

This way, ESP32's can be updated in the field where there is no existing WiFi network, and no internet access.

I recently moved to ESP-IDF, I originally wrote my large project using Arduino but I have ported it to ESP-IDF...so I would consider myself a beginner at ESP-IDF and 'real' C/cpp.

All of the OTA examples in ESP-IDF seem to be geared towards connecting to an existing WiFi network with internet access.

Im a bit confused at the difference between the "simple_ota_example" and "native_ota_example" in ESP-IDF. The main difference looks like the "simple_ota_example" incorporates security using https??

Eventually Ill just be encrypting/signing the binary files themselves so a secure WiFi connection is not that important. I would just like to get the basics working now, and I can work on the security aspects later.

In simple terms...I need to do a combination of WiFi-soft-access-point code, and http server code with file-upload capability that will accept a firmware bin. Im looking through the file server examples, but they all seem intimidating/overly complex for what Im trying to do...

Any ideas?

thanks

ptueller
Posts: 1
Joined: Thu Jun 27, 2019 6:43 pm

Re: OTA update without internet/WiFi network

Postby ptueller » Thu Jun 27, 2019 6:45 pm

I am looking to do exactly the same thing, did you ever find anything useful or manage to get it working?

rsappia
Posts: 3
Joined: Wed Jul 31, 2019 8:32 pm

Re: OTA update without internet/WiFi network

Postby rsappia » Wed Jul 31, 2019 8:53 pm

Hi there, did you have any succes on this topic? I am also looking for a solution for this...

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

Re: OTA update without internet/WiFi network

Postby ESP_Sprite » Thu Aug 01, 2019 2:41 am

We don't have an example on how to do this directly, but you could cobble together something out of the http server example in esp-idf, which also has a file upload function (esp-idf/examples/protocols/http_server/file_serving) and the OTA functionality.

niket20
Posts: 1
Joined: Thu Aug 01, 2019 10:16 am

Re: OTA update without internet/WiFi network

Postby niket20 » Thu Aug 01, 2019 10:19 am

Really great information

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

Re: OTA update without internet/WiFi network

Postby username » Fri Aug 02, 2019 6:11 pm

This is my first GitHub post, so it is what it is.
This will do what you are asking for, tweak it for your needs as you like.
https://github.com/versamodule/ESP32-OTA-Webserver

jcsbanks
Posts: 305
Joined: Tue Mar 28, 2017 8:03 pm

Re: OTA update without internet/WiFi network

Postby jcsbanks » Sat Aug 03, 2019 2:16 pm

Very nice work username. OTA_update_posthandler() works nicely. Thanks!

PierreHabin
Posts: 1
Joined: Sat Aug 03, 2019 12:21 am

Re: OTA update without internet/WiFi network

Postby PierreHabin » Mon Aug 05, 2019 5:40 pm

Hello,
I need to do the same thing.

I'm sorry but I can't understand how to flash your code the first time into esp32 using esp-idf ( I'm a beginner) . there is no make file for menu config or make flash.

thanks you.

RobinBlood
Posts: 6
Joined: Mon Jan 29, 2018 9:19 am

Re: OTA update without internet/WiFi network

Postby RobinBlood » Thu Nov 07, 2019 11:18 am

This looks quite complicated.
I just used the OTAWebUpdater from the example and changed the WiFi.begin with WiFi.softAP

worked for me ...

Code: Select all

void setup(void) {
  Serial.begin(115200);

  // Connect to WiFi network
  WiFi.softAP(ssid, password);
  Serial.println("");

  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.softAPIP());
  
  

JoeThibodeau
Posts: 9
Joined: Mon Nov 11, 2019 11:34 am

Re: OTA update without internet/WiFi network

Postby JoeThibodeau » Mon Nov 11, 2019 11:55 am

I coded a comprehensive OTA solution for a consumer embedded appliance vendor this year. The serious flaw in your strategy is that anyone can brick your device by updating the firmware. In your design you have accounted for no security. Security is a big deal in professional OTA solutions. If you don't care who hacks your box proceed.

Who is online

Users browsing this forum: No registered users and 67 guests