[weewx-user] Re: Webpage won't connect to MQTT

2023-03-07 Thread Rich M
I found two things:  1...there really was no reason to use the proxy server 
for the mqtt calls.  So I took it out of line, and just ran the request 
through the cloudflare tunnel.  Worked like a charm.  

2.  Using a userid and password for authentication for mqtt works...but the 
credentials show up as clear text in the javascript.  So no real security 
there.  Easier to just use an anonymous mqtt server.  It's just weather 
data.  



On Sunday, March 5, 2023 at 8:04:00 PM UTC-6 gary@gmail.com wrote:

> It's likely that the websockets port is not 443 as that is https and you 
> do have your reverse proxy set for 9001
>
>
> On Sunday, March 5, 2023 at 7:47:25 PM UTC-5 Rich M wrote:
>
>> I've been setting up Weewx with Belchertown, and everything seems to be 
>> working great...except that I cannot connect to the MQTT within the skin.
>>
>> My Mosquito server is running in a docker on my Unraid server, and I have 
>> an Ubuntu VM that is gathering UDP packets from my Tempest Weatherflow 
>> station.  Weewx is writing the data to the Mosquito server without 
>> problem.  I can connect to the server on my local network with MQTT 
>> Explorer, and I can see the weather data & loop.  
>>
>> For the web page, I'm running a Cloudflare tunnel into my network, and I 
>> have a CaddyV2 reverse proxy between the tunnel and the web server.  I'm 
>> able to access the website from the Internet without problem:  
>> https://www.2whippets.org/weather/belchertown/
>>
>> I have a DNS entry for mqtt.whippets.org set up in cloudflare for the 
>> websockets, and I'm able to use MQTT Explorer to connect to the tunnel from 
>> the internet.  wg://mqtt.2whippets.org on port 443 (with TLS 
>> encryption).  It goes through the cloudflare tunnel to the caddy proxy that 
>> has a config as such:
>>
>> {
>>   log
>>   tls internal
>>   reverse_proxy 192.168.254.3:9001 
>> }
>>
>> And it works through MQTT Explorer.  
>>
>> However, in my Weewx.conf file, my connection looks like this:
>>
>> #--- MQTT Websockets (for Real Time Streaming) Options ---
>> mqtt_websockets_enabled = 1
>> mqtt_websockets_host = "ws://mqtt.2whippets.org"
>> mqtt_websockets_port = 443
>> mqtt_websockets_ssl = 0
>> mqtt_websockets_topic = "weather/#"
>> # disconnect_live_website_visitor = 180
>>
>> It doesn't seem to make any difference if I turn on Websockets_ssl.  It 
>> still fails.  
>>
>> I'm using the cloudflare tunnel so that all of the certificates are taken 
>> care of by cloudflare...and I don't have to open any ports on my firewall.  
>>
>> Any ideas of where to troubleshoot?
>>
>> Thanks
>>
>> rm
>>
>

-- 
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/ce4e8f9b-9ac1-45ab-b377-2fc6d8acbf27n%40googlegroups.com.


[weewx-user] Webpage won't connect to MQTT

2023-03-05 Thread Rich M
I've been setting up Weewx with Belchertown, and everything seems to be 
working great...except that I cannot connect to the MQTT within the skin.

My Mosquito server is running in a docker on my Unraid server, and I have 
an Ubuntu VM that is gathering UDP packets from my Tempest Weatherflow 
station.  Weewx is writing the data to the Mosquito server without 
problem.  I can connect to the server on my local network with MQTT 
Explorer, and I can see the weather data & loop.  

For the web page, I'm running a Cloudflare tunnel into my network, and I 
have a CaddyV2 reverse proxy between the tunnel and the web server.  I'm 
able to access the website from the Internet without problem:  
https://www.2whippets.org/weather/belchertown/

I have a DNS entry for mqtt.whippets.org set up in cloudflare for the 
websockets, and I'm able to use MQTT Explorer to connect to the tunnel from 
the internet.  wg://mqtt.2whippets.org on port 443 (with TLS encryption).  
It goes through the cloudflare tunnel to the caddy proxy that has a config 
as such:

{
  log
  tls internal
  reverse_proxy 192.168.254.3:9001 
}

And it works through MQTT Explorer.  

However, in my Weewx.conf file, my connection looks like this:

#--- MQTT Websockets (for Real Time Streaming) Options ---
mqtt_websockets_enabled = 1
mqtt_websockets_host = "ws://mqtt.2whippets.org"
mqtt_websockets_port = 443
mqtt_websockets_ssl = 0
mqtt_websockets_topic = "weather/#"
# disconnect_live_website_visitor = 180

It doesn't seem to make any difference if I turn on Websockets_ssl.  It 
still fails.  

I'm using the cloudflare tunnel so that all of the certificates are taken 
care of by cloudflare...and I don't have to open any ports on my firewall.  

Any ideas of where to troubleshoot?

Thanks

rm

-- 
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/af06ab7e-aec6-4b80-a36c-758468320fdan%40googlegroups.com.