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 connection not working

From Cumulus MX version 3 build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since, and has recently released Cumulus MX version 4. 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
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

MQTT connection not working

Post by packman2008 »

I use MQTT to send data for a few Ecowitt (extra) sensors in the greenhouse into Home Assistant. With the recent drop in temperatures the greenhouse temperature became more useful and that's when I noticed it was no longer displaying. We've not really been interested in this data for months because we've been in and out of the greenhouse regularly so looked at the temp visually - so I don't know when it stopped working.

Things I know:

1) Both CMX (b4043) and HA have been upgraded since I know it last worked so it's not possible to say whether an upgrade broke it and rolling HA versions back would mean loss of data so I don't want to try that.
2) I have debug logging turned on in CMX but that doesn't show much about MQTT. See 3 for the only MQTT related log entries.
3) MQTT on CMX does seem to connect to the HA MQTT broker. If I reboot HA then the CMX log shows an MQTT disconnect/reconnect. So it looks like the CMX login to MQTT works.
4) The CMX MQTT templates haven't been changed, nor has the HA MQTT config.
5) The HA MQTT broker appears to be working. The 'homeassistant' and $SYS topics both have data that changes when viewed using MQTT Explorer from my laptpop. Also I can manually publish a message to a topic on the HA server using MQTT Explorer.
6) I've tried setting up CMX to point at a Mosquitto broker on my laptop and also a test cluster on HiveMQ. Neither showed any significant signs of life, with no traffic arriving from CMX, other than a client connection being set up.
7) The fact that CMX is able to connect to MQTT suggests that there isn't a network issue, although both the CMX and HA boxes are Ethernet connected to the same network switch so I wouldn't have expected network issues. CMX box can ping the HA box.

Beyond that I'm stumped. I'd hoped to see more MQTT logging in CMX. Have I forgotten to turn something on to get more output?

Has anyone got any other suggestions about how to proceed with debugging this?
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
mcrossley
Posts: 14384
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 connection not working

Post by mcrossley »

I'll take a look at both functionality - I have a mosquito server on my mad fit testing - and logging.

Is the main dashboard data updating for those sensors?
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: MQTT connection not working

Post by packman2008 »

Thanks Mark.

Both the sensors I'm trying to send are updating on the console.
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: MQTT connection not working

Post by packman2008 »

I've also reverted the templates to the ones from the download to avoid it being a problem with my own templates.
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
mcrossley
Posts: 14384
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 connection not working

Post by mcrossley »

When MX processes the feeds you should get a debug message like this

Code: Select all

MQTT: Processing {feedType} Topic: {topic. Topic}
When it sends to the MQTT server you should get a Data logging message like this (assuming data logging is enabled)

Code: Select all

MQTT: publishing to topic '{topic}', message '{message}'
What station type(s) are running (main and extra)?

Could you post a shot of the MQTT settings page - just the bottom bit as it is logging in to the server OK.
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: MQTT connection not working

Post by packman2008 »

I know what the problem was. Your prompt to for the screenshot made me look at the filenames again. In CMX they were DataUpdate.txt and Interval.txt but the only files in the ./mqtt directory were DataUpdateTemplate.txt and IntervalTemplate.txt. Creating copies of the templates with the correct names started the data flow.

I don't know what happened to the files I'd created. They're not in any of my v4 backups. The last versions I have are in my final v3 backup so I'm guessing that I forgot to copy them across when I upgraded to v4. That seems a long time ago though so I'm surprised I didn't notice for so long.

Thanks for your help in pointing me in the right direction. I've been digging at this on and off all day!
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
mcrossley
Posts: 14384
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 connection not working

Post by mcrossley »

Glad you got it sorted. The MX backups only copy the data folder and the ini files from the root + plus uniqueid.

The other files could have any name of course - so you'd have to rely on a machine backup. I copy the whole CumuluMX folder once a day to a numbered zip file on my NAS server, and keep the last 20 along with exports of my database and zips web site folders.
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: MQTT connection not working

Post by packman2008 »

I'm not sure why I haven't set up the CMX box to backup to the NAS. They sit about 6 inches apart and are on the same switch so it would be easy enough to do. Another job to add to my long list!
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: MQTT connection not working

Post by HansR »

packman2008 wrote: Wed 20 Nov 2024 10:22 am I'm not sure why I haven't set up the CMX box to backup to the NAS. They sit about 6 inches apart and are on the same switch so it would be easy enough to do. Another job to add to my long list!
See attached my backup procedure from the RPi to my NAS (Synology but I doubt that really matters).
It may save you some time, I assume it is clear.
Note: renamed to txt to upload. The NAS is a network drive on Windows.
You do not have the required permissions to view the files attached to this post.
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
packman2008
Posts: 178
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: MQTT connection not working

Post by packman2008 »

Thanks Hans.

I have CMX running on Windows so I just needed to install the relevant backup agent for my QNAP NAS. I say "just" although it didn't quite prove that simple. The agent needed an extra container running on the NAS and that used the sub-net that my laptop was in, severing all my access to the NAS. I've had to do some emergency sub-netting on my LAN to fix things. The first backup is currently running.
Chris

https://blackpool.weather-watch.com/
CMX 4.3.2b4067 ● CU 7.3.0b6 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: MQTT connection not working

Post by HansR »

packman2008 wrote: Wed 20 Nov 2024 2:59 pm I have CMX running on Windows [...] The first backup is currently running.
Ah OK I should have checked haha...
At least apparently it motivated you to get the backup higher on your list ;)

And as it has been downloaded twice already (pff...) others may have use for it.
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
Post Reply