Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By igrr
#33231 Hey Krzysztof, thanks for the awesome writeup! Would you be willing to add it to our github wiki so that it isn't lost within the depths of the forum? We don't have any documentation on the OTA part at the moment so your illustrated guide would certainty help newcomers.

Regarding the bits that need to be added to the sketch, the new way to do this is ArduinoOTA library. It sets up mDNS and UDP stuff, making it much easier to add OTA support to other sketches. ArduinoOTA is available in git right now, and will be part of the next release.
User avatar
By observing
#33252 I have two suggestions/requests for documenting OTA:

1. The code you need to embed for incorporating OTA into your own sketch should be the minimum required as opposed to a complete working example. The code that krzychb listed includes Telnet and serial communication, which I assume isn't needed to incorporate OTA.

2. The sequence of steps that krzychb listed for doing OTA starts with uploading the sketch via serial, then switching to OTA in the IDE and uploading via WiFi. I would like to suggest that this be broken into two sequences. The first sequence are the steps for loading the initial sketch into the IDE and then uploading it to the esp8266 via serial. The second sequence of steps would start with loading the updated sketch into the IDE and then uploading it to the esp8266 via OTA without the esp8266 connected via a serial line. The reason is because in my case, which I assume will be the typical one, I'll be doing OTA because the module is in a place where I can't connect a serial line.