Why no MQTT transport for developers?

David (@dsj),

For accessing data, there is:

REST API.
Websocket for structured remote data.
UDP for structured local data.

Why is there no MQTT transport available to developers?

5 Likes

why would you need that?

Because it’s there:

{“summary”:{“precip_total_1h”:0.0,“precip_total_24h”:0.0,“precip_high_24h”:0.0},“serial_number”:“SK-00007032”,“hub_sn”:“HB-00004516”,“type”:“obs_sky”,“source”:“mqtt”,“obs”:[[1521052731,null,3.0,0.0,0.18,1.03,2.01,146,3.23,1,579,0.0,null,null]],“device_id”:5590,“firmware_revision”:26}
{“summary”:{“pressure_trend”:“falling”,“pressure_high_24h”:827.6,“pressure_low_24h”:819.7,“strike_count_3h”:0,“strike_last_dist”:12,“strike_last_epoch”:1517345926},“serial_number”:“AR-00005119”,“hub_sn”:“HB-00004516”,“type”:“obs_air”,“source”:“mqtt”,“obs”:[[1521052751,819.7,16.9,26,0,0,2.95,1]],“device_id”:3337,“firmware_revision”:20}

I am also interested in mqtt. All my smart devices now use mqtt and I control everything from Node Red

2 Likes

Right now MQTT is only used for comms between the Hub and our servers. We may consider adding a public MQTT broker in the future, but there is no real benefit over the other interfaces.

2 Likes

I agree with the no real benefit over the others. There are some devices that only communicate over MQTT.

Yes, convenience & flexibility would be the only reasons to add it (and those are pretty good reasons). It’s on the roadmap!

6 Likes

Have not got my station yet, but am starting to get the API software ready for when I do… Joined up just to add to this thread.
@dsj Please reconsider adding MQTT to our options. I am all set to go with brokers and clients to subscribe to my weather data. Most of my home automaton, sensors and smart devices use MQTT.
Having the station as a master topic and then each senor / data point as a sub topic would be just fantastic. Any device can then subscribe to just the data points it requires.
The programming requirements to get started in MQTT vs the other methods is much lower, yet just as powerful.

I’m pushing mine to MQTT now - have a python script listening to the UDP packets, then publishing to my MQTT broker so that my Home Assistant install can then display the values. Sure would be nice to eliminate the UDP scanner and just have them go straight to the broker!

Having done both, I can tell you that programming UDP is much simpler than MQTT.

I have not received my order yet, but I 'll start developing a udp -> mqtt client with a ($2) esp8266. I have some spare here and it won’t take long to write the firmware.
I wish I could directly access the weatherflow mqtt broker but for the moment, a custom application is the only way to use my node-red to send data to several sites (as I already do for a number of weather stations).

Having a esp8266 do that would be pretty cool! Could the esp8266 do more than just the one tasks?

I’m also waiting for mine, but I’ve created some code that converts data from my existing weather station to WeatherFlow UDP format so I can create programs that make use of it. One of those is a program that runs on a RPi and pushes the data to a MQTT broker (and to a MYSQL database, and services like WUnderground/CWOP). I’m curious if the esp8266 can handle something more complex like that, I don’t really know anything about them.

Of course esp8266 can handle difficult and many tasks. I already use 2 of them as weather stations
One is a fully functional diy weather station and the other gets serial data from a Gill Instruments ultrasonic anemometeter and sends them to an mqtt broker. I have some other esp8266 for different iot tasks.

I think what he wants to know is, can an ESP run more than one program concurrently and does it run code in non-blocking mode.

Esp8266 is a single core cpu and can not run more than one program at the same time. ESP32 has a dual core cpu and possibly can, but I have no experience with it (yet).
Both can run code in non-blocking mode if you know how to do it.

1 Like

Sounds like a fun little device to work with. Keep us posted on the status of your udp -> mqtt development.

Note to self… add UDP->MQTT conversion to Wx Console.

1 Like

Hi folks. Just wanted to pop in here and let you know that we’re listening and considering how best to incorporate an MQTT feature into our developer tools. Stay tuned…

8 Likes

That would be great news !

1 Like

As a side note to the mqtt request - I use it for a lot of my data visualisations - weewx has a great mqtt extension that takes in all my wf data and exports out to separate mqtt topics.

It’s well worth a look,

Andy

1 Like