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

Moderator: igrr

User avatar
By brutzler
#32814 Just merging some very interesting infos from igrr out of gitter.
Is there a clear example somewhere of how to update an arduino sketch that's running on an esp8266 by sending the updated sketch over-the-air?
Is it even currently possible?
The "reference" document at https://github.com/esp8266/Arduino/blob ... ference.md does seem to obliquely refer to it thusly:
|--------------|-------|---------------|--|--|--|--|--|
^ ^ ^ ^ ^
Sketch OTA update File system EEPROM WiFi config (SDK)

@WhiteHare This isn't documented anywhere, but you may find something useful in this issue: esp8266/Arduino#268 (https://github.com/esp8266/Arduino/issues/268)
basically the flow is like this:

flash DNS_SD_Arduino_OTA example sketch

after some time, the board will appear in 'ports' menu

Select 'OTA' instead of 'Serial' in Tools > Upload using

You can now do some sketches and flash the sketch. It should be uploaded over-the-air
You also need python installed and in PATH, because the script which does OTA is currently written in python.

There are also samples bundled with the IDE which show how to do OTA using an HTTP upload. In some contexts this might be more convenient.
User avatar
By rDr4g0n
#32889
brutzler wrote:OK,
this is the sketch on ESP-site.
But I do not understand, which programm I will have to use to send the sketch (guessing it must be the *.bin-file) to the esp?


Here is the example python script to perform an OTA update: https://github.com/esp8266/Arduino/blob ... /espota.py . Between reading this and reading the ino sketches, you could try to port the OTA script to whatever language you prefer.

As for bricking the ESP, if your OTA update fails and the ESP won't restart, you can simply re-flash the ESP using usb/serial.