[Altes Modul] GoogleCast (98_GOOGLECAST.pm)

Begonnen von dominik, 10 Dezember 2015, 22:43:49

Vorheriges Thema - Nächstes Thema

NCC1701D

Ich habe es nun gerade testen können. Ist jetzt noch besser. Super!


dominik

@NCC1701D, kannst du mal folgende Commandos ausführen
pi@raspberrypi ~ $ python
Python 2.7.9 (default, Mar  8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
>>> chromecasts = pychromecast.get_chromecasts()
>>> [cc.device.friendly_name for cc in chromecasts]
[u'Wohnzimmer']
>>>


Mich würde interessieren wieso dein Device mit Umlaut nicht gefunden werden kann.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

Hallo zusammen,

habe nach einigem Lesen hier endlich geschafft die "Voraussetzungen" zu erfüllen, insbesond. das "cpanm Inline::Python" hat mir Probleme bereitet.
Hat aber dann geklappt.

Jetzt bekomme ich beim Start von fhem allerdings folgende Fehlermeldung:
Error -- py_eval raised an exception at /usr/local/lib/arm-linux-gnueabihf/perl/5.20.2/Inline/Python.pm line 177.
BEGIN failed--compilation aborted at ./FHEM/98_CHROMECAST.pm line 318.

Leider bin ich nicht sehr bewandert im Programmieren. Vielleicht kann jemand helfen, wo das Problem liegt.

LG
Alex.
FHEM auf RaspberryPi 4
Homematic

dominik

Hi Alex,

da dürfte noch etwas mit der Inline::Python Installation nicht richtig laufen. Erstell mal folgende Datei:

inlinetest.pl
use Inline Python => << "ENDE";

print "inline python is working"

ENDE


Danach im gleichen Verzeichnis
perl inlinetest.pl
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

Habs gemacht. Ergebnis:
root@raspberrypi:~# perl inlinetest.pl
inline python is working
FHEM auf RaspberryPi 4
Homematic

dominik

pychromecast hast du aus meinem Repository installiert mit pip? Such mal bitte im CHROMECAST.pm Modul nach "logging.ERROR" und schreib dort "logging.DEBUG" rein. Danach shutdown restart. Poste danach bitte dein Log inkl. verbose=5.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

#96
ja so wie in der letzten Anleitung von Dir auf S. 5 oder 6.

Habs mal gemacht. LOG ist angehängt.

UPDATE:
hab nochmal reload gemacht. Kommt folgendes im LOG:
2016.12.18 13:56:12 4: WEB_192.168.180.129_63524 POST /fhem&fw_id=447&cmd=reload+98_CHROMECAST.pm; BUFLEN:0
2016.12.18 13:56:12 5: Cmd: >reload 98_CHROMECAST.pm<
2016.12.18 13:56:13 5: Loading ./FHEM/98_CHROMECAST.pm
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/__init__.py", line 14, in <module>
    from . import socket_client
ImportError: cannot import name socket_client
2016.12.18 13:56:13 4: name: /fhem&fw_id=447&cmd=reload+98_CHROMECAST.pm / RL:1462 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2016.12.18 13:56:13 4: WEB_192.168.180.129_63524 GET /fhem?XHR=1&inform=type=status;filter=;since=1482065772;fmt=JSON&fw_id=447×tamp=1482065772200; BUFLEN:0
FHEM auf RaspberryPi 4
Homematic

dominik

Da stimmt was mit der pychromecast Installation nicht. Mach bitte mal
sudo pip uninstall pychromecast
sudo pip install git+https://github.com/dominikkarall/pychromecast.git

und probier es dann nochmals.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

erledigt.
root@raspberrypi:/opt/fhem/FHEM# sudo pip uninstall pychromecast
Uninstalling PyChromecast:
  /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info
  /usr/local/lib/python2.7/dist-packages/pychromecast/__init__.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/authority_keys_pb2.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/authority_keys_pb2.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/cast_channel_pb2.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/cast_channel_pb2.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/config.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/config.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/__init__.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/media.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/media.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/plex.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/plex.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/youtube.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/controllers/youtube.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/dial.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/dial.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/discovery.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/discovery.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/error.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/error.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/logging_pb2.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/logging_pb2.pyc
  /usr/local/lib/python2.7/dist-packages/pychromecast/socket_client.py
  /usr/local/lib/python2.7/dist-packages/pychromecast/socket_client.pyc
Proceed (y/n)? y
  Successfully uninstalled PyChromecast
root@raspberrypi:/opt/fhem/FHEM# sudo pip install git+https://github.com/dominikkarall/pychromecast.git
Downloading/unpacking git+https://github.com/dominikkarall/pychromecast.git
  Cloning https://github.com/dominikkarall/pychromecast.git to /tmp/pip-v2lel4-build
  Running setup.py (path:/tmp/pip-v2lel4-build/setup.py) egg_info for package from git+https://github.com/dominikkarall/pychromecast.git
   
    warning: no previously-included files matching '*.py[co]' found under directory '*'
Requirement already satisfied (use --upgrade to upgrade): requests>=2.0 in /usr/lib/python2.7/dist-packages (from PyChromecast==0.7.7)
Requirement already satisfied (use --upgrade to upgrade): protobuf==3.0.0b2 in /usr/local/lib/python2.7/dist-packages (from PyChromecast==0.7.7)
Requirement already satisfied (use --upgrade to upgrade): zeroconf>=0.17.4 in /usr/local/lib/python2.7/dist-packages (from PyChromecast==0.7.7)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from PyChromecast==0.7.7)
Installing collected packages: PyChromecast
  Running setup.py install for PyChromecast
   
    warning: no previously-included files matching '*.py[co]' found under directory '*'
Successfully installed PyChromecast
Cleaning up...


Hat nix geholfen. ;-(
ist es vielleicht ein REchte-Problem, weil ich pychromecast als root installiert habe?
FHEM auf RaspberryPi 4
Homematic

dominik

Ne, Rechteproblem dürfte es keines sein. Mach mal
pi@raspberrypi ~ $ python
Python 2.7.9 (default, Mar  8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
>>>
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

root@raspberrypi:/opt/fhem/FHEM# python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/__init__.py", line 15, in <module>
    from .discovery import discover_chromecasts
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/discovery.py", line 6, in <module>
    from zeroconf import ServiceBrowser, Zeroconf
  File "/usr/local/lib/python2.7/dist-packages/zeroconf.py", line 26, in <module>
    import enum
ImportError: No module named enum
>>>
FHEM auf RaspberryPi 4
Homematic

dominik

fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

musste außerdem noch netifaces installieren. Jetzt kommt ein Fehler den ich nicht mehr selbst beheben kann...

root@raspberrypi:/opt/fhem/FHEM# sudo pip install enum
Downloading/unpacking enum
  Downloading enum-0.4.6.tar.gz
  Running setup.py (path:/tmp/pip-build-uyszhC/enum/setup.py) egg_info for package enum
   
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from enum)
Installing collected packages: enum
  Running setup.py install for enum
   
Successfully installed enum
Cleaning up...
root@raspberrypi:/opt/fhem/FHEM# python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/__init__.py", line 15, in <module>
    from .discovery import discover_chromecasts
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/discovery.py", line 6, in <module>
    from zeroconf import ServiceBrowser, Zeroconf
  File "/usr/local/lib/python2.7/dist-packages/zeroconf.py", line 37, in <module>
    import netifaces
ImportError: No module named netifaces
>>>
root@raspberrypi:/opt/fhem/FHEM# sudo pip install netifaces
Downloading/unpacking netifaces
  Downloading netifaces-0.10.5.tar.gz
  Running setup.py (path:/tmp/pip-build-zHduJt/netifaces/setup.py) egg_info for package netifaces
   
Installing collected packages: netifaces
  Running setup.py install for netifaces
    checking for getifaddrs...found.
    checking for getnameinfo...found.
    checking for IPv6 socket IOCTLs...not found.
    checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
    checking whether struct sockaddr has a length field...no.
    checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda llc.
    checking for routing socket support...no.
    checking for sysctl(CTL_NET...) support...no.
    checking for netlink support...yes.
    will use netlink to read routing table
    building 'netifaces' extension
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DNETIFACES_VERSION=0.10.5 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-armv7l-2.7/netifaces.o
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/netifaces.o -o build/lib.linux-armv7l-2.7/netifaces.so
   
Successfully installed netifaces
Cleaning up...
root@raspberrypi:/opt/fhem/FHEM# python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pychromecast
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/__init__.py", line 15, in <module>
    from .discovery import discover_chromecasts
  File "/usr/local/lib/python2.7/dist-packages/pychromecast/discovery.py", line 6, in <module>
    from zeroconf import ServiceBrowser, Zeroconf
  File "/usr/local/lib/python2.7/dist-packages/zeroconf.py", line 1423, in <module>
    @enum.unique
AttributeError: 'module' object has no attribute 'unique'
>>>
FHEM auf RaspberryPi 4
Homematic

dominik

pip install -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

alexmetz

#104
scheint alles da zu sein. Ich mach mal raspi-update.

root@raspberrypi:/opt/fhem/FHEM# pip install -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt

Requirement already satisfied (use --upgrade to upgrade): requests>=2.0 in /usr/lib/python2.7/dist-packages (from -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): protobuf==3.0.0b2 in /usr/local/lib/python2.7/dist-packages (from -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): zeroconf>=0.17.4 in /usr/local/lib/python2.7/dist-packages (from -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from -r /usr/local/lib/python2.7/dist-packages/PyChromecast-0.7.7.egg-info/requires.txt (line 4))
Cleaning up...


UPDATE: raspi-update hat auch nix geholfen. apt-get update und upgrade hatte ich gestern erst gemacht.
FHEM auf RaspberryPi 4
Homematic