As some may have seen, I’m working on a binding for roborock vacuums. Right now, I’m only supporting cloud connections via the roborock mqtt servers.
Things initially work with status updates and commands both working. After some time, the status updates stop working, whilst mqtt seems to remain connected. (ie publishing commands still works, and running tcpdump on port 8883 generates enough incoming traffic to suggest that messages are still being received, but not being handled (for whatever reason).
I’m interested in seeing any logging from hivemq. I ran ‘openhab-cli console’ and used:
log:set TRACE com.hivemq.client.mqtt
To set the logging for hivemq - but nothing appears in openhab.log and I don’t see the output anywhere else?
Is it indeed possible to generate logging for the dependency libraries?
Double check if logging configuration permits trace logs to reach file. Sometimes appender may be set to ignore levels below certain threshold.
Within karaf/openhab shell you may try doing log:tail to tap it via embedded appender which retains entries only in memory and have no filters.
Great work on the Roborock binding — very cool project!
Regarding your issue with logging the HiveMQ MQTT client, you’re on the right track using:
bash
CopyEdit
log:set TRACE com.hivemq.client.mqtt
However, in many OpenHAB deployments, especially if you’re using the bundled HiveMQ client through the org.openhab.core.io.transport.mqtt module, the logging class might need to be more specific.
Try setting the TRACE log level for the following packages as well:
Also, ensure that the logs aren’t being filtered or redirected. You can verify by checking:
userdata/logs/openhab.log
userdata/logs/events.log
Or by watching live output with log:tail in the console.
If that still doesn’t give results, it could be that HiveMQ uses SLF4J and the logging backend isn’t hooked properly for the client logs. In that case, you might need to explicitly configure log4j2.xml under userdata/etc/ to include those packages with TRACE level.
Let me know if that helps — happy to dig deeper with you!
I think I’ve tried all this to no avail. log4j2.xml has the hivemq entries after configuration by the gui, log:tail in the console doesn’t show anything, and there are no references to hivemq in any logs on /var/log/openhab/*.log
FYI my roborock binding isn’t using org.openhab.core.io.transport.mqtt, it’s using hivemq directly.
I had a better read now on the laptop, was looking on the phone earlier. Given the problems I’m seeing, I’m still surprised there is nothing from hivemq
Thanks Wouter - I enabled org.openhab.core.io.transport.mqtt but still no mqtt logging. I guess I need to try run the binding under a debugger - new territory for me with java apps.