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

failed to connect with version 3.5.1 / 2.4.5 works #305

Open
wur07 opened this issue Sep 28, 2024 · 8 comments
Open

failed to connect with version 3.5.1 / 2.4.5 works #305

wur07 opened this issue Sep 28, 2024 · 8 comments

Comments

@wur07
Copy link

wur07 commented Sep 28, 2024

hello,

have have the problem that the new version of the plugin i get this error failed to connect to ws://ip:8123/api/websocket

please help thanks

@ctrl-this
Copy link

ctrl-this commented Oct 18, 2024

Hi, thanks for the awesome plugin.
Unfortunately it recently also stopped working for me with the same error message: "Failed to connect to ws://ip:8123/api/websocket" where ip is my internal ip. I can reach the webinterface in Firefox from the same machine. I restarted mac/elgato, tried to create a new token, etc. So far no luck getting the plugin to work again.
Because i have no idea of this i also tried opening the websocket in firefox to test general connection, which returns:
No WebSocket UPGRADE hdr: None
Can "Upgrade" only to "WebSocket".

I run on Mac/latest OS (Sequoia).
As the error message in the plugin is quite limited i dont know where to search for errors or debug this. Let me know if you have any directions :-)

@cgiesche
Copy link
Owner

cgiesche commented Oct 18, 2024

Hi,

there is a way to get more detailed logs. On MacOS it should work like this (can not test, because i do not own a mac device):

  1. Run the following command in the terminal. It enables debugging of the stream-deck application:
    defaults write com.elgato.StreamDeck html_remote_debugging_enabled -bool YES
  2. Restart stream-deck application
  3. Point your browser to http://localhost:23654/
    grafik
  4. Select "PI" or "Plugin" to debug either Settings or the plugin itself. There, you have access to all log output and network activity:
    grafik

PS. It seems that elgato has improved their Plugin API. When I find the time to migrate my plugin, it should be much easier to debug...

@mike-finopsorg
Copy link

In the debug console I see:

WebSocket connection to 'ws://<my_ha_ip>:8123/api/websocket' failed: Error in connection establishment: net::ERR_ADDRESS_UNREACHABLE

From the command line on my Mac:

➜  ~ curl -vv  "http://<my_ha_ip>:8123/api/websocket" 
*   Trying <my_ha_ip>:8123...
* Connected to <my_ha_ip> (<my_ha_ip>) port 8123
> GET /api/websocket HTTP/1.1
> Host: <my_ha_ip>:8123
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain; charset=utf-8
< Referrer-Policy: no-referrer
< X-Content-Type-Options: nosniff
< Server: 
< X-Frame-Options: SAMEORIGIN
< Content-Length: 66
< Date: Tue, 26 Nov 2024 01:06:17 GMT
< 
No WebSocket UPGRADE hdr: None
* Connection #0 to host <my_ha_ip>left intact
 Can "Upgrade" only to "WebSocket".% 

@bitboxer
Copy link

I see the exact same problem on my machine. If I use wscat, it outputs this:

Connected (press CTRL+C to quit)
< {"type":"auth_required","ha_version":"2024.11.3"}

The connection itself works, but not with the streamdeck plugin.

@zerowidth
Copy link

zerowidth commented Dec 3, 2024

I tracked this down to what appears to be a change in recent OS X security settings. On my system, Elgato Stream Deck was disallowed access to the local network, see System Settings > Privacy and Security > Local Network. Once I enabled it, the plugin works again.

Image

@mike-finopsorg
Copy link

Awesome, thanks for your efforts @zerowidth

@chrisjangl
Copy link

I tracked this down to what appears to be a change in recent OS X security settings. On my system, Elgato Stream Deck was disallowed access to the local network, see System Settings > Privacy and Security > Local Network. Once I enabled it, the plugin works again.

Image

Awesome, that worked for me. Thanks @zerowidth

@alexroussel
Copy link

Brilliant ! Many thanks @zerowidth, it was simple but I didn't think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants