Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By eduperez
#29633 Can an Arduino-based ESP device auto-update itself over-the-air? My ideal scenario would be as follows:

* A ESP device connects to a server (HTTP, TFTP, ...?), and checks for a new version of the firmware.
* If a new version is found, the ESP device downloads the new firmware, installs it, and reboots.

Can this be done? Is there any sample code for the download + update process available (I can figure out the rest myself)? The binary file containing the new firmware, how must be created (using the Arduino IDE, if possible)?

Many thanks!
User avatar
By Samighi11
#29732
eduperez wrote:Can an Arduino-based ESP device auto-update itself over-the-air? My ideal scenario would be as follows:

* A ESP device connects to a server (HTTP, TFTP, ...?), and checks for a new version of the firmware.
* If a new version is found, the ESP device downloads the new firmware, installs it, and reboots.

Can this be done? Is there any sample code for the download + update process available (I can figure out the rest myself)? The binary file containing the new firmware, how must be created (using the Arduino IDE, if possible)?

Many thanks!


I would love to get this to work. First, we must get OTA to work itself. The trick is simple. Once you have OTA done, and you have a Bin file for the new version, it has to be hosted on a web server you own. Have the web server call back the device and execute CURL -F=binfile (I think).

if you can get OTA to work (I have not been able to), I can demonstrate the second half. At least we can try.
User avatar
By willfly
#29739
eduperez wrote:Can an Arduino-based ESP device auto-update itself over-the-air? My ideal scenario would be as follows:

* A ESP device connects to a server (HTTP, TFTP, ...?), and checks for a new version of the firmware.
* If a new version is found, the ESP device downloads the new firmware, installs it, and reboots.

Can this be done? Is there any sample code for the download + update process available (I can figure out the rest myself)? The binary file containing the new firmware, how must be created (using the Arduino IDE, if possible)?

Many thanks!


Yes, it can be done. The OTA example bundled with IDE works and you can take that as a starting point. You will need to provide a webserver which hosts new firmware - either local network or on internet. The firmware is Arduinio IDE compiled bin file. The new firmware should maintain the ability to download and upgrade firmware, if you want it to work more then once. Your ESP-xx module should have twice firmware size flash memory, which just leaves ESP-12x as OTA up-gradable module.
User avatar
By eduperez
#29758 Many thanks for your answers!

I was under the impression that OTA was only possible if triggered / controlled from the IDE, I'm glad to know the device can do it all by itself. I have no problems providing a web server, if that is all that is needed.

Will try this as soon as my ESP-12 arrives and report back.