Wireless Code upload to ESP32

blmhemu
Posts: 6
Joined: Sat Jul 01, 2017 11:41 pm

Wireless Code upload to ESP32

Postby blmhemu » Sat Jul 01, 2017 11:44 pm

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.)

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

Re: Wireless Code upload to ESP32

Postby ESP_Sprite » Sun Jul 02, 2017 3:36 am

What you want is OTA (Over The Air) updates; esp-idf has an example for that.

blmhemu
Posts: 6
Joined: Sat Jul 01, 2017 11:41 pm

Re: Wireless Code upload to ESP32

Postby blmhemu » Sun Jul 02, 2017 11:11 am

Can you please explain / suggest a reading material about how it works ?


blmhemu
Posts: 6
Joined: Sat Jul 01, 2017 11:41 pm

Re: Wireless Code upload to ESP32

Postby blmhemu » Sun Jul 02, 2017 11:41 pm

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.)

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

Re: Wireless Code upload to ESP32

Postby ESP_Sprite » Mon Jul 03, 2017 1:10 am

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.

blmhemu
Posts: 6
Joined: Sat Jul 01, 2017 11:41 pm

Re: Wireless Code upload to ESP32

Postby blmhemu » Mon Jul 03, 2017 12:14 pm

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.
Attachments
Screen Shot 2017-07-03 at 5.39.49 PM.png
Screen Shot 2017-07-03 at 5.39.49 PM.png (76.92 KiB) Viewed 11363 times

blmhemu
Posts: 6
Joined: Sat Jul 01, 2017 11:41 pm

Re: Wireless Code upload to ESP32

Postby blmhemu » Mon Jul 03, 2017 12:17 pm

Update :
The screen shot of python terminal is also attached. I think this could be due some problem in python server.
Attachments
Screen Shot 2017-07-03 at 5.45.45 PM.png
Screen Shot 2017-07-03 at 5.45.45 PM.png (101.4 KiB) Viewed 11363 times

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 129 guests