Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets and Firefox #865

Closed
jomimota opened this issue Mar 2, 2023 · 15 comments
Closed

Websockets and Firefox #865

jomimota opened this issue Mar 2, 2023 · 15 comments
Labels
stale Issue has not had activity

Comments

@jomimota
Copy link

jomimota commented Mar 2, 2023

Hi,

Websockets problem with browser Firefox, since last Firefox update (Note: Edge works fine). In two different computers I have this message:

Failed connecting to the weather station. Please try again later!

In my two stations and inclusive in Belchertown station (https://belchertownweather.com/).

Anybody have this problem?

Best Regards.

Jorge Mota

@poblabs
Copy link
Owner

poblabs commented Mar 2, 2023

Have you tried debug mode to see if there's any errors? https://github.com/poblabs/weewx-belchertown#how-to-use-debug

@jomimota
Copy link
Author

jomimota commented Mar 2, 2023

The error in console is:

A ligação a wss://mqtt.obrienlabs.net:9001/mqtt foi interrompida durante o carregamento da página. paho-mqtt.min.js:37:250
MQTT: 2023-03-02T15:05:33-05:00: Cannot connect to MQTT broker

Sorry but my browser is in portuguese.

@norecords
Copy link
Contributor

@jomimota your pointing to @poblabs mqtt server... You have to set your own mqtt server or use a public broker.

@jomimota
Copy link
Author

jomimota commented Mar 7, 2023

I have my own mqtt server and my station is at https://meteo.jorgemota.pt
I showed the problem with wss://mqtt.obrienlabs.net:9001, because the problem is Firefox browser not my instalation.
As I said before with Edge I have no problem.
Did you try Firefox?

@mercurystorm
Copy link

I've tested my station on Belchertown 1.3

Works fine in Chrome, Safari and Firefox (macOS)

@jomimota
Copy link
Author

jomimota commented Mar 7, 2023

I tested with Firefox for Windows with two computers at different locations (networks) with the same result.
Microsoft Edge works fine at both computers.

@mercurystorm
Copy link

appears to be an issue with firefox and mosquitto

  • The connection to wss://mqtt.jorgemota.pt:9001/mqtt was interrupted while the page was loading.

eclipse-mosquitto/mosquitto#1211

@norecords
Copy link
Contributor

Yes this is an old thread. What version of mosquito do you use?

@mercurystorm
Copy link

mosquitto version 2.0.15

mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker

Might be an old thread, but it shows that its a Firefox / Mosquitto issue and not a Belchertown skin issue

The main difference is you are using http2

HTTP/2 200 OK server: nginx/1.18.0 (Ubuntu) date: Wed, 08 Mar 2023 11:37:04 GMT content-type: text/html last-modified: Wed, 08 Mar 2023 11:36:15 GMT etag: W/"6408732f-85d8" content-encoding: gzip X-Firefox-Spdy: h2

while I am using HTTP 1.1

HTTP/1.1 200 OK Date: Wed, 08 Mar 2023 11:33:49 GMT Server: Apache/2.4.52 (Ubuntu) Strict-Transport-Security: max-age=15552000; includeSubDomains; preload Upgrade: h2 Connection: Upgrade, Keep-Alive Last-Modified: Wed, 08 Mar 2023 11:30:48 GMT ETag: "89e7-5f661dc12f64c-gzip" Accept-Ranges: bytes Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 6825 Keep-Alive: timeout=5, max=100 Content-Type: text/html

@roe-dl
Copy link
Contributor

roe-dl commented Mar 8, 2023

If I remember it right, there was an issue with Mosquitto 2.0 while Mosquitto 1.5 works well.

@jomimota
Copy link
Author

jomimota commented Mar 8, 2023

I have mosquitto version 2.0.15 (I don't know if someone else can test with mosquitto 1.5).
Fireworks on Android 13 give me the same error.

I think the problem is with Firefox (not weewx, belchertown skin or mosquitto).

@c0by85
Copy link
Contributor

c0by85 commented May 8, 2023

If I remember it right, there was an issue with Mosquitto 2.0 while Mosquitto 1.5 works well.

We're using 2.0.1.5 too, without any issues.

dpkg -l | grep mosq
ii  libmosquitto1:amd64                   2.0.15a-0mosquitto1~jammy1              amd64        MQTT version 3.1/3.1.1 client library
ii  mosquitto                             2.0.15a-0mosquitto1~jammy1              amd64        MQTT version 3.1/3.1.1 compatible message broker
ii  mosquitto-clients                     2.0.15a-0mosquitto1~jammy1              amd64        Mosquitto command line MQTT clients

if i remember correctly there were problems with firefox or everything from mosquitto must run with SSL if the website also runs with ssl / https. if this is not the case the connection is blocked.

[...]
If the web site is accessible via HTTPS (encrypted), MQTT must also be set to encryption, otherwise it will not work.
[...]

something like...

mqtt_websockets_enabled = 1
mqtt_websockets_host = blub.fuu.foo
mqtt_websockets_port = 9001
mqtt_websockets_ssl = 1
mqtt_websockets_topic = loopi/loop

@c0by85
Copy link
Contributor

c0by85 commented May 8, 2023

I have mosquitto version 2.0.15 (I don't know if someone else can test with mosquitto 1.5). Fireworks on Android 13 give me the same error.

I think the problem is with Firefox (not weewx, belchertown skin or mosquitto).

yepp, here is an other fix...

https://support.mozilla.org/en-US/questions/1324001

open about:config and search for websockets and edit network.http.spdy.websockets to false and tadaaa...

image

@whorfin
Copy link
Contributor

whorfin commented May 31, 2023

At some point this option seems to have gone away in firefox, I had to find network.http.http2.websockets and set that to false

@stale
Copy link

stale bot commented Sep 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had activity label Sep 16, 2023
@stale stale bot closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue has not had activity
Projects
None yet
Development

No branches or pull requests

7 participants