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

bugfix/frame-fw14xx #125

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

thypon
Copy link
Contributor

@thypon thypon commented May 2, 2023

Tested on my 55" 2019 model, working good

I created this small script too which I use with my midjourney account to create artsy art: https://gist.github.com/thypon/9afca331d3f30e895e940421cfe0bef2

python3 art.py --remove-all --address https://cdn.midjourney.com/807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png

IMG_3388 - 01

Solves: #106

@fhaertig
Copy link

fhaertig commented May 3, 2023

Hi,

I hit the same problem with a Frame 55" 2019 (model name: QE55LS03RAUXZG) and unfortunately your gist does not fix it for me. This is the output (sorry for using the same picture, just used it for this test):

`
python3 art.py --address https://cdn.midjourney.com/807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png

DEBUG:samsungtvws.rest:Get device info via rest api
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.119:8001
DEBUG:urllib3.connectionpool:http://192.168.1.119:8001 "GET /api/v2/ HTTP/1.1" 200 1317
DEBUG:samsungtvws.helper:Processing API response: {"device":{"FrameTVSupport":"true","GamePadSupport":"true","ImeSyncedSupport":"true","Language":"de_DE","OS":"Tizen","PowerState":"on","TokenAuthSupport":"true","VoiceSupport":"true","WallScreenRatio":"0","WallService":"false","countryCode":"DE","description":"Samsung DTV RCR","developerIP":"192.168.1.110","developerMode":"1","duid":"uuid:76ccc1f2-3cb0-4a9e-b948-1702b66e6a3c","firmwareVersion":"Unknown","id":"uuid:76ccc1f2-3cb0-4a9e-b948-1702b66e6a3c","ip":"192.168.1.119","model":"19_MUSEM_FRAME","modelName":"QE55LS03RAUXZG","name":"[TV] Samsung The Frame (55)","networkType":"wireless","resolution":"3840x2160","smartHubAgreement":"true","ssid":"90:9a:4a:f4:e1:2e","type":"Samsung SmartTV","udn":"uuid:76ccc1f2-3cb0-4a9e-b948-1702b66e6a3c","wifiMac":"24:FC:E5:9B:DE:94"},"id":"uuid:76ccc1f2-3cb0-4a9e-b948-1702b66e6a3c","isSupport":"{"DMP_DRM_PLAYREADY":"false","DMP_DRM_WIDEVINE":"false","DMP_available":"true","EDEN_available":"true","FrameTVSupport":"true","ImeSyncedSupport":"true","TokenAuthSupport":"true","remote_available":"true","remote_fourDirections":"true","remote_touchPad":"true","remote_voiceControl":"true"}\n","name":"[TV] Samsung The Frame (55)","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.1.119:8001/api/v2/","version":"2.0.25"}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cdn.midjourney.com:443
DEBUG:urllib3.connectionpool:https://cdn.midjourney.com:443 "GET /807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png HTTP/1.1" 200 2422643
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 65536
DEBUG:samsungtvws.connection:WS url ws://192.168.1.119:8001/api/v2/channels/com.samsung.art-app?name=U2Ftc3VuZ1R2UmVtb3Rl
DEBUG:samsungtvws.helper:Processing API response: {"data":{"clients":[{"attributes":{"name":null},"connectTime":1683104313024,"deviceName":"Smart Device","id":"719937b2-785a-4188-b013-7590ccbeaa8","isHost":true},{"attributes":{"name":"U2Ftc3VuZ1R2UmVtb3Rl"},"connectTime":1683140350870,"deviceName":"U2Ftc3VuZ1R2UmVtb3Rl","id":"b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2","isHost":false}],"id":"b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2"},"event":"ms.channel.connect"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': {'clients': [{'attributes': {'name': None}, 'connectTime': 1683104313024, 'deviceName': 'Smart Device', 'id': '719937b2-785a-4188-b013-7590ccbeaa8', 'isHost': True}, {'attributes': {'name': 'U2Ftc3VuZ1R2UmVtb3Rl'}, 'connectTime': 1683140350870, 'deviceName': 'U2Ftc3VuZ1R2UmVtb3Rl', 'id': 'b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2', 'isHost': False}], 'id': 'b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2'}, 'event': 'ms.channel.connect'}
DEBUG:samsungtvws.helper:Processing API response: {"data":{},"event":"ms.channel.ready"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': {}, 'event': 'ms.channel.ready'}
DEBUG:samsungtvws.connection:SamsungTVWS websocket command: {"method": "ms.channel.emit", "params": {"event": "art_app_request", "to": "host", "data": "{"request": "send_image", "file_type": "png", "conn_info": {"d2d_mode": "socket", "connection_id": 4102090466, "id": "89650cb5-35c7-461b-9f3f-38a48e7343a7"}, "image_date": "2023:05:03 20:59:11", "matte_id": "none", "file_size": 2422643, "id": "89650cb5-35c7-461b-9f3f-38a48e7343a7"}"}}
DEBUG:samsungtvws.helper:Processing API response: {"data":"{"id":"89650cb5-35c7-461b-9f3f-38a48e7343a7","event":"error","request_data":"{\"request\": \"send_image\", \"file_type\": \"png\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": 4102090466, \"id\": \"89650cb5-35c7-461b-9f3f-38a48e7343a7\"}, \"image_date\": \"2023:05:03 20:59:11\", \"matte_id\": \"none\", \"file_size\": 2422643, \"id\": \"89650cb5-35c7-461b-9f3f-38a48e7343a7\"}","error_code":"-1","target_client_id":"b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2"}","event":"d2d_service_message","from":"719937b2-785a-4188-b013-7590ccbeaa8"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': '{"id":"89650cb5-35c7-461b-9f3f-38a48e7343a7","event":"error","request_data":"{\"request\": \"send_image\", \"file_type\": \"png\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": 4102090466, \"id\": \"89650cb5-35c7-461b-9f3f-38a48e7343a7\"}, \"image_date\": \"2023:05:03 20:59:11\", \"matte_id\": \"none\", \"file_size\": 2422643, \"id\": \"89650cb5-35c7-461b-9f3f-38a48e7343a7\"}","error_code":"-1","target_client_id":"b8a232a1-c2ff-4ca6-bdc3-e97c99aa78c2"}', 'event': 'd2d_service_message', 'from': '719937b2-785a-4188-b013-7590ccbeaa8'}
Traceback (most recent call last):
File "/Users/fhaertig/codebase/sandbox/samsungtv/art.py", line 81, in
remote_filename = tv.art().upload(data, file_type='PNG', matte='none')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/samsungtvws/art.py", line 224, in upload
response = self._send_art_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/samsungtvws/art.py", line 125, in _send_art_request
raise exceptions.ResponseError(
samsungtvws.exceptions.ResponseError: send_image request failed with error number -1
`

@thypon
Copy link
Contributor Author

thypon commented May 3, 2023

@fhaertig the gist alone does not fix the issue, and the debug messages seems to return expected results.
You need also to use the branch containing the fixes I implemented in this library.

The following + the gist should work on 2019 samsung TVs.
The code is not super clean, since there is a special case just for 2019 devices, but I have no way to test if the legacy code is working in newer devices, so here we are.

pip3 uninstall 'samsungtvws[async,encrypted]'; pip3 install "git+https://github.com/thypon/samsung-tv-ws-api.git@bugfix/frame-fw-14xx#egg=samsungtvws[async,encrypted]"

@fhaertig
Copy link

fhaertig commented May 5, 2023

silly me... thanks for the hint. But that doesn't quite fixes it, either. It looks like the file upload starts (a lot of byte codes are printed) and then it stops somehow, always at the same position. I'll have to investigate further

@fhaertig
Copy link

fhaertig commented May 12, 2023

More insight: So apparently it never finishes the upload, as already mentioned in #106 because of a failing d2d connection command:

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': '{"id":"86860dff-7e7f-435c-b817-f171a60882e2","event":"error","request_data":"{\"request\": \"send_image\", \"file_type\": \"jpg\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": 2980860187, \"id\": \"86860dff-7e7f-435c-b817-f171a60882e2\"}, \"image_date\": \"2023:05:12 14:37:07\", \"matte_id\": \"none\", \"file_size\": 132906, \"id\": \"86860dff-7e7f-435c-b817-f171a60882e2\"}","error_code":"-1","target_client_id":"f67a4cb4-d177-49d7-bd5d-c2d4c66a06f"}', 'event': 'd2d_service_message', 'from': 'b8a4388-b1c3-4751-939e-32b727641675'}

@thypon
Copy link
Contributor Author

thypon commented May 12, 2023

Have you tried sending my command, without the --remove-all?

python3 art.py --address https://cdn.midjourney.com/807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png

@bubizar
Copy link

bubizar commented May 14, 2023

Have you tried sending my command, without the --remove-all?

python3 art.py --address https://cdn.midjourney.com/807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png

Even with bugfix, same error than @fhaertig.
My TV Model : QE55LS03RAUXXC

I've tried with/out [encrypted,async]. No improvement.

Thank you all for trying to help us.
Despairing.

@thypon
Copy link
Contributor Author

thypon commented May 14, 2023

Weirdly we have ~ the same model QE55LS03RAUXZT. I did a full reset, though…

@bubizar
Copy link

bubizar commented May 14, 2023

I did a full reset, though…

@thypon While it wasn't working, you made a full reset and it finally worked ? Or, you started with a full reset and, perhaps, it helped.

@thypon
Copy link
Contributor Author

thypon commented May 15, 2023

I did a full reset, though…

@thypon While it wasn't working, you made a full reset and it finally worked ? Or, you started with a full reset and, perhaps, it helped.

I remember I was not even able to connect to the official Samsung app before the reset. I think the last firmware borked the connection.

I then proceeded to reverse engineer the app communication and implemented the fix here.

@bubizar
Copy link

bubizar commented May 15, 2023

Thanks to the debugger, I've been able to identify the very moment at which program stucks.

Here is the stack trace when it stucks :

_recv (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_socket.py:87)
recv (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_socket.py:108)
_recv (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_core.py:529)
recv_strict (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_abnf.py:373)
recv_header (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_abnf.py:294)
recv_frame (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_abnf.py:338)
recv_frame (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_core.py:445)
recv_data_frame (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_core.py:406)
recv_data (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_core.py:385)
recv (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\websocket\_core.py:362)
open (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\samsungtvws\art.py:89)
_send_art_legacy (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\samsungtvws\art.py:151)
upload (\home\xxx\dev\samsungtv\samsungenv\lib\python3.9\site-packages\samsungtvws\art.py:332)
<module> (\home\xxx\dev\samsungtv\art.py:81)
_run_code (\usr\lib\python3.9\runpy.py:87)
_run_module_as_main (\usr\lib\python3.9\runpy.py:197)

Program's debug has been enabled. Here is the program's output (redacted). Last line has been cut as it weights 6MB 😲 (see capture at the end of this post) :

DEBUG:samsungtvws.rest:Get device info via rest api
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.xxx.xxx:8001
DEBUG:urllib3.connectionpool:http://192.168.xxx.xxx:8001 "GET /api/v2/ HTTP/1.1" 200 1273
DEBUG:samsungtvws.helper:Processing API response: {"device":{"FrameTVSupport":"true","GamePadSupport":"true","ImeSyncedSupport":"true","Language":"fr_FR","OS":"Tizen","PowerState":"on","TokenAuthSupport":"true","VoiceSupport":"true","WallScreenRatio":"0","WallService":"false","countryCode":"FR","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"uuid:xxx","firmwareVersion":"Unknown","id":"uuid:xxx","ip":"192.168.xxx.xxx","model":"19_MUSEM_FRAME","modelName":"QE55LS03RAUXXC","name":"xxx","networkType":"wired","resolution":"3840x2160","smartHubAgreement":"true","type":"Samsung SmartTV","udn":"uuid:xxx","wifiMac":"xxx"},"id":"uuid:xxx","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"true\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"xxx","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.xxx.xxx:8001/api/v2/","version":"2.0.25"}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): cdn.midjourney.com:443
DEBUG:urllib3.connectionpool:https://cdn.midjourney.com:443 "GET /807cc3c4-13aa-4dc2-b2cf-a8e800e141e0/0_2.png HTTP/1.1" 200 2422643
DEBUG:PIL.PngImagePlugin:STREAM b'IHDR' 16 13
DEBUG:PIL.PngImagePlugin:STREAM b'IDAT' 41 65536
DEBUG:samsungtvws.connection:WS url ws://192.168.xxx.xxx:8001/api/v2/channels/com.samsung.art-app?name=xxx
DEBUG:samsungtvws.helper:Processing API response: {"data":{"clients":[{"attributes":{"name":null},"connectTime":1684057369752,"deviceName":"Smart Device","id":"xxx","isHost":true},{"attributes":{"name":"xxx"},"connectTime":1684187548406,"deviceName":"xxx","id":"xxx","isHost":false}],"id":"xxx"},"event":"ms.channel.connect"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': {'clients': [{'attributes': {'name': None}, 'connectTime': 1684057369752, 'deviceName': 'Smart Device', 'id': 'xxx', 'isHost': True}, {'attributes': {'name': 'xxx'}, 'connectTime': 1684187548406, 'deviceName': 'xxx', 'id': 'xxx', 'isHost': False}], 'id': 'xxx'}, 'event': 'ms.channel.connect'}
DEBUG:samsungtvws.helper:Processing API response: {"data":{},"event":"ms.channel.ready"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': {}, 'event': 'ms.channel.ready'}
DEBUG:samsungtvws.connection:SamsungTVWS websocket command: {"method": "ms.channel.emit", "params": {"event": "art_app_request", "to": "host", "data": "{\"request\": \"send_image\", \"file_type\": \"png\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": xxx, \"id\": \"xxx\"}, \"image_date\": \"2023:05:15 23:52:28\", \"matte_id\": \"none\", \"file_size\": 2422643, \"id\": \"xxx\"}"}}
DEBUG:samsungtvws.helper:Processing API response: {"data":"{\"id\":\"xxx\",\"event\":\"error\",\"request_data\":\"{\\\"request\\\": \\\"send_image\\\", \\\"file_type\\\": \\\"png\\\", \\\"conn_info\\\": {\\\"d2d_mode\\\": \\\"socket\\\", \\\"connection_id\\\": xxx, \\\"id\\\": \\\"xxx\\\"}, \\\"image_date\\\": \\\"2023:05:15 23:52:28\\\", \\\"matte_id\\\": \\\"none\\\", \\\"file_size\\\": 2422643, \\\"id\\\": \\\"xxx\\\"}\",\"error_code\":\"-1\",\"target_client_id\":\"xxx\"}","event":"d2d_service_message","from":"xxx"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': '{"id":"xxx","event":"error","request_data":"{\\"request\\": \\"send_image\\", \\"file_type\\": \\"png\\", \\"conn_info\\": {\\"d2d_mode\\": \\"socket\\", \\"connection_id\\": xxx, \\"id\\": \\"xxx\\"}, \\"image_date\\": \\"2023:05:15 23:52:28\\", \\"matte_id\\": \\"none\\", \\"file_size\\": 2422643, \\"id\\": \\"xxx\\"}","error_code":"-1","target_client_id":"xxx"}', 'event': 'd2d_service_message', 'from': 'xxx'}
DEBUG:samsungtvws.art:SamsungTVWS websocket command: bytearray(b'\x00\xde{"method": "ms.channel.emit", "params": {"event": "art_app_request", "to": "host", "data": "{\\"request\\": \\"send_image\\", \\"file_type\\": \\"png\\", \\"matte_id\\": \\"none\\", \\"id\\": \\"xxx\\"}"}}\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x05\xb0\x00\x00\x030\x08\x02\x00\x00\x00~\xda\xd1\x0e\x00\x01\x00\x00IDATx\x9c<\xfd\xd9\xaf-\xddz\xde\x87\xbd\xed\x18U5\xe7\\k\xed\xbd\xbf\xee\x1cR\x87\x14y(R\xa1:\xc7\x0e\xc4D\x92e\xc1\xc8\x95\x12\xc7\x96m!\x06\x82\x18I\x04\xf8&\xb9\xcd\xdf\xe2\xdc\xd9\xc9\x1f\x108\x80\x01)rD\x86\x11\x0c\xc4\x80\x15\xb5lE\x1e\x92\x87\xe7|\xdd\xee\xd6ZsV\xd5\x18\xe3mrQ\xeb\xf3\xe5\xda\xcd\\s\xd6\xac\x1a\xe3\x1d\xcf\xfb<\xbf\x17\x7f\xed\xe7\xee\x94\x10\x01X53!\x01#\x10\x12\x10\x032\x90,\xb2\x14q\x1f\x84\x88\x89\x99\x80\x08\xe1N\x84\x80\x88\x80\x80\xe8\x1e\x00\x89\x80\x91\x80\x80\xe6\x0e\xac\xc0\xba\xee\x1b2\x11\x01\xb3X\xe4\xb0(\xcc\x82`c\x00`d\xd6\xb9X\x1f\x00T\xa7\xda\xda.\x8c\x1eI\x0c\x00\xd8\xf6\xa6\xaa\xc4\xdc\xb6v\xba\x9c\xb7uE\x80\xba\xd4\xb6\x0fUus\x11\x8e\x08\x00 B\x1fV\x8a\x86{)\x9c\x1e\x99!\xaa\xde\x86\xaa\xec\xadk)

2023-05-15_23h54_18

Nothing happens after it stucks until killing the program or powering off the TV.

@ipus2017
Copy link

ipus2017 commented Jan 8, 2024

Hi @thypon, I tried to use your code, but keep getting this error below. My TV is QN43LS03RAFXZA, and FW is 1406.4. Any help is much appreciated.

Traceback (most recent call last):
File "/Users/ilyapeltsverger/Library/Python/3.8/lib/python/site-packages/samsungtvws/art.py", line 272, in upload
response = self._send_art_request(
File "/Users/ilyapeltsverger/Library/Python/3.8/lib/python/site-packages/samsungtvws/art.py", line 126, in _send_art_request
raise exceptions.ResponseError(
samsungtvws.exceptions.ResponseError: send_image request failed with error number -1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test22.py", line 16, in
uploadedID = tv.art().upload(data)
File "/Users/ilyapeltsverger/Library/Python/3.8/lib/python/site-packages/samsungtvws/art.py", line 332, in upload
response = self._send_art_legacy(
File "/Users/ilyapeltsverger/Library/Python/3.8/lib/python/site-packages/samsungtvws/art.py", line 151, in _send_art_legacy
self.open()
File "/Users/ilyapeltsverger/Library/Python/3.8/lib/python/site-packages/samsungtvws/art.py", line 96, in open
raise exceptions.ConnectionFailure(response)
samsungtvws.exceptions.ConnectionFailure: {'data': {'attributes': {'name': 'U2Ftc3VuZ1R2UmVtb3Rl'}, 'connectTime': 1704757561367, 'deviceName': 'U2Ftc3VuZ1R2UmVtb3Rl', 'id': '7ee23996-6262-479a-b07a-e5b3bfed9fbe', 'isHost': False}, 'event': 'ms.channel.clientDisconnect'}

@thypon
Copy link
Contributor Author

thypon commented Jan 8, 2024

Hey @ipus2017 , unfortunately I don't own all the devices to test for, but it takes some hours to reverse engineer the protocol and understand what is going on + adapt the code.

It still works fine on my 55" 2019

@ipus2017
Copy link

ipus2017 commented Jan 9, 2024

Hey @ipus2017 , unfortunately I don't own all the devices to test for, but it takes some hours to reverse engineer the protocol and understand what is going on + adapt the code.

It still works fine on my 55" 2019

OK, thanks for your quick response What is your FW?

@thypon
Copy link
Contributor Author

thypon commented Jan 9, 2024

1406 QE55LS03RAUXZT model.
I had to reset the device to let it connect, though.
So maybe it cannot be enrolled in the newer app and work with the older format, at the same time.

@ipus2017
Copy link

ipus2017 commented Jan 9, 2024

The funny thing is I also have QN55LS03RAFXZA on FW 1406 and it also doesn't work with the same error. I hate Samsung :) This one works perfectly QN55LS03AAFXZA.

@thypon
Copy link
Contributor Author

thypon commented Jan 9, 2024

QE55LS03RAUXZT might be a distinct model from QN55LS03RAFXZA.
I'm available for offline tinkering here https://mastodon.social/@thypon OR on matrix @thypon:matrix.org

@borjaburgos
Copy link

I'm also on QN55LS03RAFXZA running 1406

{"device":{"FrameTVSupport":"true","GamePadSupport":"true","ImeSyncedSupport":"true","Language":"en_US","OS":"Tizen","PowerState":"on","TokenAuthSupport":"true","VoiceSupport":"true","WallScreenRatio":"0","WallService":"false","countryCode":"US","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"uuid:f49849c7-b704-4e7a-b8ff-09c501f3e9ae","firmwareVersion":"Unknown","id":"uuid:f49849c7-b704-4e7a-b8ff-09c501f3e9ae","ip":"192.168.10.143","model":"19_MUSEM_FRAME","modelName":"QN55LS03RAFXZA","name":"[TV] Samsung The Frame (55)","networkType":"wireless","resolution":"3840x2160","smartHubAgreement":"true","ssid":"78:45:58:5f:d0:be","type":"Samsung SmartTV","udn":"uuid:f49849c7-b704-4e7a-b8ff-09c501f3e9ae","wifiMac":"B8:BC:5B:B1:F2:D2"},"id":"uuid:f49849c7-b704-4e7a-b8ff-09c501f3e9ae","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"true\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung The Frame (55)","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.10.143:8001/api/v2/","version":"2.0.25"}

I've tried a few things but always seem to run into a timeout issue when uploading images to the TV:

...=\rY8\xc9\xc93\x96\xbe\xe3\x93\x12s\x951\xcb\x97\x16B[hN{\x12Z?\xa9\xfe\x0bE-\x1a6k\xe3E\xaa>\x9eX\x8a\x9341\xe3c|\x98\x8b\x116-\x16%bh\xca\x14\xce\xcf\x1f\x87CHiQ)\'f\xdb2\x82\xb1E\xe8\xa6V\xd0\xfb4I\xc7cHtI49-\xfcl\xff\xd9')
DEBUG:samsungtvws.helper:Processing API response: {"data":{"attributes":{"name":"U2Ftc3VuZ1R2UmVtb3Rl"},"connectTime":1710388902595,"deviceName":"U2Ftc3VuZ1R2UmVtb3Rl","id":"5db87cbf-dccf-42f1-a9f7-c5ad14a7c075","isHost":false},"event":"ms.channel.clientDisconnect"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': {'attributes': {'name': 'U2Ftc3VuZ1R2UmVtb3Rl'}, 'connectTime': 1710388902595, 'deviceName': 'U2Ftc3VuZ1R2UmVtb3Rl', 'id': '5db87cbf-dccf-42f1-a9f7-c5ad14a7c075', 'isHost': False}, 'event': 'ms.channel.clientDisconnect'}
DEBUG:samsungtvws.connection:Connection closed.
ERROR:root:There was an error: {'data': {'attributes': {'name': 'U2Ftc3VuZ1R2UmVtb3Rl'}, 'connectTime': 1710388902595, 'deviceName': 'U2Ftc3VuZ1R2UmVtb3Rl', 'id': '5db87cbf-dccf-42f1-a9f7-c5ad14a7c075', 'isHost': False}, 'event': 'ms.channel.clientDisconnect'}

Any pointers or things to try out to get this working would be appreciated. Thanks!

@xchwarze
Copy link
Owner

Samsung depending on the version of Tizen and the version of FW usually remove these things so that we do not use them anymore.
But within the same family that should be running the same versions of Tizen and practically the same FW is really rare to fail.

This type of functionality would really take them out of the package, in real world it is very difficult to understand if they really will work for all users.

@ipus2017
Copy link

ipus2017 commented Mar 19, 2024 via email

Copy link
Collaborator

@epenet epenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the get_matte_list fix should be a separate standalone PR.
I think the logic should also be split between a v1 and v2, and not

Comment on lines +419 to +420
elif "matte_list" in data:
return json.loads(data["matte_list"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better here to fail hard.

Suggested change
elif "matte_list" in data:
return json.loads(data["matte_list"])
return json.loads(data["matte_list"])

Another option is to raise an exception

        if "matte_type_list" in data:
            return json.loads(data["matte_type_list"])
        if "matte_list" in data:
            return json.loads(data["matte_list"])
        raise ...

"connection_id": random.randrange(4 * 1024 * 1024 * 1024),
"id": self.art_uuid,
try:
response = self._send_art_request(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here it would be better to split it completely into two methods:

    try:
        self._upload_v1(file, matte, file_type, date)
    except exceptions.ResponseError:
        self._upload_v2(file, matte, file_type, date)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't have access to the TV 'till next month, will check later.
Thanks for the review!

@epenet
Copy link
Collaborator

epenet commented Mar 19, 2024

I was able to fix it for my TV - QN55LS03AAFXZA. Try attached art.py file.

@ipus2017 the attachment is not present. Please edit your comment and use drag-drop instead to upload the file.

@ipus2017
Copy link

I was able to fix it for my TV - QN55LS03AAFXZA. Try attached art.py file.

@ipus2017 the attachment is not present. Please edit your comment and use drag-drop instead to upload the file.

I had to rename it to txt, but here's the file

art.py.txt

@borjaburgos
Copy link

I was able to fix it for my TV - QN55LS03AAFXZA. Try attached art.py file.

@ipus2017 the attachment is not present. Please edit your comment and use drag-drop instead to upload the file.

I had to rename it to txt, but here's the file

art.py.txt

@ipus2017 are there any significant changes to PR #125 opened by @thypon in the art.py file that you uploaded? I'm failing to see any.

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

Successfully merging this pull request may close these issues.

7 participants