mqtt extension TLS required ?

142 views
Skip to first unread message

vince

unread,
Jan 23, 2018, 7:42:03 PM1/23/18
to weewx-user
In looking at the MQTT extension at https://github.com/weewx/weewx/wiki/mqtt the code is a little unclear to me.  Is TLS required for uploading weewx data to a MQTT broker ?   At line 214 in the mqtt.py it "seems" like it's optional (????)


Also, is there a clean way of dumping out a what it posts to the broker in some pretty(ish) human-friendly format ?   

Andreas Landixus

unread,
Jan 24, 2018, 2:03:35 AM1/24/18
to weewx-user
TLS is only required if you use client user/pass authentication.

MQTT post on a topic for example  "weather" is the topic "tempOut 12.02" is the output 
MQTT is not for human friendly output :) more for exchange data. 

vince

unread,
Jan 24, 2018, 10:27:36 AM1/24/18
to weewx-user
On Tuesday, January 23, 2018 at 4:42:03 PM UTC-8, vince wrote:
In looking at the MQTT extension at https://github.com/weewx/weewx/wiki/mqtt the code is a little unclear to me.  Is TLS required for uploading weewx data to a MQTT broker ?   At line 214 in the mqtt.py it "seems" like it's optional (????)


update - no it's not required (and it works great)
 

Also, is there a clean way of dumping out a what it posts to the broker in some pretty(ish) human-friendly format ?   

update - yes - use mosquitto_sub to subscribe and add the -v option


 

mwall

unread,
Jan 24, 2018, 10:40:19 AM1/24/18
to weewx-user
for all of you mqtt-philes out there who struggle to figure out what is actually being sent...  what topic does sensor x use?  is it json data or just plain text?  is retain turned on?  when was the last data from sensor x?

try the mqtt websocket client from christoph schaebel and hivemq:


details are here:


and the source is here:


it requires that you add websocket support when you build your mosquitto broker, but the result is well worth it.  you can install the websocket client on the server where the broker runs, or just keep a websocket client on your laptop or development machine then point it at whatever broker you are trying to diagnose.

thank you christoph and hivemq for making this available under the apache license!

m

mwall

unread,
Jan 24, 2018, 10:42:44 AM1/24/18
to weewx-user
btw, once you enable websockets on your mqtt broker, you can create truly live web pages
Reply all
Reply to author
Forward
0 new messages