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

stuck at upload() #106

Open
vandenbrakel opened this issue Mar 29, 2022 · 11 comments
Open

stuck at upload() #106

vandenbrakel opened this issue Mar 29, 2022 · 11 comments

Comments

@vandenbrakel
Copy link

Hi Thanks for the Frame Support!

I'm testing the upload function on an Rpi. When uploading a png, it seems just stuck from there.
I have logging on info, but no output so far.

Anything I can do / test to get more info on progress etc?

@vandenbrakel
Copy link
Author

After some investigation and logging on debug I see the upload command results in error -1. Anyone has some info on this?

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": 2825700145, "id": "3d99854f-a8cf-4971-afd6-058b7151da16"}, "image_date": "2022:04:06 08:52:23", "matte_id": "modern_apricot", "file_size": 16123877, "id": "3d99854f-a8cf-4971-afd6-058b7151da16"}"}}
DEBUG:samsungtvws.helper:Processing API response: {"data":"{"id":"3d99854f-a8cf-4971-afd6-058b7151da16","event":"error","request_data":"{\"request\": \"send_image\", \"file_type\": \"png\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": 2825700145, \"id\": \"3d99854f-a8cf-4971-afd6-058b7151da16\"}, \"image_date\": \"2022:04:06 08:52:23\", \"matte_id\": \"modern_apricot\", \"file_size\": 16123877, \"id\": \"3d99854f-a8cf-4971-afd6-058b7151da16\"}","error_code":"-1","target_client_id":"ada14710-7e2e-47bb-885b-1715512a2d40"}","event":"d2d_service_message","from":"83a74979-99b1-41c6-96b4-a463bcfc2bdd"}

DEBUG:samsungtvws.connection:SamsungTVWS websocket event: {'data': '{"id":"3d99854f-a8cf-4971-afd6-058b7151da16","event":"error","request_data":"{\"request\": \"send_image\", \"file_type\": \"png\", \"conn_info\": {\"d2d_mode\": \"socket\", \"connection_id\": 2825700145, \"id\": \"3d99854f-a8cf-4971-afd6-058b7151da16\"}, \"image_date\": \"2022:04:06 08:52:23\", \"matte_id\": \"modern_apricot\", \"file_size\": 16123877, \"id\": \"3d99854f-a8cf-4971-afd6-058b7151da16\"}","error_code":"-1","target_client_id":"ada14710-7e2e-47bb-885b-1715512a2d40"}', 'event': 'd2d_service_message', 'from': '83a74979-99b1-41c6-96b4-a463bcfc2bdd'}
DEBUG:samsungtvws.helper:Processing API response: {"data":{"attributes":{"name":"U2Ftc3VuZ1R2UmVtb3Rl"},"connectTime":1649231541956,"deviceName":"U2Ftc3VuZ1R2UmVtb3Rl","id":"af6db873-dd46-4cf0-b6be-f145fd606caf","isHost":false},"event":"ms.channel.clientDisconnect"}

@bubizar
Copy link

bubizar commented May 31, 2022

After some investigation and logging on debug I see the upload command results in error -1. Anyone has some info on this?
Got exactly the same error.
Model : QE55LS03RAUXXC
So excited ! And after hours...😞

Can't get any light from TCP dump.
Infinite websocket ping/pong...
2022-05-31_23h20_35

Got the same from rpi, Windows, WSL2... maybe a configuration on the TV... but which one ? I've tried many options...

@bubizar
Copy link

bubizar commented Sep 21, 2022

Hi @vandenbrakel, have you managed this mess ?

@audibleblink
Copy link

same here. got here by way of a couple other projects using this as a dep.

@nat38
Copy link

nat38 commented Dec 26, 2022

Hi.
I have the same issue. Anyone able to overcome this?

@tom-murray
Copy link

My code works perfectly on a newer Frame running firmware version 2401, however, I have the same issue as above on a Frame 65" 2019 model running firmware 1401, the latest version for this model.

@vandenbrakel
Copy link
Author

vandenbrakel commented Jan 31, 2023 via email

@tom-murray
Copy link

tom-murray commented Jan 31, 2023

This is a snippet of code, I'm going to unsplash then downloading a new photo each day and uploading to the Frame and deleting the previous.

response = requests.get(image)

img=Image.open(BytesIO(response.content))
img.thumbnail((3840,2160))
img.save('bg.jpg')

# Normal constructor
tv = SamsungTVWS("<REPLACE WITH THE IP>")

# Get current image
current_img = tv.art().get_current()

# Upload new image 
file = open('bg.jpg', 'rb')
data = file.read()
uploadedID = tv.art().upload(data, file_type="JPEG", matte='none')
tv.art().select_image(uploadedID)

# Delete old image
tv.art().delete(current_img['content_id'])

@thypon
Copy link
Contributor

thypon commented May 2, 2023

I created a quick PR to not remain stuck forever on the error and exit eagerly

#120

@thypon
Copy link
Contributor

thypon commented May 2, 2023

Screenshot 2023-05-02 at 10 24 59

I have the suspect that d2d socket connection is not supported on 14xx firmwares.
Attached a successful send_image command picture.

@TB-dotcom
Copy link

I've had the same issue with a hang-up on uploading an image, and it failed both using xchwarze's as well as thypon's forks. However, it did work fine with the fork I took from https://github.com/NickWaterton/samsung-tv-ws-api. My Frame's FW version is 1640.9.

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

7 participants