Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

MQTT Problems

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
GSV3MiaC
Posts: 28
Joined: Fri 15 Feb 2013 5:24 pm
Weather Station: Davis Vantage Vue.
Operating System: Win 10, rasp Pi, etc.
Location: Shropshire

MQTT Problems

Post by GSV3MiaC »

Had to rebuild my Raspberry Pi, from scratch, and now the Cumulus MX MQTT server does not seem to talk to the (new) mosquitto mqtt install. Everything seems the same, but no data flows. The Cumulus MX mxdiag logs show the following:

2021-08-14 18:44:50.915 InitSerial: Connection confirmed
2021-08-14 18:44:50.916 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:44:54.326 LOOP: 4 - Expected data not received, expected 99 bytes, got 0
2021-08-14 18:44:58.327 LOOP: 5 - Expected data not received, expected 99 bytes, got 0
2021-08-14 18:45:00.229 DoLogFile: Writing log entry for 8/14/2021 6:45:00 PM
2021-08-14 18:45:00.230 DoLogFile: Written log entry for 8/14/2021 6:45:00 PM
2021-08-14 18:45:00.233 Writing today.ini, LastUpdateTime = 8/14/2021 6:45:00 PM raindaystart = 597.2 rain counter = 598.4
2021-08-14 18:45:02.325 LOOP: 6 - Expected data not received, expected 99 bytes, got 0
2021-08-14 18:45:03.327 LOOP: 6 - Timed out waiting for LOOP data
2021-08-14 18:45:03.328 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:03.412 InitSerial: Connecting to the station
2021-08-14 18:45:04.415 InitSerial: Connection confirmed
2021-08-14 18:45:04.415 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:09.623 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:09.663 InitSerial: Connecting to the station
2021-08-14 18:45:10.666 InitSerial: Connection confirmed
2021-08-14 18:45:10.667 InitSerial: Connecting to the station
2021-08-14 18:45:11.676 InitSerial: Connection confirmed
2021-08-14 18:45:11.676 SendLoopCommand: Error sending LOOP command [LPS 2 1]: Specified port is not open.
2021-08-14 18:45:11.677 InitSerial: Connecting to the station
2021-08-14 18:45:12.680 InitSerial: Connection confirmed
2021-08-14 18:45:12.681 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:15.894 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:15.934 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:19.007 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:19.081 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:22.323 LOOP: 4 - Expected data not received, expected 99 bytes, got 0
2021-08-14 18:45:23.325 LOOP: 4 - Timed out waiting for LOOP data
2021-08-14 18:45:23.326 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:23.413 InitSerial: Connecting to the station
2021-08-14 18:45:24.416 InitSerial: Connection confirmed
2021-08-14 18:45:24.416 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:29.617 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:29.659 SendLoopCommand: Starting - LOOP 50
2021-08-14 18:45:31.381 WOW Response: ERROR - Response code = ServiceUnavailable, body = The service is unavailable.
2021-08-14 18:45:32.733 SendLoopCommand: Starting - LPS 2 1
2021-08-14 18:45:32.806 SendLoopCommand: Starting - LOOP 50

But whether any of that related to mqtt issues, and if so how, I do not comprehend. Help much appreciated!! The mqtt output is going to homeassistant, on the same machine, but that isn't seeing anything. mqtt is configured toi send every 30 secs (just for testing) so some should have occurred during that log snippet.

Mosquitto is running, and I see message traffic from other (local) sources, just nothing from CumulusMX.
GSV3MiaC
Posts: 28
Joined: Fri 15 Feb 2013 5:24 pm
Weather Station: Davis Vantage Vue.
Operating System: Win 10, rasp Pi, etc.
Location: Shropshire

Re: MQTT Problems

Post by GSV3MiaC »

Updated to latest version and the log file (mxdiag) now makes more sense but still can't connect to server it at least says so now):

2021-08-14 20:50:28.664 MQTT attempting to reconnect with server
2021-08-14 20:50:28.665 MQTT reconnected OK
2021-08-14 20:50:28.668 Error: MQTT disconnected from the server
2021-08-14 20:50:28.669 MQTT Error: failed to connect to the host
2021-08-14 20:50:28.669 Error while connecting with host '192.168.1.21:1883'.
2021-08-14 20:50:29.527 LOOP: 34 - Data packet is good
2021-08-14 20:50:31.527 LOOP: 35 - Data packet is good
2021-08-14 20:50:33.519 LOOP: 36 - Data packet is good
2021-08-14 20:50:33.669 MQTT attempting to reconnect with server
2021-08-14 20:50:33.670 MQTT reconnected OK
2021-08-14 20:50:33.672 Error: MQTT disconnected from the server
2021-08-14 20:50:33.672 MQTT Error: failed to connect to the host
2021-08-14 20:50:33.672 Error while connecting with host '192.168.1.21:1883'.
2021-08-14 20:50:35.524 LOOP: 37 - Data packet is good
2021-08-14 20:50:37.618 LOOP: 38 - Data packet is good
2021-08-14 20:50:38.673 MQTT attempting to reconnect with server
2021-08-14 20:50:38.674 MQTT reconnected OK
2021-08-14 20:50:38.677 Error: MQTT disconnected from the server
2021-08-14 20:50:38.677 MQTT Error: failed to connect to the host
2021-08-14 20:50:38.678 Error while connecting with host '192.168.1.21:1883'.
2021-08-14 20:50:39.523 LOOP: 39 - Data packet is good
2021-08-14 20:50:41.525 LOOP: 40 - Data packet is good
GSV3MiaC
Posts: 28
Joined: Fri 15 Feb 2013 5:24 pm
Weather Station: Davis Vantage Vue.
Operating System: Win 10, rasp Pi, etc.
Location: Shropshire

Re: MQTT Problems

Post by GSV3MiaC »

OK, the problem is that the latest version of mosquitto (which I got when I rebuilt) defaults to not allowing external connections at all. You need to add
'listener 1883'
and
'allow_anonymous true'

lines to a mosquitto .conf file (as found in /etc/mosquitto/conf.d folder)

Hacing got past that I am now seeing errors in the diag of
MQTTfeed: Error process the template file [mqtt/dave.txt], error = Object reference not set to an instance of an object.

OK, I discover the mqtt templates have changed rather a lot in the new release!!
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: MQTT Problems

Post by mcrossley »

Glad you got it sorted.
GSV3MiaC wrote: Sat 14 Aug 2021 8:20 pm OK, I discover the mqtt templates have changed rather a lot in the new release!!
Yes, you need to reformat the templates for the new release - MQTT is now much more flexible in how it can be configured.
Post Reply