Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Some TV models are not working #22

Open
Random-Stack-Random-Day opened this issue Jan 1, 2017 · 259 comments
Open

Some TV models are not working #22

Random-Stack-Random-Day opened this issue Jan 1, 2017 · 259 comments
Labels

Comments

@Random-Stack-Random-Day
Copy link

Random-Stack-Random-Day commented Jan 1, 2017

Edited by @Ape:
I hijacked this issue to collect all instances where some random TV model does not work, but we don't know what is the cause or how it could be fixed. Some TV models might not simply support TCP/IP control at all, and some models may require a whole new protocol. When you have techinical details about a specific case that could be fixed please open a new issue.


Original message:
I'm wondering if anyone can confirm if this works for their JS9000 or H5203? Getting 'Connection refused' from the 9000 and no response from the 5203.

@davorf
Copy link

davorf commented Jan 18, 2017

Hello!

I have H series TV too (H6500) and it doesn't work for me. No error message is shown and nothing is displayed on the TV.

Best regards,
Davor

@Ape Ape added the question label Mar 11, 2017
@jessiewestlake
Copy link

Have you tried using the --method websocket parameter?

@ProZsolt
Copy link

ProZsolt commented Apr 10, 2017

Sadly H and J series TVs are using websockets, but a different protocol.

@riemers
Copy link

riemers commented Apr 27, 2017

Newer models need to authorize the device first no? Do we have the new protocol, sounds like someone normally does :)

https://github.com/timelery/Samsung-RemoteControl

Although .net, i tried it and it can control my t.v. perhaps you can look at the code?

@Ape
Copy link
Owner

Ape commented Apr 28, 2017

@riemers Which TV models did you test? I would be happy to merge new protocol support to samsungctl.

@riemers
Copy link

riemers commented Apr 28, 2017

My tv is a UE55HU7500 above .net repo did seem to work with my t.v. i tried all combo's with your library but i never got a pincode. Perhaps yours has the 'authorize' only button and the pincode is newer? Just speculation here. But ofcourse, more then happy to help with testing on this particular model.

@phd1963
Copy link

phd1963 commented May 30, 2017

Hello,

@riemers Thanks a lot for the link for remote control app! It works for my UE50H6400 model. However I need some more commands like the source changing (HDMI1, HDMI2...). Did you succeed to send such commands to your TV ?
@Ape I confirm that unfortunately your app doesn't work with my TV, with any parameter (port, protocol). If I can support in any way, feel free to contact me.

Friendly

Philippe

@jonny190
Copy link

Is there any progress on this?
Browsing to my TV http://192.168.5.91:8001/api/v2/ outputs :
{
"id": "09896801-00a0-1000-b47c-fc8f9080e621",
"name": "[TV]Samsung LED40",
"version": "2.0.24",
"device": {
"type": "Samsung SmartTV",
"duid": "09896801-00a0-1000-b47c-fc8f9080e621",
"model": "14_NT14U_2D_BT",
"modelName": "UE40HU6900",
"description": "Samsung TV RCR",
"networkType": "wired",
"ssid": "",
"ip": "192.168.5.91",
"firmwareVersion": "Unknown",
"name": "[TV]Samsung LED40",
"id": "09896801-00a0-1000-b47c-fc8f9080e621",
"udn": "09896801-00a0-1000-b47c-fc8f9080e621",
"resolution": "1920x1080",
"countryCode": "GB",
"msfVersion": "2.0.24",
"smartHubAgreement": "true",
"developerMode": "1",
"developerIP": "173.230.139.54"
},
"type": "Samsung SmartTV",
"uri": "http://192.168.5.91:8001/api/v2/"
}

@onemico
Copy link

onemico commented Sep 28, 2017

Hi,

Anyone have any updates or ideas on this, the Windows .NET works on my TV too and I am 99% sure it is due to the PIN request for authentication, so is there any method to replicate that PIN input within this application.

I don't want to have to use a Windows system to do this, when i have multiple Pis setup that should be able to.

Any assistance greatly appreciated. my model is UE55H6200

@dextorer
Copy link

dextorer commented Oct 3, 2017

I tried both protocols (legacy/websocket), but no way of communicating with my UE55JU6000. I haven't had the chance of trying the .NET library, but it would be great if support could be added!

@Ape Ape changed the title JS9000 Support Some TV models are not working Nov 2, 2017
@Ape
Copy link
Owner

Ape commented Nov 2, 2017

I'm hijacking this issue for all the cases where there is some random TV model that nobody has been able to get working.

There is no way for me to support all possible TV models. Some might not just support TCP/IP control at all, some probably use a different protocol, and there are probably some issues reported here that are just user errors and could be fixed with a correct configuration. The point is I cannot really help unless you can debug the issue to some specific cause. In that case, please open a new issue with technical details.

@riemers
Copy link

riemers commented Nov 2, 2017

I don't mind giving you more debug details, i just don't know what type or how to get the correct debug information you need. If you can give any pointers on that i would be more then happy to supply you with any information i can gather.

@lucianf
Copy link

lucianf commented Nov 2, 2017

Seconded. I have a H6670, probably in the same boat as #38 - would love to debug this further just don't know what I should be looking for. My gut feeling is that (at least in my case) the problem is that remote control needs to be PIN authenticated first, which samsungctl doesn't seem to handle.

@jonny190
Copy link

jonny190 commented Nov 3, 2017

thirded but the same i dont know how to debug this. but using openhap's implementation of Samsung remote i get pin prompt and can control the tv

@riemers
Copy link

riemers commented Nov 3, 2017

@Ape i think that most cases here is due to the pin code, if you can tell us what we need to do the be able to debug/get this to work then let us know. I can even give you ssh access to a box which has a samsun t.v. on the network if needed. (although the pin code thingy might be hard to do without actually seeing the t.v.) heck, i can even put a webcam in front of the tv if that is what it takes.

@Ape
Copy link
Owner

Ape commented Nov 3, 2017

I appreciate your offer to help. However, I'm afraid I cannot implement and maintain new features for TV models I don't have and use myself, but with your help we can get this done.

First, it would help if somebody with the hardware could capture and reverse engineer the protocol using the official remote app (if there is any). With that we can write a proof-of-concept remote software and ultimately merge the functionality to samsungctl.

@ultrara1n
Copy link

There is the Samsung Smart View App which is connecting via the local network to my UE55KU6079UXZG.

I'll capture the packets from first connection to sending keys to the tv with Wireshark and hope to find out some information about the used way of communication.

@Ape
Copy link
Owner

Ape commented Nov 4, 2017

One problem is also that there are so many different TV models out there using so many protocols. We need to somehow detect the protocols and categorize the TV models.

@riemers
Copy link

riemers commented Nov 4, 2017

We can start by asking people to report their 'nmap -T5 -F --top-ports 65535 ' so we get an indications which ports are used per models. We can then add that to the wiki here, i have a new t.v. and 2 old ones (i doubt they even work their old) but its a start.

Only need model number, people can use http://en.tab-tv.com/?page_id=7123 as reference.

Some information that might be of help https://community.smartthings.com/t/samsung-smart-tv-support/741/81 (https://github.com/timelery/Samsung-RemoteControl) see some talks about models here too imbrianj/switchBoard#55

Anyways, my nmap on UE55HU7500 (so we should just say HU7500 as model, rest is not important)

PORT     STATE    SERVICE
6000/tcp filtered X11
7011/tcp open     talon-disc
7676/tcp open     imqbrokerd
8000/tcp open     http-alt
8001/tcp open     vcom-tunnel
8080/tcp open     http-proxy
8443/tcp open     https-alt
8889/tcp open     ddi-tcp-2

@nspinelli
Copy link

nspinelli commented Nov 5, 2017

I am testing on a JS6900 and here is my nmap.

PORT     STATE SERVICE
7676/tcp open  imqbrokerd
8000/tcp open  http-alt
8001/tcp open  vcom-tunnel
8002/tcp open  teradataordbms
8080/tcp open  http-proxy
9999/tcp open  abyss

Method 1: Samsungctl
When I run samsungctl --websocket everything runs fine with no error, but no response from the TV. After looking at the response from the TV i get this error:

{"event":"ms.error","data":{"message":"unrecognized method value : ms.remote.control"}}

I tried changing the command line to just send the key command and this is the response I am getting from the TV:

{"event":"ms.error","data":{"message":"unable to handle message : Cannot set property 'clientIp' of undefined"}}

@Ape How did you determine the 'method' for sending the commands? I am wondering if it is as simple as that, but I doubt it.

Method2: Pairing
The only app that I was able to get TV commands to send to my TV was the 'myTifi' app from my iPhone. I tried sniffing the network activity and this is what I saw. (I am a noob using wireshark)

Step 1: GET - http://<TVIP>:7676/rcr/
Step 2: GET - http://<TVIP>:8080/ws/apps/CloudPINPage
Step 2 appears just to check whether or not the device is already connected to the TV, if it is it will skip to the last step.

Step 3: GET - http://<TVIP>:8080/ws/pairing?step=0&app_id=<some_app_id>&device_id=<some_device_id>&type=1

Step 3 initiates the PIN screen on the TV to pair with the device

Step 4: POST - http://<TVIP>:8080/ws/pairing?step=1&app_id=<some_app_id>&device_id=<some_device_id>

Step 4 Posting Parameters : {"auth_Data": {"auth_type": "SPC", "GeneratorServerHello": <pin_something_hash>}}

Step 5: POST - http://<ip>:8080/ws/pairing?step=2&app_id=<some_app_id>&device_id=<some_device_id>

Step 5 Posting Parameters: {"auth_Data": {"auth_type": "SPC", "request_id": <some_number>, "ServerAckMsg": <some_ack_msg>}}

Step 6: DELETE - http://<TVIP>:8080/ws/apps/CloudPINPage/run

Than finally the actual communication is done through this link:
http://<TVIP>:8000/socket.io/1/websocket/

There appears to be some token generated. This script (tested on JU6400) is a request to http://<TVIP>:8000/socket.io/1/websocket/ to get the token and I am assuming uses that to communicate, but I was unable to get this working on my TV.

Method 3: uPnP
I am thinking that we might be able to send key commands via uPnP. If I look at http://<TVIP>:7676/rcr I think that I might be able to use the controlUrl to send these commands. Looking at the XML response from that link i see that the one action is "SendKeyCode". From what I have been able to google so far is that for the control link it is expecting a SOAP response (assuming where the key command would go).

I am unfamiliar with this so currently doing more investigation. I hope this helps, and hopefully get this working soon!

@lucianf
Copy link

lucianf commented Nov 5, 2017

nmap from a H6670 (2014 version with PIN-based auth):

PORT      STATE SERVICE
7676/tcp  open  imqbrokerd
8000/tcp  open  http-alt
8001/tcp  open  vcom-tunnel
8080/tcp  open  http-proxy
8443/tcp  open  https-alt
15500/tcp open  unknown

With samsungctl==0.7.0 when I send any command (e.g. samsungctl --host tv --method websocket -v KEY_VOLDOWN) I get Error: Operation now in progress and nothing happens on the tv. With version 0.6.0 I don't get any error (it just says Sending control command) but again nothing happens on the tv.

@johntdyer
Copy link

Not sure if this helps but my JS9000 has the following ports open

💥  samsungctl  (master)  nmap -Pn -p1-65535 192.168.100.213

Starting Nmap 7.60 ( https://nmap.org ) at 2017-11-05 11:59 EST
Nmap scan report for localhost.home.local (192.168.100.213)
Host is up (0.021s latency).
Not shown: 65521 filtered ports
PORT      STATE SERVICE
7236/tcp  open  display
7237/tcp  open  pads
7676/tcp  open  imqbrokerd
7677/tcp  open  sun-user-https
7678/tcp  open  unknown
8000/tcp  open  http-alt
8001/tcp  open  vcom-tunnel
8002/tcp  open  teradataordbms
8080/tcp  open  http-proxy
8187/tcp  open  unknown
9090/tcp  open  zeus-admin
9197/tcp  open  unknown
9999/tcp  open  abyss
15500/tcp open  unknown

Results

  samsungctl  (master)  samsungctl --host 192.168.100.213 -v KEY_VOLDOWN
Error: Connection refused
  samsungctl  (master) 

@McKael
Copy link

McKael commented Sep 15, 2018

@sectroyer FWIW I've been able to use your C implementation from a Golang app (using a CGO wrapper), so thank you for your work! (I've tested the Python implementation successfully too, by the way.)

I certainly have a few questions but it would be OT here so I guess I'll create an issue in your project.

@johntdyer
Copy link

So does this mean samsunctl will get support for this model ?

@mlipovsky
Copy link

some update?

@quan3t
Copy link

quan3t commented Oct 18, 2018

also very interested on any update for j series

@asaletnik
Copy link

asaletnik commented Oct 19, 2018

Hey @eclair4151 - I tried making my UE48JU6740 work with your fork, and at first it seemed to work fine, I can pair the TV by PIN, and then control it. I even updated the samsungtv component for HomeAssistant and it worked too (after manually pairing and storing the session key/id in config).

python3 -m samsungctl --host xxx.xxx.xxx.xxx --pair
Enter TV Pin: 9658
session_key: 73B25B4XXXXXXXXXXXXXXXXD409A4
session_id: 1

My .conf file was:

{
"name": "samsungctl",
"description": "PC",
"id": "",
"host": "xxx.xxx.xxx.xxx",
"port": 8000,
"method": "pin",
"timeout": 0,
"session_key":"73B25B4XXXXXXXXXXXXXXXXD409A4",
"session_id":"1",
}

The issue now is after the TV has been turned off for a night, it simply lost the pairing so I need to do it again... Any idea if I can make it to persist?

@eclair4151
Copy link

@asaletnik Unfortunately this is a known issue with my library. I dont have access to a H or J series tv so i have no way to test anything or write a fix. My suggestion would be to check out https://github.com/sectroyer/SmartCrypto which has a better implementation

@quan3t
Copy link

quan3t commented Oct 19, 2018

@sectroyer can you provide some quick instruction on how to use your code?

@zoipod
Copy link

zoipod commented Nov 5, 2018

Hi,
I want to connect my samsung TV on Jeedom (domotic platform).
It is a Model H. exactly : UE65H6400
I paired my raspberry pi with TV, using SmartCrypto from @sectroyer (congrats :)
But I can't connect with samsungctl.
When I try :
samsungctl --host 192.168.1.33 --port 8080 --method websocket KEY_VOLDOWN
I receive this error : Handshake status 401 Unauthorized
Any idea ?

Thank a lot

@eclair4151
Copy link

@zoipod those are 2 separate libraries, they are not meant to be used together.

@zoipod
Copy link

zoipod commented Nov 5, 2018

@eclair4151 Ok.
But I can't send key with SmartCrypto. Only to pair the device ?

@McKael
Copy link

McKael commented Nov 5, 2018

@zoipod Yes

It's off-topic here (sorry) but I have released a CLI/TUI client that uses a Golang port of SmartCrypto.
It is possible to use it to send key codes from the command line so it might fit your needs.
If you want to give it a try: https://github.com/McKael/samtv

@zoipod
Copy link

zoipod commented Nov 6, 2018

@McKael Thank you for your app. Great job. It's work for me in command-line on macos.
Now I have to install on my raspberry, and use it with Jeedom.
If I have trouble, I will create an issue in your project.
Thx.

@Tony7Y
Copy link

Tony7Y commented Nov 17, 2018

Hi guys,

I am new into this and I am trying to find a way to pair my PC with a Samsung J series using Smart View.
Smart View version is 1.6.0.5 and I get the error that something went wrong.

Is it possible to pair it using the apps published above?
If yes, what exactly do I need to do?
I downloaded them but no idea where should I put or what should I run.

Thanks for help!

@Saraphie
Copy link

@McKael
I'm trying to get it running on an openHABian, but I struggle getting Golang.
Any ideas or different methods to get your client to run on openHABian?
THX

@eclair4151
Copy link

hey, i have updated smart crypto to python3 as well as added an example of how to send commands to the tv in python
https://github.com/eclair4151/SmartCrypto

@Saraphie
Copy link

Saraphie commented Nov 27, 2018

@eclair4151

so just git clone it and start smartcrypto.py with python?
Sorry for probably kinda stupid questions, but I'm just starting to get into this all.

@eclair4151
Copy link

eclair4151 commented Nov 27, 2018

yea just change the ip address in line 15. The last line in the file is

send_command(currentSessionId, ctx, 'KEY_VOLDOWN')

the ctx and currentSessionId are printed to the console as well, so when ever you want you can call this line with those values and what command to send to the tv.

@Saraphie
Copy link

I'm getting the following errors when trying to execute the script.

from: can't read /var/mail/__future__
from: can't read /var/mail/PySmartCrypto
./smartcrypto.py: line 3: import: command not found
./smartcrypto.py: line 4: import: command not found
from: can't read /var/mail/PySmartCrypto.command_encryption
./smartcrypto.py: line 6: import: command not found
./smartcrypto.py: line 7: import: command not found
./smartcrypto.py: line 8: import: command not found
./smartcrypto.py: line 12: UserId: command not found
./smartcrypto.py: line 13: AppId: command not found
./smartcrypto.py: line 14: deviceId: command not found
./smartcrypto.py: line 15: tvIP: command not found
./smartcrypto.py: line 16: tvPort: command not found
./smartcrypto.py: line 18: lastRequestId: command not found
./smartcrypto.py: line 19: syntax error near unexpected token `('
./smartcrypto.py: line 19: `def getFullUrl(urlPath):'

@eclair4151
Copy link

how are you running it? also please open an issue here and we can move the conversation there: https://github.com/eclair4151/SmartCrypto/issues

@Cmac2016
Copy link

I am trying to write a C# client app to control my display.
I have tried to intercept packets from a iPhone to the tv but have not had a lot of luck.
Can anyone provide some basics on the protocol and the encryption for sending commands to the display.
I have seen the "Allow" popup on display and my laptop does show as a device in the manager but this is where I get lost.
Any help would be great.

@aschmidt70
Copy link

@Ape, @eclair4151 here i found that someone ( @asaletnik ) use the samsungctl with --pair , but the newest version does not have this feature. I want to know if there is a version with the --pair , i would need this for my samsung tv. Any ideas?

@eclair4151
Copy link

@adeeltahir98
Copy link

rcr

I have tried connecting to tv using
http://:8001/rcr/
but I am getting a 404 in response from the tv. Also the port 7676 doesn't run. What am I doing wrong ?

@claudiosala80
Copy link

Is there anybody used with the C series (c630)?
I have only port 5600 available. From documentation I found to use legacy method, but always I got connection closed.
Any hints?

@macpacheco
Copy link

macpacheco commented May 31, 2023

I have a Samsung 4K Tizen TV with the following result from http://192.168.x.y:8001/api/v2/ :
{
"id": "uuid:XXXXXXX",
"name": "[TV] UN48JU6500",
"version": "2.0.25",
"device": {
"type": "Samsung SmartTV",
"duid": "uuid:XXXXXX",
"model": "15_HAWKM_UHD_2D",
"modelName": "UN48JU6400",
"description": "Samsung DTV RCR",
"networkType": "wired",
"ssid": "",
"ip": "192.168.x.y",
"firmwareVersion": "Unknown",
"name": "[TV] UN48JU6500",
"id": "uuid:XXXXX",
"udn": "uuid:XXXXX",
"resolution": "1920x1080",
"countryCode": "US",
"msfVersion": "2.0.25",
"smartHubAgreement": "true",
"wifiMac": "XX:XX:XX:XX:XX:XX",
"developerMode": "0",
"developerIP": "192.168.0.12"
},
"type": "Samsung SmartTV",
"uri": "http://192.168.x.y:8001/api/v2/"
}
I'm successfully using an Android App called TV Remote.
My Phone talks to my Access Point using Wifi and talks to the TV using ethernet.
My AP runs openwrt. I have tcpdump on it. I'm able to capture the whole communication into a file wireshark can read. Although the websocket session is encrypted, wireshark can decrypt on the fly since the keys are transmitted in the open.
However the protocol is strange and very unlike anything samsungctl uses.
Just thought I pass along this info in case it helps the devs or other users.
I intend to see if I can jerry rig some code that can send pass through PIN authentication and send some remote keys. If I'm successful I'll post the python code here later.
I changed all information I think should remain private to x.y or XX. (IP, MACs and uuids).

@eclair4151
Copy link

eclair4151 commented May 31, 2023

@macpacheco J series tv's cannot use samsungCTL because it does not support J or H series. \

Try this script I made specifically for the J & H series Pin and encrypted communication.

https://github.com/eclair4151/SmartCrypto

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests