Python Plugin: Samsung TV

Python and python framework
psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 13:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by psychomaniac » Saturday 24 November 2018 21:54

alright, i managed to upgrade websocket, i also had to update setuptools... looks like i have to update everything, has something to do with Volumio image i guess. I also updatet websocket-client but unfortunately, that also doesn't work. It looks like this isn't the sollution, i still get the same error, see the spoiler for the output. Does anyone have an idea how to solve this one?
Spoiler: show
volumio@volumio:/$ samsungctl -i --host 192.168.0.123 --method websocket
Traceback (most recent call last):
File "/usr/local/bin/samsungctl", line 9, in <module>
load_entry_point('samsungctl==0.7.1', 'console_scripts', 'samsungctl')()
File "/usr/lib/python3.4/samsungctl/__main__.py", line 110, in main
with Remote(config) as remote:
File "/usr/lib/python3.4/samsungctl/remote.py", line 11, in __init__
self.remote = RemoteWebsocket(config)
File "/usr/lib/python3.4/samsungctl/remote_websocket.py", line 30, in __init__
self._read_response()
File "/usr/lib/python3.4/samsungctl/remote_websocket.py", line 67, in _read_response
response = self.connection.recv()
File "/usr/lib/python3.4/websocket/_core.py", line 310, in recv
opcode, data = self.recv_data()
File "/usr/lib/python3.4/websocket/_core.py", line 327, in recv_data
opcode, frame = self.recv_data_frame(control_frame)
File "/usr/lib/python3.4/websocket/_core.py", line 340, in recv_data_frame
frame = self.recv_frame()
File "/usr/lib/python3.4/websocket/_core.py", line 374, in recv_frame
return self.frame_buffer.recv_frame()
File "/usr/lib/python3.4/websocket/_abnf.py", line 383, in recv_frame
frame.validate(self.skip_utf8_validation)
File "/usr/lib/python3.4/websocket/_abnf.py", line 182, in validate
raise WebSocketProtocolException("Invalid close opcode.")
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 13:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by psychomaniac » Monday 26 November 2018 19:10

Meanwhile I used another Pi image, Raspbian and updated fully. But the samsungctl script still doesn't work. I still get the following:

pi@raspberrypi:/usr/local/bin $ samsungctl -i --host 192.168.0.127 --method websocket
Traceback (most recent call last):
File "/usr/local/bin/samsungctl", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3.5/samsungctl/__main__.py", line 110, in main
with Remote(config) as remote:
File "/usr/lib/python3.5/samsungctl/remote.py", line 11, in __init__
self.remote = RemoteWebsocket(config)
File "/usr/lib/python3.5/samsungctl/remote_websocket.py", line 30, in __init__
self._read_response()
File "/usr/lib/python3.5/samsungctl/remote_websocket.py", line 67, in _read_response
response = self.connection.recv()
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_core.py", line 310, in recv
opcode, data = self.recv_data()
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_core.py", line 327, in recv_data
opcode, frame = self.recv_data_frame(control_frame)
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_core.py", line 340, in recv_data_frame
frame = self.recv_frame()
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_core.py", line 374, in recv_frame
return self.frame_buffer.recv_frame()
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_abnf.py", line 383, in recv_frame
frame.validate(self.skip_utf8_validation)
File "/home/pi/.local/lib/python3.5/site-packages/websocket/_abnf.py", line 182, in validate
raise WebSocketProtocolException("Invalid close opcode.")
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

Does anyone know what this means? I'm don't even know what Invalid close opcode means.

Hope someone would help me with this :).

psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 13:17
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by psychomaniac » Monday 26 November 2018 21:07

On Github there is a thread about this:

https://github.com/kdschlosser/samsungctl/issues/2

Looks like samsung did some adjustments in it's latest firmware. It uses tokens now to communicate. Couple of devs are trying to fix this in the last month.

dextm80
Posts: 138
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Samsung TV

Post by dextm80 » Friday 30 November 2018 23:45

Code: Select all

2018-11-30 22:36:27.244 Error: Samsung 65ks7000 hardware (4) thread seems to have ended unexpectedly
....for more and more time

anyone that get this issue?
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge

mazinani
Posts: 2
Joined: Saturday 08 December 2018 8:41
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by mazinani » Saturday 08 December 2018 8:48

It is a new model and the websocket of the tv must be working

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests