I got it working. I'm not sure exactly why but I think the problem was related to running the site with https while running Belchertown with mqtt_websockets_ssl = 0. As soon as I amended my apache2 config so that weewx was running unencrypted with htttp instead of https then it started working. I plan to subsequently amend apache2 and weewx/Belchertown to run encrypted with ssl and https. As an FYI, my weewx/Belchertown config files that worked are as follows:
weewx.conf: [[MQTT]] server_url = mqtt://<user>:<password>@localhost:1883/ topic = weather unit_system = US binding = archive, loop aggregation = aggregate Belchertown skin.conf: # MQTT Websockets defaults mqtt_websockets_enabled = 1 mqtt_websockets_host = "zeebytes.org" mqtt_websockets_port = 9001 mqtt_websockets_ssl = 0 mqtt_websockets_topic = "weather/loop" disconnect_live_website_visitor = 1800000 On Saturday, January 18, 2020 at 12:55:36 PM UTC-5, G Hammer wrote: > > I also had to change from mqtt_websockets_host = "localhost" to > mqtt_websockets_host = "FQDN" with FQDN being the full public name of the > server. > > On Saturday, January 18, 2020 at 8:48:36 AM UTC-5, Gordon Dickens wrote: >> >> Hello everybody, >> >> I have the Belchertown skin up and running nicely and so I decided to >> enable MQTT. I successfully installed mosquitto and endeavored to enable >> MTTQ with Belchertown/weewx. However, Belchertown/weewx is not doing >> realtime updates as it is supposed to and displays either "Connecting to >> weather station real time data" (with firefox) or "Failed connecting to the >> weather station. Please try again later!" (with chrome, chromium or >> Konqueror) according to which browser I am using. >> >> I am confident that mosquitto is working properly since I am able to >> manually receive mosquitto output with the command, "mosquitto_sub -h >> localhost -t weather/#", which generates lots of weather data every two >> seconds. Also, my logs show MQTT posting every two seconds as follows: >> >> Jan 17 17:46:27 zeebytes.org weewx[22287]: restx: MQTT: Published record >> 2020-01-17 17:46:27 EST (1579301187) >> >> Here is my MQTT setup in weewx.conf: >> >> [[MQTT]] >> server_url = mqtt://<user>:<password>@localhost:1883/ >> topic = weather >> unit_system = US >> binding = archive, loop >> aggregation = aggregate >> >> Here is my MQTT setup in the Belchertown skin.conf: >> >> # 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 >> >> I am running Debian 10 and apache2. >> >> You may view the site at https://zeebytes.org >> >> I hope that someone can tell me what I am doing wrong! >> >> Thanks, >> >> Gordon >> >> >> >> >> >> >> >> >> -- 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 weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/bbdb05c6-008d-4eae-b135-b232154bec9a%40googlegroups.com.