Wh1080 mqtt belchertown

163 views
Skip to first unread message

pligg...@gmail.com

unread,
Mar 18, 2021, 10:24:35 AM3/18/21
to weewx-user
Hi! Trying to get the belchertown skin to work on my weewx setup. My problem is getting the mqtt to work. It only says Connected, waiting for data. 
My first question is what would the best update time be running with a wh1080 weather station?
Second, as it never updates,  is there a way to see if the mqtt part works and it's possible to get some weather data? Kind of stuck.
Here's my config:

Weewx config:
[StdRESTful]
 [[MQTT]]
        server_url = mqtt://192.168.1.199:1883
        topic = weather
        unit_system = METRIC

[StdReport]
 [[Belchertown]]
        HTML_ROOT = /var/www/html/weewx/belchertown
        skin = Belchertown
        
        server_url = https://localhost:1883
        topic = weather/loop
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate

Skin.conf
[Extras]

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

Any obvious fault here?

/Mikael

Karen K

unread,
Mar 18, 2021, 11:03:10 AM3/18/21
to weewx-user
I see "server_url" etc. under [[Belchertown]]. That seems to me the wrong place. And I see "localhost:1883" against "192.168.1.199:1883". 

pligg...@gmail.com

unread,
Mar 18, 2021, 3:41:46 PM3/18/21
to weewx-user
Thank you for your answer.
Removed server_url and localhost:1338 but no difference. 
More ideas?

/Mikael

vince

unread,
Mar 18, 2021, 4:01:32 PM3/18/21
to weewx-user
You cannot just remove stuff from weewx.conf or make random configurations up out of thin air and expect things to work...

You have to specify the hostname or ip address of your MQTT broker computer.  Do not use localhost or 127.0.0.1, as the connection will be from your 'browser' computer to the MQTT broker computer.

Here is my example configuration for weewx using a MQTT host that has address 192.168.1.177 on my LAN.
   
# this publishes weewx data to the MQTT broker
 [[MQTT]]
        server_url = mqtt://192.168.1.177:1883/
        topic = weather
        binding = archive, loop
        log_success = False

# this configures Belchertown to request MQTT data using websockets
   [[Belchertown]]
        [[[Extras]]]
            mqtt_websockets_enabled = 1
            mqtt_websockets_host = 192.168.1.177
            mqtt_websockets_port = 9001


You also need your MQTT broker configured to listen on the two ports.
I do it by putting two files in /etc/mosquitto/conf.d on the MQTT broker host.

# this is /etc/mosquitto/conf.d/1883.conf
allow_anonymous true
listener 1883
protocol mqtt


# this is /etc/mosquitto/conf.d/9001.conf
allow_anonymous true
listener 9001
protocol websockets

pligg...@gmail.com

unread,
Mar 18, 2021, 7:59:47 PM3/18/21
to weewx-user
Vince, true! 

The issue is solved, I had mix those to settings (MQTT and Belchertown) with each other so now everyting is working great!
Thank you!

Reply all
Reply to author
Forward
0 new messages