Need ideas on how to Log and inspect changes to mqtt topics

Hi Folks,

I do have a system, that is using a mqtt broker as central state hub (it is an EV Charging station).
The software used in there is quite unique and open source, as well as getting frequent updates.
When I try out a beta version, things sometimes get messed up/unexpected.
While the number of topics used is quite large but the debug log in the EV station is quite small, I thought of ...

  1. a solution to continously record every topic change (maybe keeping the log for a 24-36hrs, not more)

  2. ..and when things get wrong (often only discoverd later throughout the day), try and find/evaluate the state/topic change by some way of inspecting/replaying the log (in a nice UI).

I thought of storing things in an influx DB and then finding a way to present the information in a nice UI, when rolling over/replaying the timeline.
Any Ideas, hints, pointers are very welcome!

happy easter and stay save!


Would it be good enough just to log it to a file? Then you could use a text editor to examine it. This command will generate timestamps with topic and values which may be helpful. You could just redirect this to a file.
mosquitto_sub -t "some/topic/#" -h mqtt_broker_ip -v | perl -pe 'print scalar(localtime()), " ";'

Thank you for your fast response.
I thought about this as well, but I am a visual senses guy and sometimes you want to see events happening in context of the whole system.
Is there a feature available somewhere that would present things in a graph/tree?
The system is build on/comprises of about 270 mqtt topics.
Every data point (based on the time when some topic(s) changed could (re-)render the graph with the changed topics highlighted....maybe even two graphs side-by-side (before & actual time-step examined?)

OK, I am maybe dreaming here :wink:

Perhaps that mqtt explorer can help ?

...I know and use mqtt explorer...wonderful tool...and it offers a tree view, but only a "live mode".
When being connected, you can see topics flash/light up that get updated.
But as everything is happening so fast, navigation between topics and inspecting them is a challenge.
Also there is no "freeze frame" mode....
Hence I am thinking of storing the data in a DB and then navigating along, maybe in a tree view simlilar or enhanced (like displaying the topic value alongside the topic in the tree) to what mqtt explorer does..

The dataflow can be paused, charts can be paused, every topic has a history and you can search. Fantastic tool to analyze your data.

It's worth to watch the features

1 Like

I totally agree, it is a very, very nice tool when the use case is debugging live, including the ability to stop/pause monitoring.
My Use Case is that I want to "debug/analyse" after the fact...sometimes many hours later.
I am not the developer but a (Beta-)User so the basic use case is not testing but using a product, hence the wish to record the events and the ability to "replay"/view them later.

Maybe something like a hierachical map/tree is something that would work.
I see each point in time as a snappshot of the can I visualize it?
Is there for example something in the influx/grafana ecosystem that could do that?
My Google foo just spat this out: looks nice but not open.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.