Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

MQTT Export - Added Build 3071

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

Vossenberg
Posts: 72
Joined: Sun 30 Dec 2012 8:23 am
Weather Station: Davis Vantage Pro2
Operating System: Raspbian Bullseye
Location: Hoef en Haag, Netherlands

MQTT Export - Added Build 3071

Post by Vossenberg »

I currently run CumulusMX on a Raspberry Pi, and I would like it to export my current weather data to an MQTT connection.
Since from this I would like to have HomeAssistant get weather data from my own weatherstation.

Does anybody have information, or already created an MQTT link with CumulusMX? Thank you in advance!
User avatar
mcrossley
Posts: 12689
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 Export

Post by mcrossley »

I don't know if anybody has used it - I seem to recall it being discussed in the past - but it is on my to-do list for a built-in function, I have a version of the Climatica console that uses MQTT.
Vossenberg
Posts: 72
Joined: Sun 30 Dec 2012 8:23 am
Weather Station: Davis Vantage Pro2
Operating System: Raspbian Bullseye
Location: Hoef en Haag, Netherlands

Re: MQTT Export

Post by Vossenberg »

Thanks! Nice to know that it is a feature to be considered.
If you need somebody to test, i''ll be around!
User avatar
mcrossley
Posts: 12689
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 Export

Post by mcrossley »

Vossenberg wrote: Tue 24 Mar 2020 10:11 pm If you need somebody to test, i''ll be around!
Noted.
User avatar
mcrossley
Posts: 12689
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 Export

Post by mcrossley »

PM'd

Also if anybody else is interested in testing an MQTT feature, let me know.
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: MQTT Export - Added Build 3071

Post by Sadgit »

me me me me me me me me

I am using the latest version with mqtt but nothing is being passed to my mqtt server. I am checking using mqtt explorer and my config is this
[MQTT]
Server=192.168.x.x
Port=1883
UseTLS=0
Username=
Password=
EnableDataUpdate=0
UpdateTopic=CumulusMX/DataUpdate
UpdateTemplate=DataUpdateTemplate.txt
EnableInterval=1
IntervalTime=15
IntervalTopic=CumulusMX/Interval
IntervalTemplate=IntervalTemplate.txt


log errors
2020-04-11 10:51:18.036 Error: MQTT disconnected from the server
2020-04-11 10:51:18.040 MQTT Error: failed to connect to the host
2020-04-11 10:51:18.045 The AddressFamily InterNetworkV6 is not valid for the System.Net.IPEndPoint end point, use InterNetwork instead.
Parameter name: socketAddress
2020-04-11 10:51:23.063 Error: MQTT disconnected from the server
2020-04-11 10:51:23.065 MQTT Error: failed to connect to the host
2020-04-11 10:51:23.069 The AddressFamily InterNetworkV6 is not valid for the System.Net.IPEndPoint end point, use InterNetwork instead.
Parameter name: socketAddress
User avatar
mcrossley
Posts: 12689
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 Export - Added Build 3071

Post by mcrossley »

That's odd, those messages would imply it is trying to use IPv6 to make the connection rather than the IPv4 address you have supplied.

Are you using anonymous authentication on your server or have blanked out the user name and password?
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: MQTT Export - Added Build 3071

Post by Sadgit »

yeah I know looks like it is trying ipv6 and I currently have no u/p on my mqtt server for various reasons (at the moment)

trying a different mono version to see if it is that
User avatar
mcrossley
Posts: 12689
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 Export - Added Build 3071

Post by mcrossley »

OK, I've done some digging in the API, you can specify to use IPv4 or IPv6 explicitly. By default it should pick itself.

I think there may be an issue with anonymous access - I tried it against my mosquitto server with null u/p and it fails, but I have a password file specified, to remove that to test I need to restart the service - maybe later....
Vossenberg
Posts: 72
Joined: Sun 30 Dec 2012 8:23 am
Weather Station: Davis Vantage Pro2
Operating System: Raspbian Bullseye
Location: Hoef en Haag, Netherlands

Re: MQTT Export - Added Build 3071

Post by Vossenberg »

Thanks just got to the moment to test it. I can see it sends messages however the messages are empty.
Great development already! Thanks!
User avatar
mcrossley
Posts: 12689
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 Export - Added Build 3071

Post by mcrossley »

Sorry, yes, there are some issues with v3.5.1, they are fixed and awaiting the release of v3.5.2 (soon).
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: MQTT Export - Added Build 3071

Post by kocher »

I am very interested in MQTT, because I use a template (skin Belchertown) in WEEWX that can be updated in 5 minute cycles (reading the data from the Davis console), or in near real time with this MQTT technique:

http://kocher.es/weewx/

https://obrienlabs.net/belchertownweath ... for-weewx/

https://github.com/poblabs/weewx-belchertown

But the truth is that I don't quite understand MQTT, its configuration seems a bit complex to me.
  Could the new MQTT option in cumulusMX be used to send data every xx seconds to weewx?

I have installed the version: Cumulus [MX] 3.5.4 (build: 3075)
Image
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: MQTT Export - Added Build 3071

Post by Sadgit »

MQTT is dead easy to be honest.You configure a topic in CMX and period to send the update, then on the MQTT server side configure it to listen to the topic and payload (configured in the CMX mqtt text files) away you go..

I just skimmed that weewx skin and you will still need to setup a mqtt server. You can setup you own in a docker in seconds. I use
https://github.com/toke/docker-mosquitto

Or there are free online servers, https://www.cloudmqtt.com/ is one.

Basically your broker (server) listens for the topics, you configure the client to send them to the broker, then in this case you would point weewx to the connect to the broker to pull the topics/payload. You could send every 5 seconds, I only ever send 15-30 second updates not to swamp the broker. Saying that (I just checked) I have 40+ iot devices sending various updates to the broker, power usage, on/off, etc and I have zero issues, so if you are just wanting CMX 5 seconds will be fine and dandy

I hope this ramble helps
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: MQTT Export - Added Build 3071

Post by kocher »

Thank you very much for the information. :clap:

I will study it carefully.

Greetings from San Sebastian
Image
mediacj
Posts: 1
Joined: Fri 20 Jan 2017 7:56 pm
Weather Station: Davis Vantage Pro2
Operating System: Ubuntu

Re: MQTT Export - Added Build 3071

Post by mediacj »

I just want to thank you Mark for the MQTT function it works perfect!

Keep up the good work :clap:
Post Reply