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

WebSocket client error: Failed reading HTTP status line #2

Closed
steakpowered opened this issue Jan 26, 2023 · 4 comments
Closed

WebSocket client error: Failed reading HTTP status line #2

steakpowered opened this issue Jan 26, 2023 · 4 comments

Comments

@steakpowered
Copy link

After updating to version 03.30.16, this error comes up and no longer switches input. Verbose doesn't display any additional information.

[info ] Switching LGTV to input: HDMI_1
[ERROR ] In device event listener: WebSocket client error: Failed reading HTTP status line from ws://xxx.xxx.xxx.xxx:3000 (retries: 0, wait time: 0.000000 ms, HTTP status: 0)

@dechamps
Copy link
Owner

In the latest firmware update LG appears to have changed the way clients can connect to the TV, as evidenced by various other tools being forced to make changes (for example bscpylgtv, LGTVCompanion).

Looking at the changes, it looks like the WebSocket port has changed from 3000 to 3001, and the use of SSL/TLS is now required.

Interestingly, it could very well be that LGTVDeviceListener can already do this with no changes, as I suspect it's already built with SSL support, if memory serves me right.

Can you try the following command and report back:

LGTVDeviceListener.exe --verbose --url wss://xxx.xxx.xxx.xxx:3001

It's basically the same as before except the use of wss: instead of ws: and port 3000 is changed to 3001.

I'm not sure it will work because it might try to verify certificates which will likely fail. In that case I'd need to take a closer look and make some changes.

@dechamps
Copy link
Owner

I just tried the above myself and yeah, as expected it doesn't quite work:

[ERROR  ] FATAL: WebSocket client error: Unable to connect to pegasus-lgtv.home.edechamps.fr on port 3001, error: error in handshake : X509 - Certificate verification failed, e.g. CRL, CA or signature check failed (retries: 0, wait time: 0.000000 ms, HTTP status: 0)

I'll need to find a way to disable certificate verification.

dechamps added a commit that referenced this issue Jan 28, 2023
This is required to be able to connect using TLS (wss://) on port 3001,
which in turn is required to be able to connect to recent LG firmware.

See #2
@dechamps
Copy link
Owner

This is fixed in LGTVDeviceListener 0.2.

Note the updated instructions which use a different URL - wss://xxx.xxx.xxx.xxx:3001 should be used instead of ws://xxx.xxx.xxx.xxx:3000 for LGTVDeviceListener to work with latest LG firmware versions. If you are running as a service, you will want to delete the service and then re-create it with the new URL.

@steakpowered
Copy link
Author

Thanks for fixing this so quickly!

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

2 participants