Another thing I found useful, when I wasn’t sure if my Sonoff devices were connecting successfully, was to use the mosquitto_sub command line tool to subscribe to the top level of the topic tree with the # wildcard - you can then see all the messages coming in. It looks something like this:
My username is hassio-mqtt and xyxyx represents the password, and of course you need to substitute the IP address of your MQTT broker, which is generally your hassio machine. (I was running on another machine so I needed to add it with the -h option).
Depending on your version of the client software, you might also need to specify a client id with -I my_client_name before the broker will accept the connection.
In my case a new message appears about once a minute.
This is my add-on logs. It seems like it works, isn’t it?
1550231642: New connection from my-pi-ip-address on port 1883.
[INFO] found my-user on Home Assistant
1550231644: New client connected from my-pi-ip-address as mosqsub|2023-a0d7b954-s (c1, k60, u'my-user').
You should see something appear in the output of your mosquitto_sub command.
If that works, then the broker is definitely working. If other things are failing to connect and send messages, then it may be an authentication issue, or it may be that you can connect from your local machine but not from elsewhere (e.g. if the devices are on a different subnet, or you have a firewall installed…).
Also, what do you have that’s trying to connect to the broker? Does it give you any output?
For any future visitors, if you are trying to communicate from another computer/client I had to create another user for my client in this case mosquitto_pub