MQTT working but Belchertown skin 'Failed connecting to weather station'

241 views
Skip to first unread message

Matt

unread,
Oct 25, 2019, 2:57:45 PM10/25/19
to weewx-user
Hi,

I followed the instructions in https://github.com/poblabs/weewx-belchertown to install an MQTT broker and subscribe to the weather data.  It's working according to the logs...

Weewx syslog

Oct 25 19:49:13 weatherpi weewx[3082]: restx: MQTT: Published record 2019-10-25 19:49:13 BST (1572029353)
Oct 25 19:49:29 weatherpi weewx[3082]: restx: MQTT: Published record 2019-10-25 19:49:29 BST (1572029369)
Oct 25 19:49:44 weatherpi weewx[3082]: restx: MQTT: Published record 2019-10-25 19:49:44 BST (1572029384)
Oct 25 19:50:01 weatherpi weewx[3082]: restx: MQTT: Published record 2019-10-25 19:50:00 BST (1572029400)
Oct 25 19:50:17 weatherpi weewx[3082]: restx: MQTT: Published record 2019-10-25 19:50:16 BST (1572029416)

Mosquitto log

1572029465: New connection from ::1 on port 1883.
1572029465: New client connected from ::1 as weewx_7f9ef501 (c1, k60, u'pi').
1572029465: Client weewx_7f9ef501 disconnected.
1572029481: New connection from ::1 on port 1883.
1572029481: New client connected from ::1 as weewx_65035d79 (c1, k60, u'pi').
1572029481: Client weewx_65035d79 disconnected.
1572029497: New connection from ::1 on port 1883.
1572029497: New client connected from ::1 as weewx_29b0c150 (c1, k60, u'pi').
1572029497: Client weewx_29b0c150 disconnected.
1572029513: New connection from ::1 on port 1883.

weewx.conf

    [[MQTT]]
        server_url = mqtt://pi:xxxxxxx@localhost:1883
        topic = weather
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate
        log_failure = true
        log_success = true

skin.conf

    # MQTT Websockets defaults
    mqtt_websockets_enabled = 1
    mqtt_websockets_host = localhost
    mqtt_websockets_port = 1883
    mqtt_websockets_ssl = 0
    mqtt_websockets_topic = weather
    disconnect_live_website_visitor = 1800000

But the webpage constantly says...

Untitled.png


I've been over and over the config, re-writing, adding quotes, you name it I've tried it but still no success.  Can any bright spark see something obvious that's wrong...please!!

Many thanks,

Matt

Matt

unread,
Oct 25, 2019, 3:57:10 PM10/25/19
to weewx-user
I noticed a typo myself...now changed the websockets port and put the host and topic in quotes, but still not connecting...

    # MQTT Websockets defaults
   mqtt_websockets_enabled = 1
   mqtt_websockets_host = "localhost"
   mqtt_websockets_port = 9001
   mqtt_websockets_ssl = 0
   mqtt_websockets_topic = "weather"
   disconnect_live_website_visitor = 1800000

Pat

unread,
Oct 25, 2019, 9:07:46 PM10/25/19
to weewx-user
Your host needs to be the IP of your broker. Not localhost. 

Matt

unread,
Oct 26, 2019, 3:10:03 AM10/26/19
to weewx...@googlegroups.com
Thank you, that's progress. Now it says 'Connected. Waiting for data' but doesn't change. Again, the logs look ok (to a novice).

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/ykgQYOFGH8I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b0004563-6cdb-480a-a8e4-64e86f65784e%40googlegroups.com.

Pat

unread,
Oct 26, 2019, 7:22:41 AM10/26/19
to weewx-user
Try changing mqtt_websockets_topic to weather/loop

Matt

unread,
Oct 26, 2019, 8:36:24 AM10/26/19
to weewx-user
Superb! That worked. Thank you very much.  I am in the UK and use degrees Celcius and Miles per hour.  What should I set unit_system to (METRIC gives me celcius but kmh, US gives me fahrenheit and miles per hour)?

On Saturday, 26 October 2019 12:22:41 UTC+1, Pat wrote:
Try changing mqtt_websockets_topic to weather/loop

Pat

unread,
Oct 26, 2019, 8:38:22 AM10/26/19
to weewx-user
A lot of these items are covered in the documentation. Check out this section

Pat

unread,
Oct 26, 2019, 8:44:27 AM10/26/19
to weewx-user
Ah, sorry, my mistake. I mis-read your question. 

You'll want to configure the MQTT extension to send the units you want. So you'd want something like shown in this question.

[[MQTT]]
        ... your other mqtt config options here ...
        [[[inputs]]]
                [[[[windSpeed]]]]
                        name = windSpeed_mph
                        units = mile_per_hour

The mqtt extension documentation has more info too.

Matt

unread,
Oct 26, 2019, 8:45:18 AM10/26/19
to weewx-user
Yes, I realise that, but my weewx.conf is the same as the section you highlight but I'm still not seeing celcius and mph...

This is my current weewx.conf

    [[Defaults]]
       
       [[[Units]]]
           
           # The following section sets what unit to use for each unit group.
           # NB: The unit is always in the singular. I.e., 'mile_per_hour',
           # NOT 'miles_per_hour'
           [[[[Groups]]]]
               
               group_altitude = foot    # Options are 'foot' or 'meter'
               group_degree_day = degree_C_day    # Options are 'degree_F_day' or 'degree_C_day'
               group_pressure = mbar    # Options are 'inHg', 'mmHg', 'mbar', or 'hPa'
               group_rain = mm    # Options are 'inch', 'cm', or 'mm'
               group_rainrate = mm_per_hour    # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
               group_speed = mile_per_hour    # Options are 'mile_per_hour', 'km_per_hour', 'knot', or 'meter_per_second'
               group_speed2 = mile_per_hour2    # Options are 'mile_per_hour2', 'km_per_hour2', 'knot2', or 'meter_per_second2'
               group_temperature = degree_C    # Options are 'degree_F' or 'degree_C'


Pat

unread,
Oct 26, 2019, 8:49:37 AM10/26/19
to weewx-user
Check my previous email. You need to tell mqtt extension what you're looking for. The skin gets its values from mqtt. 

Matt

unread,
Oct 26, 2019, 10:46:48 AM10/26/19
to weewx-user
Thank you very much for your help.  I've got it working now...the config I had to add is...

        [[[inputs]]]
               [[[[windSpeed]]]]
                       name = windSpeed_mph
                       units = mile_per_hour
               [[[[windGust]]]]
                       name = windGust_mph
                       units = mile_per_hour

Matt

unread,
Oct 26, 2019, 10:47:04 AM10/26/19
to weewx-user
Thank you very much for your help.  I've got it working now...the config I had to add is...

        [[[inputs]]]
               [[[[windSpeed]]]]
                       name = windSpeed_mph
                       units = mile_per_hour
               [[[[windGust]]]]
                       name = windGust_mph
                       units = mile_per_hour



On Saturday, 26 October 2019 13:44:27 UTC+1, Pat wrote:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages