Added MQTT support

to this version
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

see under setup, advanced/misc

Nice - will this allow WD to read MQTT, or does WD publish data via MQTT?

My Solar system outputs MQTT - would be nice if WD could read that and display power generated etc

at this stage its just outputting it (but that output is echoed back so it can read it too)
I was thinking it could be a way to get the data to the WDliveapp or to a client version of WD

Good idea … these are the MQTT messages my Solar system produces - it’s night time so only power consumed at the moment (674 watts)

Latest MQTT message: /sensor/1ab4d6cd9f2981bfc3a4b40b0e54e47b/gauge, [1554803258,674,“W”]

Brian

I saw the option under Advanced/Misc Settings.

  1. Where do I enter the credentials to connect to a mosquitto server?
  2. Can you also enter a port field for those of us who are running mqtt inside a K8 cluster (i.e. using a non standard port other than 1883).

This is a GREAT addition, because now we can expose the data to a variety of devices/targets (i.e use the ESP8266 to build a standalone weather display) in addition to materializing the data in a timeseries database (i.e. InfluxDB).

Thanks again
Renato

you can set the server address in the setup different to the default test.mosquitto.org
is that what you mean? (or do you mean to enter a username/password credentials)
I will add where you can set the port

Thanks Brian. Currently the page only has a “Server” field. What I am saying is that we should have a total of 4 text boxes:

  1. Server (already there)
  2. port number
  3. Username
  4. Password

Also, does the component you are currently use support QoS? If so, you may also want to add a 5th text box for that and perhaps have it default to “0”. QoS currently only supports these 3 options:

0: The broker/client will deliver the message once, with no confirmation.
1: The broker/client will deliver the message at least once, with confirmation required.
2: The broker/client will deliver the message exactly once by using a four step handshake.

Thanks
Renato

yes, there are last will and testiment settings
I can add that option too

I will do this today and let you know

One last think, are you planning to publish the individual measurements or a single json message with all the measurements?

Thanks
Renato

you can set to send custom data
e.g via custom tags, i.e you can set to send what ever you like
in the setup (you should have seen that)
otherwise the default is it sends the clientraw.txt file contents

No Brian, my question was:

“…otherwise the default is it sends the clientraw.txt file contents”

In this case, are you sending the content of the clientraw.txt as a single message or as a collection of messages, one for each measurement?

Example:

Southampton/WeatherDisplay/clientraw = “12345 1.4 2.6 277 15.8 42 1010.7 0.0 11.4 254.5 0.00 0.00 21.3 47 100.0 0 0.0 0 0 0.0 -54.4 255.0 -65.0 -67.8 -100.0 -100.0 -100 -100 -100 15 29 57 N3KJE-3:29:57_PM 0 100 10 4 0.00 0.00 100 100 100 100 100 15.8 14.5 16.3 4.2 0 Sunny/Dry -0.3 2 2 1 1 0 0 2 1 1 1 0 1 1 2 2 3 3 3 3 3 10.0 2.9 5315.8 4/10/2019 15.3 2.8 16.3 4.2 2.2 3 0 2 0 2 3 0 3 1 2 15.9 15.5 15.4 15.6 15.4 15.4 15.6 15.6 15.7 15.8 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 16.3 4.2 15.8 6.1 0 — — 316 0 0 -100.0 -100.0 22 -100 -100 -100 -100 733.0 22.4 20.0 21.5 1011.0 1006.3 10 2:43_PM 2:43_PM 23.5 3.1 6.9 1.9 4 2019 0.0 -1 -1 -1 290 294 236 263 302 305 304 267 92 277 0.0 255.0 1.6 10.0 40.18528 75.02556 0.0 91 40 0.0 5:49_AM 0.0 0.0 0.0 0.0 0.0 0.0 25.2 2:06_PM 5:49_AM 312 !!C10.37S93!!”

or as

Southampton/WeatherDisplay/ID_code = “12345”
Southampton/WeatherDisplay/Average_windspeed = “1.4”
Southampton/WeatherDisplay/Gust = “2.6”
…
…

Thanks
Renato

the former
would take a lot of message sends to send all that data

any application at the receiving end can digest out the data it needs, yes?
(e.g I was thinking this is a way to get data to a client version of WD or the WDliveapp )

nothing is as easy as it looks huh

have added ability to set port number and the QoS setting

Brian

Thanks for the quick turnaround. Unfortunately I will not be able to test it since my mosquitto uses authentication (username/pass).

Thanks
Renato

I forgot to add that
will do that now
stand by

done that now, download again…

Brian, it works.

3 questions

  1. Here is the message I see:
    bH9IkmPF7Lhvh5kgPLk5NhZ!12345 0.5 0.0 344 8.7 54 1017.1 0.0 11.4 254.5 0.00 0.00 20.9 47 100.0 13 0.0 0 0 0.0 -54.4 255.0 -65.0 -67.8 -100.0 -100.0 -100 -100 -100 22 49 16 N3KJE-10:49:16_PM 0 0 10 4 0.00 0.00 100 100 100 100 100 8.7 6.5 16.3 4.2 13 Night_time/Dry/Cloudy_with_clear_patches_ 1.5 1 1 2 2 2 2 1 1 1 1 1 0 0 0 0 0 0 0 0 0 10.0 -0.1 3625.5 4/10/2019 15.3 2.8 16.3 4.2 0.0 0 1 0 1 0 1 1 0 1 0 9.9 9.8 9.7 9.5 9.4 9.3 9.2 9.0 8.8 8.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 16.3 4.2 8.7 6.0 0 — — 308 0 0 -100.0 -100.0 0 -100 -100 -100 -100 0.0 22.4 20.0 7.4 1017.1 1006.3 7 9:49_PM 2:43_PM 23.5 3.1 6.9 -0.6 2 2019 0.0 -1 1 -1 199 92 67 87 89 73 214 215 252 344 0.0 255.0 0.3 5.2 40.18528 75.02556 0.0 91 38 0.0 5:49_AM 0.0 0.0 0.0 0.0 0.0 0.0 35.1 2:06_PM 5:49_AM 308 !!C10.37S94!!

I noticed that the message starts with a unique identifier and not !12345. Is that by design?

  1. Messages are published every 1 min. If I wanted to publish at the 2.5 sec interval supported by the Davis station, how would I do that?

  2. The windows task manager shows 2 instance of crowndmqtt.exe running at all times. Is this by design? Should it just be one?

Thanks again for adding this great new feature.

Renato

I could make it where you can set the identifier (clientID) (which is followed by a !)

re udpate rate, yes,i could make it where you set the update rate
there should be just the one running…maybe one has got stuck…kill it off?

download a new zip again
where I have added ability to set the clientID and the update rate (seconds)

Brian

Excellent job. Works as advertised.

May I make a suggestion? Perhaps the MQTT page most logical access should be from the “Control Panel” along with the other publications. My 2c.

Thanks again
Renato