How to do OTA using Remote PIO?

I am using ESP32 with PlatformIO and looking to add OTA feature. Can I upload firmware to ESP32 anywhere in the world. If it is so how to find IP of my ESP32. Is it enough public IP? and how to add authentication for OTA? otherwise anyone who knows public IP can do OTA.

OTA and methods for authentication are explained in the documentation. For the ā€œhow to find the IP of my ESP32ā€ when the ESP32 could be connected in any unknown way to the internet, you need to look into NATs, port forwarding and dynamic-DNS.

1 Like

If you want to do OTA remotely, I it would be better to approach it the other wayā€¦ too many hoops to jump otherwise! Instead of connecting to the ESP32 for an updateā€¦ have it connect to a publicly facing source for your fileā€¦ i.e. a file hosted online that the ESP32 can access via the wifi, and check against to see if it should download an update for it self. i.e. The file might contain the latest version number and URL for that firmware file, and the ESP32 firmware would have itā€™s version number embedded in it to compare, so when the two donā€™t match, it triggers an ESPhttpUpdate.

Make sure you look at the documentation link Max gave above, as Ivan did a presentation and provided demo source code for how to do secure OTA with bintray, with the device only needed internet access to do the update checks and firmware download.

A writeup for how to do a more sophisticated and basically automatic once itā€™s configured ā€˜publicā€™ OTA is this oneā€¦ I tried it out myself a while ago, and really liked it, but it takes some working through, especially if youā€™re new to source version control, OTA, CI, etc. :slight_smile:
https://medium.com/google-cloud/serverless-continuous-integration-and-ota-update-flow-using-google-cloud-build-and-arduino-d5e1cda504bf

1 Like

Thanks guyz @pfeerick @maxgerhardt for replies. Actually my project is based on GSM and Iā€™m using SIM7000 modem with ESP32 Dev module. I need to do FOTA over GSM network. Could you please help?

Sorry, havenā€™t done anything GSM based yet (I have one or two projects in mind), so have no idea how to do stuff in that space. :frowning: