adafruit / Adafruit_IO_Arduino

Arduino library to access Adafruit IO from WiFi, cellular, and ethernet modules.
Other
210 stars 107 forks source link

integrating basic OTA functionality into AdafruitIO_Wifi #93

Open gitToad opened 5 years ago

gitToad commented 5 years ago

Per brubell suggestion, placeholder for discussion around integrating basic OTA functionality into AdafruitIO_Wifi for ESP32, ESP8266 and friends.

see also https://forums.adafruit.com/viewtopic.php?f=56&t=154328

I have previously worked with somewhat Arduino compatible boards from Particle and really liked the ability to update software over the air (ie without having to be physically tethered to my Arduino IDE computer with a serial cable, but using Wifi instead)

Recently I have been playing with a Huzzah ESP32 feather. Both the adafruit io examples (https://github.com/adafruit/Adafruit_IO ... r/examples) and the JeVe_EasyOTA library (https://github.com/jeroenvermeulen/JeVe_EasyOTA)

Both work excellently. The latter is particularly user friendly as it involves very little client code in my sketches (no html, no http server code etc.) and works directly from the Arduino IDE: instead of selecting a serial port to push code into the boards, just select a network port (the Huzzah/OTA libraries declare themselves to the IDE) Otherwise: zero workflow change. Most excellent !

Now I am wondering how hard it would be to combine the AdafruitIO_Wifi with such a OTA capability. At the moment they both connect to Wifi, so you cant easily combine the existing libraries.

I am aware that "just adding more cruft" to any library doesnt necessarily make it better and increases bulk so there may be reasons NOT to do this. But perhaps a subclass capable of doing OTA in addition to the main AdafruitIO_WiFi class could be the compromise ?

It sure would be useful to update various installed sensor feathers without having to take them down, unpack them, plug them in etc etc.

I also realize a full "industrial strength" OTA capability would require more thought re cybersecurity etc. which may be out of scope for Adafruit as a company promoting "just do it" simplicity and fast learning with its excellent guides and products. I think that would be fine personally, adding a disclaimer you should probably not run critical systems or house door openers etc. with it might be sufficient ?

Anyway, putting in my vote for OTA in or with Adafruit IO for the Wifi feathers :)

slootsky commented 5 years ago

IMO adding OTA to the AdafruitIO libraries is the wrong way to go. I would prefer to see the AdafruitIO libraries do less, and allowing the programmer to do more with the WiFi object/interface, both while making a connection and after a connection is made.

I have a project where I scan for known wifi networks and then want to do AIO operations. This currently requires a bit of fudging, rather than me making the connection and then telling the AIO library to use the (already connected) WiFi conection.