The Keepalive is usually used in situations where your network has connectivity issues or one party to the MQTT connection remains idle for extended periods of time (for example a topic with a VERY slow update rate). In a correctly functioning and reliable TCP network, the use of Keepalive should not be required. It can also be used in the new implementation of MQTT on the Cerbo to help reduce the overall network traffic (see below for more details).
I’m assuming that when you setup your MQTT explorer connection you did subscribe to a topic?
It’s a step many people forget and hence nothing is returned, you didn’t request anything.
If your MQTT explorer connected and looked like the below, that is normally because there is no subscribed topic specified in the MQTT connection settings:
Now if we edit our basic connection to subscribe to ALL topics, we see everything registered with the Cerbo and for which it is publishing topics. So how do we subscribe to everything? We can use the ‘wildcard’ topic of #. See here for more info: MQTT Topics and Wildcards: A Beginner's Guide | EMQ
Lets take a closer look at what we can do. In your MQTT explorer connection, at the main connections screen, select your connection and then ‘Advanced’:
Then you’ll see something like thing, if you’ve haven’t set default topics before:
Now lets add a ‘Wildcard’ topic using the ‘#’ symbol. In the text line marked ‘Topic’ (the one with the QoS at the end) type in the ‘#’ symbol and click on ‘+ Add’, then youu’ll see it added to your list of subscribed topics, next click on ‘Back’:
We can now connect using our connection details with our wildcard topic, after a short time ALL Cerbo topics will be displayed:
See the topic count increase:
We could have course chosen to subscribe to a specific topic, e.g the system battery SoC:
Then we would see only a single topic:
We can of course subscribe to multiple distinct topics or use the ‘+ Wildcard’ too:
We can of course mix and match too!:
Not a ‘Keepalive’ in sight. KeepAlive isn’t an absolute requirement, by you can discover why you may want to implement it, or not: GitHub - victronenergy/dbus-flashmq: Plugin for FlashMQ that interfaces between DBUS and MQTT.
However you can implement a simple ‘Keepalive’ via a publish to R/brokerID/Keepalive and with a payload of:
{ "keepalive-options" : ["suppress-republish"] }
or just {}