klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
508 stars 98 forks source link

problem with auth command #43

Closed mmlody closed 5 years ago

mmlody commented 5 years ago

Hello

I have problem with auth command frm LGWebOsRemote, scan works OK

SCAN: /LGWebOSRemote-master$ python lgtv.py scan { "count": 1, "list": [ { "address": "10.100.188.164", "model": "UK6500MLA", "uuid": "763af48f-0d45-671c-251d-887bfe13ec95" } ], "result": "ok" }

AUTH:

/LGWebOSRemote-master$ python lgtv.py auth 10.100.188.164 Traceback (most recent call last): File "lgtv.py", line 81, in ws = LGTVClient(sys.argv[2]) File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 212, in init self.macAddress = getMacAddress(self.ip) File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 156, in getMacAddress pid = subprocess.Popen(["arp", "-n", address], stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

What file or directory is needed ?

klattimer commented 5 years ago

Install arp

apt install net-tools

or equivalent for your distro

mmlody commented 5 years ago

hello

I have installed arp / net-tools, my OS is debian 9 :

arp -V net-tools 2.10-alpha +I18N +SELINUX AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK +ECONET +ROSE -BLUETOOTH HW: (ether) +ETHER +ARC +SLIP +PPP +TUNNEL -TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT +FDDI +HIPPI +HDLC/LAPB +EUI64

mlody@debian-3:~/LGWebOSRemote-master$ apt-cache show net-tools Package: net-tools Version: 1.60+git20161116.90da8a0-1 Installed-Size: 940 Maintainer: net-tools Team pkg-net-tools-maintainers@lists.alioth.debian.org Architecture: amd64 Replaces: ja-trans (<= 0.8-2), netbase (<< 4.00) Depends: libc6 (>= 2.14), libselinux1 (>= 1.32) Conflicts: ja-trans (<= 0.8-2) Description-pl: Zestaw narzędzi sieciowych NET-3 Pakiet zawiera ważne narzędzia do sterowania podsystemem sieciowym jądra Linux. Są to: arp, ifconfig, netstat, rarp, nameif oraz route. Dodatkowo pakiet udostępnia narzędzia związane z konkretnymi rodzajami sprzętu (plipconfig, slattach, mii-tool) oraz zaawansowanymi aspektami konfiguracji IP (iptunnel, ipmaddr). . W pakiecie oryginalnym zawarte są 'hostname' i powiązane z nim programy. Nie są one instalowane przez ten pakiet, ponieważ istnieje osobny pakiet, "hostname*.deb". Description-md5: 08f345ee19e62d4fd85e960d3a061a33 Multi-Arch: foreign Homepage: http://sourceforge.net/projects/net-tools/ Tag: admin::configuring, implemented-in::c, interface::commandline, network::configuration, network::routing, network::vpn, protocol::ipv6, role::program, scope::utility, use::routing Section: net Priority: optional Filename: pool/main/n/net-tools/net-tools_1.60+git20161116.90da8a0-1_amd64.deb Size: 247502 MD5sum: 5e6ebd5eeed78e6cff447af009290061 SHA256: fa68666dde86f053aaeb6772380241801e0fc12c7d039d88930021d71bfb09fd

mlody@debian-3:~/LGWebOSRemote-master$

klattimer commented 5 years ago

With the arp command installed it should auth fine.

mmlody commented 5 years ago

hello again

this is probably debian/debian package bug with $PATH

before change:

mlody@debian-3:~/LGWebOSRemote-master$ python lgtv.py scan { "count": 1, "list": [ { "address": "10.100.188.164", "model": "UK6500MLA", "uuid": "763af48f-0d45-671c-251d-887bfe13ec95" } ], "result": "ok" } mlody@debian-3:~/LGWebOSRemote-master$ python lgtv.py auth 10.100.188.164 Traceback (most recent call last): File "lgtv.py", line 81, in ws = LGTVClient(sys.argv[2]) File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 212, in init self.macAddress = getMacAddress(self.ip) File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 156, in getMacAddress pid = subprocess.Popen(["arp", "-n", address], stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

after change $PATH:

mlody@debian-3:~/LGWebOSRemote-master$ python lgtv.py auth 10.100.188.164 Traceback (most recent call last): File "lgtv.py", line 81, in ws = LGTVClient(sys.argv[2]) File "/home/mlody/LGWebOSRemote-master/LGTV/init.py", line 217, in init super(LGTVClient, self).init('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"]) TypeError: init() got an unexpected keyword argument 'exclude_headers'

klattimer commented 5 years ago

You need to install the ws4py from the upstream. As per the pip requirements.txt file.

klattimer commented 5 years ago

git+https://github.com/Lawouach/WebSocket-for-Python.git#egg=ws4py

klattimer commented 5 years ago

Duplicate of https://github.com/klattimer/LGWebOSRemote/issues/40