python-samsung-smarttv-2016
python-samsung-smarttv-2016 copied to clipboard
Not working with 2017er TV - connection closed
Dear all,
I'm not familiar with python. I download the script and try to control my TV over command line. System is Ubuntu 16.04 LTS
If I'm running the script I get following feedback:
root@srv0007:/var/www/html# python3 sstv2016.py xx.xx.xx.xx KEY_MUTE
Traceback (most recent call last):
File "sstv2016.py", line 38, in
Output on port 8001 from TV is following:
{ "id": "uuid:xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "name": "[TV] Samsung 7 Series (43)", "version": "2.1.0", "device": { "type": "Samsung SmartTV", "duid": "uuid:xxxxxx-xxxx-xxx-xxxxxx", "model": "16_JAZZM_UHD", "modelName": "UE43KS7590", "description": "Samsung DTV RCR", "networkType": "wired", "ssid": "", "ip": "xx.xxx.xxx.xxx", "firmwareVersion": "Unknown", "name": "[TV] Samsung 7 Series (43)", "id": "uuid:xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "udn": "uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx", "resolution": "3840x2160", "countryCode": "DE", "msfVersion": "2.1.0", "smartHubAgreement": "true", "VoiceSupport": "true", "GamePadSupport": "true", "wifiMac": "40:16:3b:0e:69:06", "developerMode": "0", "developerIP": "", "OS": "Tizen" }, "type": "Samsung SmartTV", "uri": "http://xxx.xxx.xxx.xxx:8001/api/v2/", "remote": "1.0", "isSupport": "{"remote_available":"true","remote_fourDirections":"true","remote_touchPad":"true","remote_voiceControl":"true","DMP_available":"true","DMP_DRM_PLAYREADY":"false","DMP_DRM_WIDEVINE":"false","EDEN_available":"true"}" }
Please can you give me an advice, how to get the script running
Thanks a lot
Regards Cinema-HD
Exact same issue here
{
"device": {
"FrameTVSupport": "false",
"GamePadSupport": "true",
"ImeSyncedSupport": "true",
"OS": "Tizen",
"TokenAuthSupport": "true",
"VoiceSupport": "true",
"countryCode": "NL",
"description": "Samsung DTV RCR",
"developerIP": "0.0.0.0",
"developerMode": "0",
"duid": "uuid:xx-xx-xx-xx-xxx",
"firmwareVersion": "Unknown",
"id": "uuid:8f913fc3-x-x-xx-xx",
"ip": "x",
"model": "17_KANTM_UHD_BASIC",
"modelName": "UE55MU6440",
"name": "[TV]Samsung 6",
"networkType": "wireless",
"resolution": "3840x2160",
"smartHubAgreement": "true",
"ssid": "xx",
"type": "Samsung SmartTV",
"udn": "uuid:x",
"wifiMac": "7C:xx"
},
"id": "uuid:8f913fc3xx",
"isSupport": "{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n",
"name": "[TV]Samsung 6",
"remote": "1.0",
"type": "Samsung SmartTV",
"uri": "http://10.0.0.xx:8001/api/v2/",
"version": "2.0.25"
}
I found this documentation: https://developer.samsung.com/tv/develop/extension-libraries/smart-view-sdk/receiver-apps/debugging
Hi , i also get a connection closed with a different websocket error code 1006 `python sstv2016.py 192.168.2.100 KEY_1 KEY_0 KEY_7 KEY_ENTER Traceback (most recent call last): File "/home/omria/.local/lib64/python3.6/site-packages/websockets/protocol.py", line 674, in transfer_data message = yield from self.read_message() File "/home/omria/.local/lib64/python3.6/site-packages/websockets/protocol.py", line 742, in read_message frame = yield from self.read_data_frame(max_size=self.max_size) File "/home/omria/.local/lib64/python3.6/site-packages/websockets/protocol.py", line 821, in read_data_frame self.close_code, self.close_reason = parse_close(frame.data) File "/home/omria/.local/lib64/python3.6/site-packages/websockets/framing.py", line 268, in parse_close check_close(code) File "/home/omria/.local/lib64/python3.6/site-packages/websockets/framing.py", line 295, in check_close raise WebSocketProtocolError("Invalid status code") websockets.exceptions.WebSocketProtocolError: Invalid status code
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "sstv2016.py", line 38, in
`
device | |
---|---|
FrameTVSupport | "false" |
GamePadSupport | "true" |
ImeSyncedSupport | "true" |
OS | "Tizen" |
TokenAuthSupport | "true" |
VoiceSupport | "true" |
countryCode | "IL" |
description | "Samsung DTV RCR" |
developerIP | "192.168.2.8" |
developerMode | "1" |
duid | "uuid:b3d516ea-a5a6-48a9-9794-2df8172809a3" |
firmwareVersion | "Unknown" |
id | "uuid:b3d516ea-a5a6-48a9-9794-2df8172809a3" |
ip | "192.168.2.100" |
model | "18_KANTM2_QTV" |
modelName | "QE49Q6FNA" |
name | "[TV] Samsung Q6 Series (49)" |
networkType | "wired" |
resolution | "3840x2160" |
smartHubAgreement | "true" |
type | "Samsung SmartTV" |
udn | "uuid:b3d516ea-a5a6-48a9-9794-2df8172809a3" |
wifiMac | "d0:03:df:71:a1:ae" |
id | "uuid:b3d516ea-a5a6-48a9-9794-2df8172809a3" |
isSupport | "{"DMP_DRM_PLAYREADY":"false","DMP_DRM_WIDEVINE":"false","DMP_available":"true","EDEN_available":"true","FrameTVSupport":"false","ImeSyncedSupport":"true","TokenAuthSupport":"true","remote_available":"true","remote_fourDirections":"true","remote_touchPad":"true","remote_voiceControl":"true"}\n" |
name | "[TV] Samsung Q6 Series (49)" |
remote | "1.0" |
type | "Samsung SmartTV" |
uri | "http://192.168.2.100:8001/api/v2/" |
version | "2.0.25" |
` this is a qled tv if that helps Thanks
I get 1002 (protocol error) on a RPi running bullseye (python3.9)
`# python3 sstv2016.py 10.0.1.155 KEY_1 KEY_0 KEY_7 KEY_ENTER sstv2016.py:13: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead def _remote(keys, tv_addr,delay=1): Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/protocol.py", line 944, in transfer_data message = await self.read_message() File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/protocol.py", line 1013, in read_message frame = await self.read_data_frame(max_size=self.max_size) File "/usr/local/lib/python3.9/dist-packages/websockets/legacy/protocol.py", line 1095, in read_data_frame self.close_rcvd = Close.parse(frame.data) File "/usr/local/lib/python3.9/dist-packages/websockets/frames.py", line 417, in parse close.check() File "/usr/local/lib/python3.9/dist-packages/websockets/frames.py", line 441, in check raise exceptions.ProtocolError("invalid status code") websockets.exceptions.ProtocolError: invalid status code
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/lightspeed/smarthome/sstv2016.py", line 38, in