microsoft / IoT-For-Beginners

12 Weeks, 24 Lessons, IoT for All!

Home Page:https://microsoft.github.io/IoT-For-Beginners/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Has the mosquitto been swatted?

pmossel opened this issue · comments

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:

  • There should be an alternate mqtt test broker for this course.
  • The code for the Pi should include diagnostics for when the connection fails, just like the WIO code

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 .