Open mdelain opened 4 years ago
It seems this issue happens on MKR WIFI 1010 as well, most specifically if the MQTT server restarts.
My arduinos were all frozen for several days and I had no choice but to restart them. What I do notice as well is that the ".connected()" method seems to slow down the arduino in a random interval as well. The loop checks it every ~2 seconds and sometimes it just hangs for 10-20 seconds before resuming.
I don't believe power supply is an issue there as it seems to do it whether they're on a lab supply or on a solar panel's battery output.
Any new details?
I'm noticing the same issue on an Arduino Portenta H7 using GSM. I'm connecting and disconnecting the MQTTClient before/after each transmission, and after ~24 hours it freezes on MQTT.connect()
.
Hey there,
I'm facing an issue with the
mqttClient.connected()
command on MKR VIDOR 4000: it seems to freeze when the MQTT connection is broken.I've been successfully using this command before on MKR1000, MKR GSM 1400, MKR NB 1500.
I've set up the code below so that you can reproduce. I've simulated a broken MQTT connection by turning my Wi-Fi access point off and on again.
The VIDOR board reconnects to Wi-Fi and then freezes when it comes to MQTT:
On the other boards, the code reconnects instantly to the Wi-Fi and to the broker. This is the output for MKR1000 (just changed the Wi-Fi library to
WiFi101.h
):