kdschlosser / samsungctl

Remote control Samsung televisions via a TCP/IP connection
MIT License
148 stars 34 forks source link

Can't Autodetect 2017 on 1262 #104

Open joeljacobs opened 5 years ago

joeljacobs commented 5 years ago

I have been using an older version of samsungctl for a long time with my tv, but it stopped working (likely with a software update.)

I have downloaded your latest master and develop branches and both of them give the same error when I use:

samsungctl --host 10.1.20.9 KEY_VOLDOWN

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/samsungctl-0.8.0b0-py3.5.egg/samsungctl/remote_legacy.py", line 76, in open
    self.sock.connect((self.config.host, self.config.port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/samsungctl", line 11, in <module>
    load_entry_point('samsungctl==0.8.0b0', 'console_scripts', 'samsungctl')()
  File "/usr/local/lib/python3.5/dist-packages/samsungctl-0.8.0b0-py3.5.egg/samsungctl/__main__.py", line 355, in main
    with Remote(config) as remote:
  File "/usr/local/lib/python3.5/dist-packages/samsungctl-0.8.0b0-py3.5.egg/samsungctl/remote.py", line 67, in __enter__
    self.open()
  File "/usr/local/lib/python3.5/dist-packages/samsungctl-0.8.0b0-py3.5.egg/samsungctl/utils.py", line 24, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/samsungctl-0.8.0b0-py3.5.egg/samsungctl/remote_legacy.py", line 79, in open
    raise RuntimeError('Unable to pair with TV.. Is the TV on?!?')
RuntimeError: Unable to pair with TV.. Is the TV on?!?

I have tried with a freshly-installed version on a raspberry pi, and on my mac with the same result.

I can ping the TV, and I can telnet to port 8002 and 8001. I can also run an arp command and get back the proper mac address.

I have also tried my old configuration:

config = {
    "name": "samsungctl",
    "description": "PC",
    "id": "",
    "host": "10.1.20.9",
    "port": "8002",
    "method": "websocket",
    "timeout": 30,
}

Which just hangs forever. If I use the command-line and add --method websocket it also hangs forever.

TV: Model: UN43MU6290 SW: 1262 Year: 2017

sstreng commented 5 years ago

I can confirm this. I have exactly the same issue with 2 TVs (UE40NU7199 and UE40MU6470), both with Firmware 1262.

kdschlosser commented 5 years ago

This issue I have solved. I am still updating the library. When I am on I will update the code here. I have a grip of people some of which have 3-4 Samsung TV's I wrote a test program that goes through and tests each of the available functions. There is a decent variety of models, and years that the test program is being run on.

But as an update anyway. This is what is going on.

Fixed python 2 compatibility with the legacy connection Fixed connection type detecting Fixed several UPNP issues Fixed endless loop problem in UPNP Added full discovery. no need to set a static IP address on the TV. and also no need to specify the IP of the TV to have the library connect. Added automatic reconnect of the library when the TV gets powered on. Added WOL for legacy TV's I did this because the 2013 models have an almost identical UPNP structure to the 2014's I think that 2013 may be able to be turned on using WOL. don't know if it would work because it was never added. so now it is and it can be tested.

Things to do. Fix incorrect power state being reported. Add automatic discovery to command line. Add channel support to UPNP Bonus. Finish cross platform GUI control

image

AyL31 commented 5 years ago

I have the same issues for my UE65MU8005 TV. I dowloaded the latest library from https://github.com/kdschlosser/samsungctl.git ; and have the following errors (my TV was turned on during this)

samsungctl --host 192.168.0.191 --volume 20 Traceback (most recent call last): File "/usr/local/bin/samsungctl", line 11, in load_entry_point('samsungctl==0.8.0b0', 'console_scripts', 'samsungctl')() File "/usr/local/lib/python2.7/dist-packages/samsungctl-0.8.0b0-py2.7.egg/samsungctl/main.py", line 355, in main with Remote(config) as remote: File "/usr/local/lib/python2.7/dist-packages/samsungctl-0.8.0b0-py2.7.egg/samsungctl/remote.py", line 67, in enter self.open() File "/usr/local/lib/python2.7/dist-packages/samsungctl-0.8.0b0-py2.7.egg/samsungctl/utils.py", line 24, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/samsungctl-0.8.0b0-py2.7.egg/samsungctl/remote_legacy.py", line 79, in open raise RuntimeError('Unable to pair with TV.. Is the TV on?!?') RuntimeError: Unable to pair with TV.. Is the TV on?!?

Thanks, Aymeric