LGWebOSRemote: Connection reset by peer error?

Hey I started getting this error after updating to the latest software version for my OLED C2 03.30.16:

DEBUG:getmac:Initializing 'ip4' method cache (platform: 'darwin')
DEBUG:getmac:Finished initializing 'ip4' method cache
DEBUG:getmac:Raw MAC found: **:**:**:**:**:**
Traceback (most recent call last):
  File "/opt/lgtv-venv/bin/lgtv", line 33, in <module>
    sys.exit(load_entry_point('LGTV==0.3', 'console_scripts', 'lgtv')())
  File "/opt/lgtv-venv/lib/python3.10/site-packages/LGTV/__init__.py", line 138, in main
    ws.connect()
  File "/opt/lgtv-venv/lib/python3.10/site-packages/ws4py/client/__init__.py", line 224, in connect
    bytes = self.sock.recv(128)
ConnectionResetError: [Errno 54] Connection reset by peer

Sorry I’m not very familiar with Python I’m not sure what’s going on but it looks specific to the ws4py package?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

you can use “lgtv {host} {command} ssl”

SSL is now required for connection to newer firmware devices at port 3001, pull request added.

Yes finally that did it, thanks burnee!

Here is a commit in another project for windows that updates to support the newest TV firmware which should be helpful for updating this package. That commit contains some other changes but from a quick look it seems like there’s a new connection method.

Also found that the bscpylgtv project is updated as well. SSL needs to be used for the connection as implemented here.

I opened an issue on the LG TV control macOS GitHub in case someone there wants to take a stab at correcting this.

Seeing the exact same behavior following this update on the C2.