Ape / samsungctl

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

Support Samsung M5500 series #81

Open polcape opened 6 years ago

polcape commented 6 years ago

Hi,

when I try to connect to a TV of M5500 series I get this error:

`samsungctl -i --host 192.168.1.64 --method websocket

  File "/usr/local/bin/samsungctl", line 11, in <module>
    load_entry_point('samsungctl==0.7.1', 'console_scripts', 'samsungctl')()
  File "/usr/local/lib/python3.6/site-packages/samsungctl/__main__.py", line 110, in main
    with Remote(config) as remote:
  File "/usr/local/lib/python3.6/site-packages/samsungctl/remote.py", line 11, in __init__
    self.remote = RemoteWebsocket(config)
  File "/usr/local/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 30, in __init__
    self._read_response()
  File "/usr/local/lib/python3.6/site-packages/samsungctl/remote_websocket.py", line 67, in _read_response
    response = self.connection.recv()
  File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 298, in recv
    opcode, data = self.recv_data()
  File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 315, in recv_data
    opcode, frame = self.recv_data_frame(control_frame)
  File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 328, in recv_data_frame
    frame = self.recv_frame()
  File "/usr/local/lib/python3.6/site-packages/websocket/_core.py", line 360, in recv_frame
    return self.frame_buffer.recv_frame()
  File "/usr/local/lib/python3.6/site-packages/websocket/_abnf.py", line 334, in recv_frame
    frame.validate(self.skip_utf8_validation)
  File "/usr/local/lib/python3.6/site-packages/websocket/_abnf.py", line 149, in validate
    raise WebSocketProtocolException("Invalid close opcode.")
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

Can you help me to understand if I wrong something? Or is the TV not compatible

Thanks

ghost commented 6 years ago

you should try using port 8001

polcape commented 6 years ago

Yes, I try with port 8001 (--port 8001), and I get the same output.

ghost commented 6 years ago

Have you change permission for allowing samsungctl on this TV ? because i can using samsungctl with UA55M5500

polcape commented 6 years ago

Please, can you tell me how change permission? In the menu I found anything....

ghost commented 6 years ago

go to menu -> general -> External Device Manager -> Device Connection Manager -> Device List, and find samsungctl, set to Allow

polcape commented 6 years ago

I have already see this section, but there isn't listed samsungctl (there is my phone and other peripherals that i know). In my opinion samsungctl can't inizialize connection...and it's no listed here.

ghost commented 6 years ago

Here is my program

import samsungctl
import time

from goto import with_goto

config = {
        "name": "samsungctl",
        "description": "PC",
        "id": "",
        "host": "192.168.71.107",
        "port": 8001,
        "method": "websocket",
        "timeout": 0,
}

@with_goto
def utama():
        while True:
                label .awal
                data = raw_input("Masukkan huruf : ")
                if data == "power":
                        samsungctl.Remote(config).control("KEY_POWER")
                elif data == "up":
                        samsungctl.Remote(config).control("KEY_UP")
                elif data == "down":
                        samsungctl.Remote(config).control("KEY_DOWN")
                elif data == "left":
                        samsungctl.Remote(config).control("KEY_LEFT")
                elif data == "right":
                        samsungctl.Remote(config).control("KEY_RIGHT")
                elif data == "chup":
                        samsungctl.Remote(config).control("KEY_CHUP")
                elif data == "chdown":
                        samsungctl.Remote(config).control("KEY_CHDOWN")
                elif data == "enter":
                        samsungctl.Remote(config).control("KEY_ENTER")
                elif data == "return":
                        samsungctl.Remote(config).control("KEY_RETURN")
                elif data == "chlist":
                        samsungctl.Remote(config).control("KEY_CHLIST")
                elif data == "menu":
                        samsungctl.Remote(config).control("KEY_MENU")
                elif data == "source":
                        samsungctl.Remote(config).control("KEY_SOURCE")
                elif data == "guide":
                        samsungctl.Remote(config).control("KEY_GUIDE")
                elif data == "tools":
                        samsungctl.Remote(config).control("KEY_TOOLS")
                elif data == "info":
                        samsungctl.Remote(config).control("KEY_INFO")
                elif data == "red":
                        samsungctl.Remote(config).control("KEY_RED")
                elif data == "green":
                        samsungctl.Remote(config).control("KEY_GREEN")
                elif data == "yellow":
                        samsungctl.Remote(config).control("KEY_YELLOW")
                elif data == "blue":
                        samsungctl.Remote(config).control("KEY_BLUE")
                elif data == "pannelchdown":
                        samsungctl.Remote(config).control("KEY_PANNEL_CHDOWN")
                elif data == "volup":
                        samsungctl.Remote(config).control("KEY_VOLUP")
                elif data == "voldwon":
                        samsungctl.Remote(config).control("KEY_VOLDOWN")
                elif data == "mute":
                        samsungctl.Remote(config).control("KEY_MUTE")
                elif data == "0":
                        samsungctl.Remote(config).control("KEY_0")
                elif data == "1":
                        samsungctl.Remote(config).control("KEY_1")
                elif data == "2":
                        samsungctl.Remote(config).control("KEY_2")
                elif data == "3":
                        samsungctl.Remote(config).control("KEY_3")
                elif data == "4":
                        samsungctl.Remote(config).control("KEY_4")
                elif data == "5":
                        samsungctl.Remote(config).control("KEY_5")
                elif data == "6":
                        samsungctl.Remote(config).control("KEY_6")
                elif data == "7":
                        samsungctl.Remote(config).control("KEY_7")
                elif data == "8":
                        samsungctl.Remote(config).control("KEY_8")
                elif data == "9":
                        samsungctl.Remote(config).control("KEY_9")
                elif data == "dtv":
                        samsungctl.Remote(config).control("KEY_DTV")
               elif data == "hdmi":
                        samsungctl.Remote(config).control("KEY_HDMI")
                elif data == "contents":
                        samsungctl.Remote(config).control("KEY_CONTENTS")
                else :
                        goto .awal

utama()
polcape commented 6 years ago

Same exception raise also with your program

ghost commented 6 years ago

have you done to scan using nmap ? what port that listed after scan ?

nmap ipaddress

polcape commented 6 years ago

These:

Discovered open port 8080/tcp on 192.168.1.55 Discovered open port 7676/tcp on 192.168.1.55 Discovered open port 32768/tcp on 192.168.1.55 Discovered open port 8002/tcp on 192.168.1.55 Discovered open port 9999/tcp on 192.168.1.55 Discovered open port 32771/tcp on 192.168.1.55 Discovered open port 8001/tcp on 192.168.1.55 Discovered open port 32770/tcp on 192.168.1.55 Discovered open port 32769/tcp on 192.168.1.55

daduke commented 6 years ago

I have the same issue with a UE50MU6170

crissmil commented 5 years ago

same issue M5512

johey commented 5 years ago

I have the same issue with a UE65MU7005. I see no samsungctl on the list of available devices in the Device List. This previously used to work, but suddenly stopped. Perhaps after a firmware update?

rogaha commented 5 years ago

same issue with UN50MU6070. It's definitely related to a firmware update.

rogaha commented 5 years ago

this fork fixes the issue: https://github.com/kdschlosser/samsungctl/commits/master