Thank you Doug. I just saw this after I was posted my last message, I'll 
take a look.

On Saturday, July 24, 2021 at 8:33:43 AM UTC-4  wrote:

> I had a number of struggles with this when I setup the Belchertown skin on 
> my Raspberry Pi hosting my weather site, www.largoweather.com. I think 
> the issue is that you need your mqtt_websockets_port to be set to 443 as 
> the websocket traffic is getting filtered out by your firewall (9001->8083)
>
> Here is what I did to get this to work on largoweather.com:
>
> 1. Setup Cloudflare to manage the DNS proxy on 2 domains: 
>    - largoweather.com (A Record)
>    - wx.largoweather.com (aka your mqtt.beldenserver.com) - CNAME Record 
> pointing the content to largoweather.com
>    - Setup my SSL/TLS to Strict. I am using Cloudflare to offload my SSL 
> processing so essentially all traffic is coming in through 443.
>    
>    These are pointed to my public IP address which is dynamic. I use a 
> shell script to update cloudflare' content to keep my public IP current for 
> their system
>
> 2. NGNIX Proxy Manager : I use this program to manage my NGINX instance 
> that acts as a reverse proxy manager for my domains:
>      2.1 : Setup:
>             - largoweather.com : Setup to point to my local server ip 
> address. The scheme is http. I use the program's lets encrypt function to 
> get a SSL certificate and force SSL traffic to my final weewx website.
>              - wx.largoweather.com : This handles my sockets setup. I 
> forward all traffic to port 9001 and use the same ssl certificate issued 
> for largoweather. I force SSL on this setup as well.
>
> 3. mosquitto configuration : I setup mosquitto on the same server as my 
> weewx install since everything is running on the pi. here is my 
> mosquitto.conf:
>            pid_file /var/run/mosquitto.pid
>            persistence true
>            persistence_location /var/lib/mosquitto/
>            log_type error
>            websockets_log_level 1023
>            connection_messages true
>            log_dest file /mnt/*****/weewx/logs/mosquitto.log
>            
>            allow_anonymous true
>            password_file /etc/mosquitto/passwd
>            acl_file /etc/mosquitto/acl
>
>            listener 9001
>            protocol websockets
>
>            listener 1883
>            protocol mqtt
>            log_type error
>
>
> 4. weewx/Belchertown configuration: Here I setup my MQTT to talk to my 
> local IP address on port 1883. Remember the traffic is all coming in on 
> port 443, so that is the port I need Belchertown skin to essentially 
> connect to resolve the web sockets requests.
>    
>     [[MQTT]]
>         server_url = mqtt://joeuser:xxxxxxx@<YOUR-LOCAL-SERVER-IP>:1883/
>         topic = weather
>         unit_system = US
>         binding = archive, loop
>         aggregation = aggregate
> [[Belchertown]]
>              skin = Belchertown
>              enable = True
>
>              [[[Extras]]]
>                  site_title = Largo Weather 
>          mqtt_websockets_enabled = 1
>                  mqtt_websockets_host = wxsocket.largoweather.com
>                  mqtt_websockets_port = 443
>                  mqtt_websockets_topic = weather/loop
>                  mqtt_websockets_ssl = 1
>                  disconnect_live_website_visitor = 1800000
>
> I hope this helps!
>
> Doug Jenkins
>
>

-- 
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/c54a5413-88c2-4aea-bf46-b2816ae5d727n%40googlegroups.com.

Reply via email to