Page 1 of 1
Wireless Code upload to ESP32
Posted: Sat Jul 01, 2017 11:44 pm
by blmhemu
Hi everyone,
Can someone show me how to wirelessly upload my code to ESP32 which is present remotely far away but connected to internet. (Or atleast when connected to same router as my laptop.)
Re: Wireless Code upload to ESP32
Posted: Sun Jul 02, 2017 3:36 am
by ESP_Sprite
What you want is OTA (Over The Air) updates; esp-idf has an example for that.
Re: Wireless Code upload to ESP32
Posted: Sun Jul 02, 2017 11:11 am
by blmhemu
Can you please explain / suggest a reading material about how it works ?
Re: Wireless Code upload to ESP32
Posted: Sun Jul 02, 2017 11:33 am
by ESP_Sprite
Re: Wireless Code upload to ESP32
Posted: Sun Jul 02, 2017 11:41 pm
by blmhemu
Hey ,
Firstly thank you for the previous replies. I have gone through the links and were very useful. One thing that was not clear is about uploading code wirelessly more than once. Let me explain my problem in more detail - 1. Initially you uploaded the ota code into esp32 via usb.
2. Then it is connected to your wifi and then you uploaded another code (say blink) via wifi.
Now is it possible for me to upload another code(say hello_world) again wirelessly ?
(I got this doubt because the boot loader now automatically boots into ota_0 or ota_1 but not factory app where the actual ota code is present.)
Re: Wireless Code upload to ESP32
Posted: Mon Jul 03, 2017 1:10 am
by ESP_Sprite
The concept actually is that the factory app and ota1/ota2 app are incremental updates of eachother, all with the OTA functionality built-in. That way, you can always use the latest firmware in your ESP32 to OTA to a next version. The idea behind the factory app is that you could modify the bootloader to boot into it when e.g. the user presses a button; that way they have a way to do OTA even if OTA functionality in the later firmware is broken.
Re: Wireless Code upload to ESP32
Posted: Mon Jul 03, 2017 12:14 pm
by blmhemu
Hi ESP_Sprite,
OTA is not working for me. This is what i have done:
1. Made (not flashed) the blink app and created python server.
2. Uploaded the OTA example code (changed the ip, port, app name etc. in menuconfig).
But the LED is not blinking i.e The code blink.bin is not uploaded into the partition(i guess).But it (esp32) has requested for the app as I can see the get request in the terminal. I have attached a screenshot of make monitor.
Thank you.
Re: Wireless Code upload to ESP32
Posted: Mon Jul 03, 2017 12:17 pm
by blmhemu
Update :
The screen shot of python terminal is also attached. I think this could be due some problem in python server.