I am using the MQTT library to publish to one of my two test feeds every 20 seconds. I am using a Metro Mini with an AirLift FeatherWing. I am using the MQTT library because the Adafruit IO library does not want work with the AirLift FeatherWing (see other unresolved thread) and Metro or Feather M0 products.

The feed went offline three times over a 24h period and I had to press the Metro Mini's reset button. I received an email alert for the final incident after enabling notifications during the day. I have a signal LED trigger in the code below in case mqtt.connected() fails, but it was not triggered. My WiFi router system log shows no WiFi or ISP interruption. I could not leave my laptop connected to my set-up the whole day to watch the serial output.

What is the best systematic way to troubleshoot this? Ultimately, if I can get this to work, I want to use a Feather M0 RFM69HCW as a packet radio to WiFi bridge to relay remote packet radio node data for tree monitoring to Adafruit IO using the annual subscription.

// Store the error message and set the number of retry attempts int8_t ret; uint8_t retries = 3;

// mqtt.connect will return 0 when connected, so if the connection is // lost, it retries in five-second intervals while ((ret = mqtt.connect()) != 0) { Serial.println(mqtt.connectErrorString(ret)); Serial.println("Retry three times five seconds to connect with MQTT"); mqtt.disconnect(); delay(5000); retries--;