OTA update without internet/WiFi network
OTA update without internet/WiFi network
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
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
Re: OTA update without internet/WiFi network
I am looking to do exactly the same thing, did you ever find anything useful or manage to get it working?
Re: OTA update without internet/WiFi network
Hi there, did you have any succes on this topic? I am also looking for a solution for this...
-
- Posts: 9759
- Joined: Thu Nov 26, 2015 4:08 am
Re: OTA update without internet/WiFi network
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.
Re: OTA update without internet/WiFi network
Really great information
Re: OTA update without internet/WiFi network
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
This will do what you are asking for, tweak it for your needs as you like.
https://github.com/versamodule/ESP32-OTA-Webserver
Re: OTA update without internet/WiFi network
Very nice work username. OTA_update_posthandler() works nicely. Thanks!
-
- Posts: 1
- Joined: Sat Aug 03, 2019 12:21 am
Re: OTA update without internet/WiFi network
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.
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.
-
- Posts: 6
- Joined: Mon Jan 29, 2018 9:19 am
Re: OTA update without internet/WiFi network
This looks quite complicated.
I just used the OTAWebUpdater from the example and changed the WiFi.begin with WiFi.softAP
worked for me ...
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());
-
- Posts: 9
- Joined: Mon Nov 11, 2019 11:34 am
Re: OTA update without internet/WiFi network
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: FX2032 and 162 guests