MQTT messages not sent #1465
-
I tried setting up MQTT to send usage data to Home Assistant. However, I don't receive anything on Home Assistant and the message queue is always empty.
The connection itself works, I changed the name to test and Mosquito logged the following:
Since nothing is received, no entities are created so no data can be used. Supervisorctl status shows everything running fine since the last update (21 days ago, no idea if it was working before that). After putting debug logging on I see one message with values, however nothing is seen in the logs of Mosquito: (placed in a clickable block due to length).
The error doesn't show up when running in debug (or it takes a log longer, however nothing was received on Mosquito yet). What more info can/should I provide to help troubleshoot this? Both systems are in the same subnet, running on the same ESX host. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Thanks for asking and providing quite some information. It seems that the problem is between the broker and HA. The logs state the following:
The Note that DSMR-reader should sent MQTT messages with the
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I think QoS2 is the only allowed one since the last update. That "Client loop() failed" log only shows up apparently when debug logging isn't on.
It doesn't provide more info than that, however I found 1 line when I grep the last 100k lines that is different: The enabled MQTT statistics are
It does seem to send something, as I even see rejection messages. Or at least it tries. I see nothing on the other end though.
I don't think I can set extra logging on Mosquito so I'm a bit blind on that side, I think it shows every log it receives, at least it used to do that. |
Beta Was this translation helpful? Give feedback.
-
Those errors are (likely) related to network issues:
But I'm not sure, since it maps any non-success result to the error. Even so, if the errors do not persist every second (since there seems to be quite some time between most of them) it's probably not the root cause, just a side error. Regarding the data in the broker, have you tried subscribing to all topics to see whatever is available? E.g. on the host of the broker:
For me (with a single topic tested) it returns:
The message was sent a few seconds before subscribing, but Mosquitto seems to cache it properly due to the Do you see similar output with the command above? |
Beta Was this translation helpful? Give feedback.
-
I'll have to check if I can do that, it's an integration in Home Assistant within its own docker container I think. I'll check it tomorrow to see if I can figure that out. |
Beta Was this translation helpful? Give feedback.
-
You can try any other client though. It's just that the example above seemed the easiest one to do, were you to have easy access to the host where the server is installed. 🙈 It should also work on any other command line where the mosquitto software (and therefore |
Beta Was this translation helpful? Give feedback.
-
I learned some new things today 😳 Anyway:
So messages are coming in apparently. Since the message comes in I guess that means it's a Home Assistant issue? |
Beta Was this translation helpful? Give feedback.
-
Thanks for trying! Regarding the QoS, it's regarding communication between the broker and Unfortunately I cannot help you any further with your main issue. The only suggestion I have left for you to try, is to check the broker server logs for the HA-client. See if it connects properly. Like you checked initially for DSMR-reader in your issue:
Another thing you can try is check the broker config options: https://mosquitto.org/man/mosquitto-conf-5.html Finally don't forget to check the topics the HA-client is listening to. Maybe there are typo's? Does the client connect at all? Try connecting with |
Beta Was this translation helpful? Give feedback.
-
I'm closing the issue, but feel free to ask any follow up questions. Even if I might not have the answer you're looking for. |
Beta Was this translation helpful? Give feedback.
Those errors are (likely) related to network issues:
But I'm not sure, since it maps any non-success result to the error.
Even so, if the errors do not persist every second (since there seems to be quite some time between most of them) it's probably not the root cause, just a side error.
Regarding the data in the broker, have you tried subscribing to all topics to see whatever is available?
E.g. on the host of the broker:
For me (with a single topic tested) it returns: