Connection refused generally means the remote computer is not accepting incoming connections on that port. It looks to me like you are trying to connect to the MQTT server on the same pi ? Did you enable and start the MQTT server ?
Did you test it with mosquitto_sub and mosquitto_pub to know that the MQTT server is working ok ? The authoritative belchertown docs are at https://github.com/poblabs/weewx-belchertown?tab=readme-ov-file#mqtt-and-mqtt-websockets-optional if you haven't gone through them already. Note that it has a prerequisite to install the MQTT extension which itself has prerequisite python modules. Test with mosquitto_sub/pub first to know your MQTT server is working as desired, then do the weewx part. On Wednesday, July 24, 2024 at 7:30:33 PM UTC-7 M&M wrote: > Somewhat of a new user here to Weewx. I am running it on a Raspberry Pi > Zero W (192.168.0.196) and also installed the Belchertown skin. I followed > these steps (https://www.wxforum.net/index.php?topic=43377.0) to install > and configure MQTT but I'm running into some errors. Here is what part of > my weewx.conf file looks like for the MQTT stuff: > > [[MQTT]] > server_url = mqtt://random_username:[email protected]:1883 > <http://random_username:[email protected]:1883> > unit_system = US > topic = weather > binding = archive, loop > aggregation = aggregate > > [[Belchertown]] > skin = Belchertown > HTML_ROOT = /var/www/html/weewx/belchertown > enable = true > > > [[[Extras]]] > #--- MQTT Websockets (for Real Time Streaming) Options --- > mqtt_websockets_enabled = 1 > mqtt_websockets_host = 192.168.0.x > mqtt_websockets_port = 9001 > mqtt_websockets_ssl = 0 > mqtt_websockets_topic = weather/loop > > I also added user.mqtt.MQTT to restful_services at the end of the file. > > The error I'm seeing in journalctl is: > > Jul 24 22:16:40 raspberrypi weewxd[25776]: ERROR user.mqtt: Failed to > connect to MQTT server (mqtt://random_username:[email protected]:1883 > <http://random_username:[email protected]:1883>): [Errno 111] Connection > refused > Jul 24 22:16:40 raspberrypi weewxd[25776]: ERROR weewx.restx: MQTT: Failed > to publish record 2024-07-24 22:15:00 EDT (1721873700): MQTT client not > available > > Any ideas what I'm missing? > > > > > > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/ab9d1c3b-2595-4b50-b71d-6061d3bb3849n%40googlegroups.com.
