Keepalive Cerbo-MQTT-Telegraf-Influx-Grafana

Cerbo Gx V3.75,Telegraf V1.39 Influxdb2. Telegraf and Influxdb2 are running on a Raspberry Pi Debian 13 and Grafana is on MacBook, all within wired ethernet LAN.

I have the MQTT writing to Telegraf, which is writing to Influxdb and all data is correct.

I cannot however manage to keep the Cerbo MQTT server open.

I ran a mosquitto_pub message to the Cerbo with a message “” (empty) and put this in a crontab which repeats every 45 seconds. The job is running correctly but the Cerbo MQTT closes after 1 minute. - mosquitto_pub -h 192.168.8.xxx-t ‘R/c0619abxxxxx/keepalive’ -n

I tried the NodeRed Inject - MQTT out as suggested in the post - Local MQTT connection times out

From this Github GitHub - victronenergy/dbus-flashmq: Plugin for FlashMQ that interfaces between DBUS and MQTT. · GitHub , which details a keepalive in the document.

I ran the script in the terminal - ( first=“”; while true; do if [[ -n “$first” ]]; then echo ‘{ “keepalive-options” : [“suppress-republish”] }’; else echo “”; fi ; first=true; sleep 30; done ) | mosquitto_pub -t ‘R/c0619abxxxxx/keepalive’ -l -h ‘192.168.8.xxx’ But the terminal froze.

I am only just beginning in my computer knowledge, is anyone able to help me with a keepalive as above and if so what I did wrong when running the terminal script.

Dear MCKillop,

read Keepalive via NodeRed to Venus - VictronEnergy

Some answer is from marc-hd with a complete howto in node red.

Have fun

Marc

I had a similar issue. Here is an example of a Node-RED keep-alive flow.

Yes, that is the post that I used to set up the node red. The only difference is that I set it with unsecured, hence port 1883. But it didn’t work.

Does MQTT out node show connected ? Are you sure about that port, mosquitto_sub can connect into?

The Node is showing as connected. I use port 1883 for the Telegraf.conf and data is being transferred when the Cerbo is triggered by viewing the Webgui in a browser. I have attached 2 of the screen shots from the Node Red browser.

Cerbo Node Red 2.pdf (157.5 KB)

Cerbo Node Red 1.pdf (207.5 KB)

Isn’t the MQTT topic case sensitive? Try using an uppercase ‘R’.

Thank you, that now works. Both Cerbos now being recorded in Influxdb. I will try and get the Debian crontab working so I can take the Cerbos off OS Large and Node Red.