/etc/mosquitto/conf.d/1883.conf:allow_anonymous truelistener 1883protocol mqtt/etc/mosquitto/conf.d/9001.conf:allow_anonymous truelistener 9001protocol websocketsVerify it's listening according to netstat:
# netstat -tulpen|grep mosquittotcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 0 3444866 6849/mosquittotcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN 0 3444869 6849/mosquittotcp6 0 0 :::1883 :::* LISTEN 0 3444867 6849/mosquittoVerify it's indeed listening via mosquitto_sub# mosquitto_sub -h localhost -t weather/loop{"dateTime": "1574652627.0", "windSpeed_mph": "0.0", "usUnits": "1.0", "beaufort": "0.0", "maxSolarRad": "0.0", "rainRate_inch_per_hour": "0.0", "hourRain_in": "0.0", "rain24_in": "0.0004393700787401575", "dayRain_in": "0.0004393700787401575"}
[[Belchertown]][[[ Extras ]]]
belchertown_debug = 1
mqtt_websockets_enabled = 1mqtt_websockets_host = localhostmqtt_websockets_port = 9001mqtt_websockets_topic = weather/loop
1) WeeWX conf:[[MQTT]]server_url = mqtt://[user]:[password]@localhost:1883/ <== user/password/localhost/porttopic = weatherunit_system = US
binding = archive, loopaggregation = aggregate
2) Belchertown conf:[Extras]# MQTT Websockets defaultsmqtt_websockets_host = [domain-name] <== the actual DomainName, not "localhost"mqtt_websockets_port = 9001mqtt_websockets_ssl = 0mqtt_websockets_topic = "weather/loop"
After much trial-and-error, the following is what works in my Rpi case:
mqtt_websockets_host = [domain-name] <== the actual DomainName, not "localhost"