MQTT

101 views
Skip to first unread message

Lee H-W

unread,
Aug 3, 2016, 7:56:14 AM8/3/16
to weewx-user
i have weewx MQTT working to cloudmqtt.com, but i dont seem to be able to get it to work against my local (on a different pi but on same network) mosquitto installtion

i have been previously using pywws without issue
and mosquitto_pub tests are all working,

suggestions please

mwall

unread,
Aug 3, 2016, 8:12:32 AM8/3/16
to weewx-user

what does the log say?  for even more log information, set debug=2 in weewx.conf then restart weewx.

what is your [MQTT] configuration?

m

Lee H-W

unread,
Aug 3, 2016, 8:22:20 AM8/3/16
to weewx-user
    [[MQTT]]
        server_url=mqtt://uuuuu:ppp...@172.17.2.250:1883
        #server_url=mqtt://uuuuu:pppppp@iotpi:1883
        #server_url = mqtt://uuuuu:ppp...@m21.cloudmqtt.com:18943
        topic = weather
        binding = loop
        retain = true
        unit_system = METRIC


syslog shows
Aug  3 13:19:13 MyPi weewx[9851]: restx: MQTT: data: {'pressure_mbar': '997.7', 'rain_cm': '0.0', 'barometer_mbar': '1009.35437379', 'rainTotal': '12.03', 'ptr': '41216.0', 'windGust_kph': '12.2399999953', 'dayRain_cm': '0.0', 'outTempBatteryStatus': '0.0', 'delay': '1.0', 'inDewpoint': '67.111276156', 'altimeter_mbar': '1009.32269688', 'windchill_C': '21.1', 'outTemp_C': '21.1', 'windGustDir': '180.0', 'status': '0.0', 'rain24_cm': '0.0', 'rxCheckPercent': '100.0', 'hourRain_cm': '0.0', 'inTemp_C': '28.3', 'windSpeed_kph': '3.59999999862', 'usUnits': '16.0', 'rainRate_cm_per_hour': '0.0', 'dateTime': '1470226753.0', 'windDir': '180.0', 'inHumidity': '59.0'}
Aug  3 13:19:13 PiRouter weewx[9851]: restx: MQTT: Published record 2016-08-03 13:19:13 BST (1470226753)

mwall

unread,
Aug 3, 2016, 9:15:28 AM8/3/16
to weewx-user
your config and the log output look ok.

are you asking the broker for the right information?  for example, there is a difference between the topic telemetry/foo/bar and the topic /telemetry/foo/bar

perhaps the topic topology is different between the weewx mqtt and the pywws mqtt?

if you don't use it already, you might want to install christoph schaebel's mqtt websocket client from hivemq:

http://www.hivemq.com/demos/websocket-client/

it is a fantastic tool for diagnosing mqtt broker issues.

m

Lee H-W

unread,
Aug 3, 2016, 10:09:09 AM8/3/16
to weewx-user
sussed it

the mqtt.py is adding /loop on the end of my chosen  topic

so my subscription needed updating

on closer review og the cloudmqtrr console, i can see the topic has loop on it there too

Pat

unread,
Aug 3, 2016, 4:10:46 PM8/3/16
to weewx-user
Don't mean to hijack this thread but I see more and more MQTT with a few platforms I'm working with - but am yet to grasp the concept. 

Can you share a brief overview on how you're using MQTT? Purely for an education point of view. 

Thanks

Lee H-W

unread,
Aug 7, 2016, 12:06:27 PM8/7/16
to weewx-user
i am current using MQTT as a way to get weather data into other projects

by sending the weather data to MQTT my IoT project cab subscribe to the data 

for example have some python running which control some irrigation , this subscribes to and then uses uses recent weather data to decide who much water to deliver 

i also have a node red (internet of things suite) subscribing to weather data and sending out side temp to a display in my living room

but basically any bit of data can be published for other system / code to subscribe to .

i could send the data to cloudmqtt.com and anyone i allow to can subscribe to the data
Reply all
Reply to author
Forward
0 new messages