Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Automatically reconnect to AIO after network or power outage
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Automatically reconnect to AIO after network or power outage

by Systembolaget on Fri Jul 10, 2020 1:53 am

In the MQTT and AIO tutorial codes, connecting to the WiFi router and ISP (actually two pairs of shoes) are handled in setup(), but often users would want to automatically have their connection re-established when the WiFi router or the ESP32 board used suffer a network or power outage.

I made a fairly detailed tutorial with two different methods that automatically reconnect (two functions from loop or a state machine), using Adafruit's WiFiNINA library fork, that also show how to publish several data-types in a struct and how to issue tweets and other notifications via IFTTT. There is a GitHub repo https://github.com/systembolaget/Physic ... -and-IFTTT with exhaustive code comments and video https://youtu.be/MPAtrs_MFf0 you may like to put a link to in the MQTT and AIO tutorials for other people's benefit. There seem to be quite a few that struggle with automatic reconnection and last year's Euclidean distance colour finder method viewtopic.php?f=19&t=154501&hilit=+colour#p766814 seems to go down well, too.

Systembolaget
 
Posts: 252
Joined: Wed Mar 08, 2017 1:01 pm

Please be positive and constructive with your questions and comments.