microsoft / IoT-For-Beginners

12 Weeks, 24 Lessons, IoT for All!
https://microsoft.github.io/IoT-For-Beginners/
MIT License
15.24k stars 2.38k forks source link

Has the mosquitto been swatted? #334

Open pmossel opened 2 years ago

pmossel commented 2 years ago

On two days, 10/17 and 10/19, I was unable to connect to the mosquitto MQTT test broker using WiFi (WIO) or Ethernet (Pi). Internet connection is stable and fast.

[ But: on 10/20/21 it works again. Keep our fingers crossed. ]

Message on 10/17 and 10/19: Attempting MQTT connection...Retying in 5 seconds - failed, rc=-4

Apparently, return code -4 is a timeout trying to connect to the broker. I generated a new GUID but no luck.

This happens with the Raspberry Pi project and the WIO terminal project. The WIO code has better diagnostics when the mqtt broker connection fails than the Pi code.

Any suggestions? Any alternative test platforms? Or should I just plow through and use Azure IoT Hub?

Latest news: on 10/20/21 test.mosquitto.org is responding again! Our teacher said that sometimes the test broker would not work at all. but:

marty-optum commented 2 years ago

I had similar experience on the Wio Terminal. I can not recall the dates specifically, however. One thing I did notice is that on some attempts, the MQTT client would eventually connect to the MQTT server after several attempts and report that it was publishing the json messages with the temperature readings. The MQTT server code, on the other hand, did not seem to connect at all. It would not receive any json messages or write them to the file. Tonight (10/24), however, both the client and server are running just fine. 🤔

The one suggestion I would have to @jimbobbennett is to add error/debug messages to the python temperature-sensor-server code so that there is at least some feedback to the user on the terminal to indicate when something is not working properly with the connection between the temperature-sensor-server and the MQTT server .