OTA auto-update
Posted:
Tue Sep 22, 2015 2:32 am
by eduperez
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!
Re: OTA auto-update
Posted:
Wed Sep 23, 2015 4:55 pm
by Samighi11
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.
Re: OTA auto-update
Posted:
Wed Sep 23, 2015 9:38 pm
by willfly
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.
Re: OTA auto-update
Posted:
Thu Sep 24, 2015 2:23 am
by eduperez
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.