-
Notifications
You must be signed in to change notification settings - Fork 189
QSeries #114
Comments
Show what you have tried and which errors you get! |
I've just tried the using samsungctl on a Q series: If I do:
Then the TV pops up with a "Give smart device access prompt", if how ever I run samsungctl as below, no popup shows.
Returns
|
This is basically the same things I have tried except I used Chrome web socket tool to send the commands. Get the same result however. It allows me to authorize but then all commands return: |
So I actually got something working, but without using samsungctl. First off the remote control endpoint is only availiable on using secure websocket. Secondly it needs |
using ws client I get an initial response of: 06:48:15 -> (json) { but no commands i send after this seem to work. always get unauthorized. |
@jbro - when exactly do you get that 8 digit number? What do you do to get that token? |
If you connect to the remote control endpoint on secure websocket like:
Then a little dialog pops up on the tv, that asks you if you want to allow the device, after pressing allow some json like below is returned containing the token:
|
Thank you.
I will try this again today.
After getting the token and I am connected to the display can you please verify the format of the commands sent. I believe they are sent in a json format but want to confirm. Can you provide a sample of how the command is sent.
Thank you.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Jesper Brix Rosenkilde <[email protected]>
Sent: Thursday, August 29, 2019 10:16:05 AM
To: Ape/samsungctl <[email protected]>
Cc: Cmac2016 <[email protected]>; Author <[email protected]>
Subject: Re: [Ape/samsungctl] QSeries (#114)
If you connect to the remote control endpoint on secure websocket like:
$ wscat -n --connect wss://192.168.0.10:8002/api/v2/channels/samsung.remote.control
Then a little dialog pops up on the tv, that asks you if you want to allow the device, after pressing allow some json like below is returned containing the token:
connected (press CTRL+C to quit)
< {"data":{"clients":[{"attributes":{"name":null},"connectTime":1567087962961,"deviceName":"Smart Device","id":"c8f69ec8-8379-4a29-8c80-43446c0a2c7","isHost":false}],"id":"c8f69ec8-8379-4a29-8c80-43446c0a2c7","token":"16131682"},"event":"ms.channel.connect"}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FApe%2Fsamsungctl%2Fissues%2F114%3Femail_source%3Dnotifications%26email_token%3DAGA5EGTHY4H2KC4YRIA5PATQG7K2LA5CNFSM4HQL6ZS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OUDVQ%23issuecomment-526205398&data=02%7C01%7C%7Cd4862d39c8804e36201508d72c8b6ec6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026849672283214&sdata=PGsQgd%2BB5Irqb8kw2U4Ucjp7ynLYNTXSTK90%2Bted%2Bn8%3D&reserved=0>, or mute the thread<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGA5EGT6T6HO744ADTOLJRDQG7K2LANCNFSM4HQL6ZSQ&data=02%7C01%7C%7Cd4862d39c8804e36201508d72c8b6ec6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026849672283214&sdata=H%2BAI0q5gStA2DxjqwW%2B2siAK6o5gXycl6INydnEeXNY%3D&reserved=0>.
|
This is what I'm using, it's not pretty but it works:
|
Thank you.
I will try this with ws client tonight then try to get the code working.
So basically
1. Connect and get token.
2. Then disconnect
3. Connect with name and token
4. Then should be able to send the command json strings.
Does this sound correct?
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Jesper Brix Rosenkilde <[email protected]>
Sent: Thursday, August 29, 2019 10:21:57 AM
To: Ape/samsungctl <[email protected]>
Cc: Cmac2016 <[email protected]>; Author <[email protected]>
Subject: Re: [Ape/samsungctl] QSeries (#114)
This is what I'm using, it's not pretty but it works:
#!/usr/bin/env python3
import websocket
import ssl
import sys
import os
tv_ip = '192.168.0.10'
if sys.argv[1] == 'on':
if os.system("ping -c 1 " + tv_ip) is 0:
ws = websocket.create_connection('wss://192.168.0.10:8002/api/v2/channels/samsung.remote.control?name=anVtYm90cm9u&token=12368079', sslopt={"cert_reqs": ssl.CERT_NONE})
ws.send('{"method":"ms.remote.control","params":{"Cmd":"Click","DataOfCmd":"KEY_POWER","Option":false,"TypeOfRemote":"SendRemoteKey"}}"')
ws.send('{"method":"ms.remote.control","params":{"Cmd":"Click","DataOfCmd":"KEY_HDMI","Option":false,"TypeOfRemote":"SendRemoteKey"}}"')
else:
os.system('sudo etherwake -i enp4s0 c0:48:e6:19:4e:4e')
if sys.argv[1] == 'off':
ws = websocket.create_connection('wss://192.168.0.10:8002/api/v2/channels/samsung.remote.control?name=anVtYm90cm9u&token=12368079', sslopt={"cert_reqs": ssl.CERT_NONE})
ws.send('{"method":"ms.remote.control","params":{"Cmd":"Click","DataOfCmd":"KEY_POWER","Option":false,"TypeOfRemote":"SendRemoteKey"}}"')
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FApe%2Fsamsungctl%2Fissues%2F114%3Femail_source%3Dnotifications%26email_token%3DAGA5EGVGAXNEQZZSYD3YYUDQG7LQLA5CNFSM4HQL6ZS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OU2BA%23issuecomment-526208260&data=02%7C01%7C%7Cb52f2671a0f8477e6af708d72c8c40ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026853195677448&sdata=H90iEXwLF8qllsUF3OLmQRmzVq3XuqRQOF%2BDLArkh5A%3D&reserved=0>, or mute the thread<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGA5EGV4DRH7JNF4JD24QJLQG7LQLANCNFSM4HQL6ZSQ&data=02%7C01%7C%7Cb52f2671a0f8477e6af708d72c8c40ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637026853195687460&sdata=BJ8nSpXQLvnLAIUDpuHiCAuGNUAeFO07GvCpYUBc9jg%3D&reserved=0>.
|
Sounds very reasonable, maybe you should use the name when getting the token, I don't know if it is a pair. |
No problem, let me know when you have it in master, then I'll test it out :) |
any time I try wss// it will not connect. here are my results....sadly still no success 21:41:12 Connecting to "ws://10.0.0.244:8001/api/v2/channels/ms.remote.control?name="ChrisRemote"" 21:41:12 Successfull connected to "ws://10.0.0.244:8001/api/v2/channels/ms.remote.control?name="ChrisRemote"" 21:41:12 -> (json) { { { if I format the request using samsung.remote.control: 21:46:41 Connecting to "ws://10.0.0.244:8001/api/v2/channels/samsung.remote.control" 21:46:41 Successfull connected to "ws://10.0.0.244:8001/api/v2/channels/samsung.remote.control" 21:46:41 -> (json) { 21:46:41 Error: (1006) |
Oh yeah forgot to mention wss runs on port 8002, see my code above. |
I tried wss on port 8002. Result: 06:15:09 Connecting to "wss://10.0.0.244:8002/api/v2/channels/samsung.remote.control" 06:15:09 Connection to "wss://10.0.0.244:8002/api/v2/channels/samsung.remote.control" closed 06:15:09 Error: (1006) Seems my display actively refuses a connection on that port. |
I don't know if this is after a certain version of either the TV or firmware. My TV is a Q7 I think running the newest firmware as of last week. |
I have a Q8, and would like get this working on mine. There is the I've been trying this on my linux machine to get it to work, I'm currently using your master branch. Any other suggestion let me know. |
HI, So, i have a UE43RU7400UXXU. Which is officially a series 7 TV. My API version is 2.0.25. Now, the below code seems to work. To get a token:
` After that, the following code will work to do 'volume down'
For me, this works. I'm not sure how long this token lasts. I tend to power down the TV every night, not sure if it forgets the code. THe token i got last week didn't work. |
cyclops1982, I was all excited to try this out, until I realized this wasn't python. Darn. I'll see if I can convert it to python and get it to work. |
My display refuses any connection on port 8002.
Can connect to port 8001 but no command seems to work using WS client.
I connect but any time a connection is successful I get:
21:14:06 Connecting to "ws://10.0.0.80:8001/api/v2/channels/ms.remote.control"
21:14:06 Successfull connected to "ws://10.0.0.80:8001/api/v2/channels/ms.remote.control"
21:14:06 -> (json)
{
"data": {
"clients": [
{
"attributes": {
"name": null
},
"connectTime": 1567991805347,
"deviceName": "Smart Device",
"id": "2d7bc5e3-782d-4f94-bbb-32322b828c9d",
"isHost": false
}
],
"id": "2d7bc5e3-782d-4f94-bbb-32322b828c9d"
},
"event": "ms.channel.connect"
}
This is the most I have ever been able to get from the display.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: Chris M
Sent: Sunday, September 8, 2019 8:36:27 PM
To: Ape/samsungctl <[email protected]>; Ape/samsungctl <[email protected]>
Cc: Author <[email protected]>
Subject: Re: [Ape/samsungctl] QSeries (#114)
I will try to convert to C# for my application. Seems very straight forward. I will try it first in a ws client and see if it connects and get a token. Will keep everyone posted.
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Brissey <[email protected]>
Sent: Sunday, September 8, 2019 12:01:37 PM
To: Ape/samsungctl <[email protected]>
Cc: Cmac2016 <[email protected]>; Author <[email protected]>
Subject: Re: [Ape/samsungctl] QSeries (#114)
cyclops1982,
I was all excited to try this out, until I realized this wasn't python. Darn.
What language is this? Go?
I'll see if I can convert it to python and get it to work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FApe%2Fsamsungctl%2Fissues%2F114%3Femail_source%3Dnotifications%26email_token%3DAGA5EGSFEDGESAQYHPYLG5LQIUOWDA5CNFSM4HQL6ZS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FTG2Q%23issuecomment-529216362&data=02%7C01%7C%7C1c0f5bd555b14782785608d73475d49e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637035552985279565&sdata=x867fdMQQvdBdPSpwEsoW1DebsT1jknqIud6CDRmGb8%3D&reserved=0>, or mute the thread<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGA5EGTEWW26AX3B66IHZVLQIUOWDANCNFSM4HQL6ZSQ&data=02%7C01%7C%7C1c0f5bd555b14782785608d73475d49e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637035552985289576&sdata=W97rMP%2FkU%2BHG%2FHC%2BkGPgiSE0Ib6GilSP7qgT7fqW5Wc%3D&reserved=0>.
|
Cyclops1982, et.al., Based on your code I cobbled together a python 3.X web-client to see if I could get a token back from my Samsung Q8FN I can now get my TV to display the pop-up to give permission for my device to be connected. response: I still have a few issues, when I go to the external device list (on the TV) for devices that have been allowed to connect. The entry which should have the name of the device shows [Invalid UTF-8] I also noticed, in my case at least, the TV must be TV source (i.e. not in app like YouTube or Netflix for the pop-up to occur. I also had my AVR off as well (may not be necessary) If you run this code more than once be sure to delete the device from the Samsung's TV External Device List! Otherwise you'll probably get some sort of connection refused error. here is the python code: import base64 appname = 'SamsungTvRemote2' def on_message(ws, message): def on_error(ws, error): def on_close(ws): def on_open(ws): if name == "main":
Hope this help others, and maybe someone can tell me why I get Invalid UTF-8 for a device in the TV external device list |
For some reason all the indenting for the python got removed in the post. |
I'm not exactly sure except when I tried connected to 8002 it always refused connection until I specified the websocket not use use SSL Certificate. e.g. sslopt={"cert_reqs": ssl.CERT_NONE}. |
Here's a example python that sends the KEY_MENU to the TV I know, the indentation are all gone. Somebody tell how to get them to stay. python 3.X code ``# -- coding: utf-8 -- def sendCmd(ws,keycmd): if name == "main": |
@gbrissey The appname that you use, needs to be a base64 encoded string. That's why it's complaining about the UTF-8 issue. Once you have the token, does it stay the same? I've noticed that i can send a few commands but then it just responds with No Authorization. I've also noticed that turning off the TV and then ON again seems to 'forget' the previous code. Ideally - i'd like to just get one code once. I wonder if it has to do with the fact that we use a websocket and/or not close it properly, or something like that? About the code formatting: https://help.github.com/en/articles/creating-and-highlighting-code-blocks |
@cyclops1982 strange you ask about a POST/GET interface |
@cyclops1982 |
There was a ton of work on fork of this repo that addressed the websocket logic you guys are working thru. I think you should try out the develop branch here https://github.com/kdschlosser/samsungctl/tree/develop |
@raydog153 I've tried this repo and both the develop and master branch. Have you been successful with this samsungvtl ? |
Sad to say I have one of those 2014 TVs that are next to impossible to get working if firmware was updated. I do not have port 8001/8002 enabled at all, only very few ports open. I do have port 8080 so some of the UPNP stuff I can get to work, change volume, WOL. My model number is UN40H5203. I was helping to debug it for a while, then life happened and I gave up for the moment. Need to be careful depending on which python version you run. The repo owner was quite active, put a ton of work into it, and would be the best starting point. Could also look at the closed/open issues for help in understanding the logic too... |
Just an update:
Have tested and verified the following commands on my Q6 Series.
Still adding to the list:
KEY_MENU
KEY_HOME
KEY_VOLUP
KEY_VOLDOWN
KEY_MUTE
KEY_POWER
KEY_GUIDE
KEY_CHUP
KEY_CHDOWN
KEY_CH_LIST
KEY_PRECH
KEY_LEFT
KEY_RIGHT
KEY_UP
KEY_DOWN
KEY_ENTER
KEY_RETURN
KEY_TOOLS
KEY_1
KEY_2
KEY_3
KEY_4
KEY_5
KEY_6
KEY_7
KEY_8
KEY_9
KEY_0
Do you know if there are any commands for launching the apps?
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: raydog153 <[email protected]>
Sent: Wednesday, September 11, 2019 11:55:08 PM
To: Ape/samsungctl <[email protected]>
Cc: Cmac2016 <[email protected]>; Author <[email protected]>
Subject: Re: [Ape/samsungctl] QSeries (#114)
Sad to say I have one of those 2014 TVs that are next to impossible to get working if firmware was updated. I do not have port 8001/8002 enabled at all, only very few ports open. I do have port 8080 so some of the UPNP stuff I can get to work, change volume, WOL. My model number is UN40H5203.
I was helping to debug it for a while, then life happened and I gave up for the moment. Need to be careful depending on which python version you run. The repo owner was quite active, put a ton of work into it, and would be the best starting point. Could also look at the closed/open issues for help in understanding the logic too...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FApe%2Fsamsungctl%2Fissues%2F114%3Femail_source%3Dnotifications%26email_token%3DAGA5EGQE2F5WBXBAZ4V3HWDQJG4RZA5CNFSM4HQL6ZS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6QSECY%23issuecomment-530653707&data=02%7C01%7C%7C24046c8280034283280108d73735012b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038573093439933&sdata=63ypGL1j23i86WKmD%2F0mBf1qqJgk5%2FSc2j%2B8R9jYRzY%3D&reserved=0>, or mute the thread<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGA5EGVDCLC737NA3WZB2SLQJG4RZANCNFSM4HQL6ZSQ&data=02%7C01%7C%7C24046c8280034283280108d73735012b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637038573093439933&sdata=6wDnts81mtUTdbDXJPaRSsNi4tFbfPAvMmFuIR6Ndik%3D&reserved=0>.
|
@raydog153 My biggest issue is is obtaining a token that will last between sessions (power down then up of the TV) I can get a token but it only lasts the one session. |
@Cmac2016 |
I've solved the token not lasting between power cycles of the TV. |
@gbrissey try https://github.com/xchwarze/samsung-tv-ws-api |
@xchwarze Hey thanks for posting back to me. I definitely will check out your api and component |
Thanks @gbrissey, @Cmac2016 and @jbro for the discussion! I used bits of your code above with the token and ssl setting to get it to work on my NU7120 using port 8002. Oddly enough I never get pop-ups on the TV screen or any changes to the list of external devices. I'm a little bit disappointed that this WebSocket only enables you to emulate the buttons that already exist on the IR remote (and the SmartThings app) - what I really want is to have a QWERTY keyboard to speed up searching for programmes in Netflix etc. Can anybody point me in the direction of a repo that does that? Lastly, a noob question: why are a lot of people hiding the TV's IP address in their posts? Is it really a security risk stating it explicitly? Thanks! |
I'm not a security expert but I don't think publishing the internal IP addresses is a security risk. I'd say that if someone enters your network, discovering the IP addresses will be easy. However, when I send logs, I edit/hide my IP addresses :) Probably to do like all the people or not to show how am I configuring my network. That statement does not change what I said before but just reveals how stupid I am. |
I tried to control Samsung The Frame 75'' QLED 4K with
I had authorized my Linux desktop before that, so I recieved the answer:
However, when I try to send control commands, I get the response
After googling, I found another possible method to send (
The TV doesn't send any response to this (and nothing happens on the TV), but apprantly it knows the method So my problem seems to be not authorization, but new method names. I failed to find them in Samsung API docs. Is it possible to ask the TV to list all avaialble methods? |
Ok, got it working, following jbro's comments (using manual secure websocket connection, not via |
@Galicarnax I got response from TV (QE65Q70RATXXH) for {
"data": {
"data": [
{
"appId": "111299001912",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/111299001912/250x250.png",
"is_lock": 0,
"name": "YouTube"
},
{
"appId": "org.tizen.browser",
"app_type": 4,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/webbrowser/250x250.png",
"is_lock": 0,
"name": "Internet"
},
{
"appId": "11101200001",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/11101200001/250x250.png",
"is_lock": 0,
"name": "Netflix"
},
{
"appId": "3201710015016",
"app_type": 1,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201710015016/250x250.png",
"is_lock": 0,
"name": "SmartThings"
},
{
"appId": "3201511006428",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201511006428/250x250.png",
"is_lock": 0,
"name": "Rakuten TV"
},
{
"appId": "3201512006785",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201512006785/250x250.png",
"is_lock": 0,
"name": "Prime Video"
},
{
"appId": "121299000101",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/121299000101/250x250.png",
"is_lock": 0,
"name": "TuneIn"
},
{
"appId": "3201803015852",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201803015852/250x250.png",
"is_lock": 0,
"name": "Flying Fish 2"
},
{
"appId": "org.tizen.example.STVOpenTKApp1",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/org.tizen.example.STVOpenTKApp1/250x250.png",
"is_lock": 0,
"name": "STVOpenTKApp1"
},
{
"appId": "3201710015037",
"app_type": 1,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201710015037/250x250.png",
"is_lock": 0,
"name": "Gallery"
},
{
"appId": "20192100002",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/20192100002/250x250.png",
"is_lock": 0,
"name": "e-Manual"
},
{
"appId": "3201601007250",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201601007250/250x250.png",
"is_lock": 0,
"name": "Google Play Movies"
},
{
"appId": "3201909019271",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201909019271/250x250.png",
"is_lock": 0,
"name": "PrivacyChoices"
}
]
},
"event": "ed.installedApp.get",
"from": "host"
}
|
Yes, thanks, I was misguided by TV not responding with any output (which in Linux world stands for "OK" by default :) ) |
Sending As for getting running app, maybe <?xml version="1.0" encoding="UTF-8"?>
<service xmlns="urn:dial-multiscreen-org:schemas:dial" dialVer="2.1" xmlns:atom="http://www.w3.org/2005/Atom">
<name>YouTube</name>
<options allowStop="true"/>
<state>running</state>
<version>2.1.493</version>
<link rel="run" href="run"/>
<additionalData>
<testYWRkaXR>REDACTED</testYWRkaXR>
<screenId>REDACTED</screenId>
<theme>cl</theme>
<deviceId>REDACTED</deviceId>
<loungeToken>REDACTED</loungeToken>
<loungeTokenRefreshIntervalMs>1500000</loungeTokenRefreshIntervalMs>
</additionalData>
</service> I saw somewhere alternative way to get this data. POST request to same route will open the app.
EDIT: More on activating apps:
https://community.smartthings.com/t/samsung-smart-tv-control-with-smartthings-webcore/166506/12 |
|
@Galicarnax Did you try I see HA integration has support for Art status: https://github.com/ollo69/ha-samsungtv-smart/blob/master/custom_components/samsungtv_smart/api/samsungws.py#L524
and sending status request msg_data = {
"request": "get_artmode_status",
"id": gen_uuid(),
}
self._ws_send(
{
"method": "ms.channel.emit",
"params": {
"data": json.dumps(msg_data),
"to": "host",
"event": "art_app_request",
},
}, |
TV doesn't reply anything to this. I do it from CLI using
No answer, no error, nothing. |
this piece of code working fine but problem is that i need to re-authenticate the tv after TV POWER OFF.why this is happen again |
After reading through everything, I'm now able to get a token and connect with that. But when I send methods, I don't get any response back. I tried the following:
The first ws.recv() gives me but the second one doesn't return ever. Likewise, when I try to send keys, I don't get anything back, either. Can anyone think of a problem with this? |
HI! |
I have the exact same issue with my UE60J6289. const ws = new WebSocket(`ws://192.168.2.100:8001/api/v2/channels/samsung.remote.control?name="T3BlbkhhdXM="`, {
rejectUnauthorized: false
});
console.log("Connect to:", ws.url)
ws.on("open", () => {
console.log("Connected to", ws.url);
});
ws.on("message", (msg) => {
let json = JSON.parse(msg);
console.log("message", json);
if (json.event === "ms.channel.connect") {
console.log("connect event received", json.data.clients);
setTimeout(() => {
let obj = {
"method": "ms.remote.control",
"params": {
"Cmd": "Click",
"DataOfCmd": "KEY_MUTE",
"Option": "false",
"TypeOfRemote": "SendRemoteKey"
}
};
console.log("Send key", obj.params.Cmd);
ws.send(JSON.stringify(obj));
}, 3000);
}
}); The example above is very simple and straight forward. |
I found out why some tvs work and some not. Its the paring dialog. I sniffed the smart view app traffic and was able to capture the handshake, and while researching for the crypto stuff, i found the pair.go file where the paring/handshake is done. I hope i find in the near future time to port it to node.js and document it. |
Do you have the option to get a list of TV apps using the 'ed.installedApp.get' command? |
Has anyone done it with kotlin or java? |
Will this code work on a 2018 Q series?
I have been trying to get this code to run and cannot get thru all the errors that are happening for me.
The text was updated successfully, but these errors were encountered: