[Altes Modul] GoogleCast (98_GOOGLECAST.pm)

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

Vorheriges Thema - Nächstes Thema

dominik

Da musst du wohl zuerst diesen Fehler beheben bevor du weiter machst. Aber wie kadettilac89 schon schreibt, bitte nicht an 10 Stellen gleichzeitig was ändern, sonst tun wir uns auch beim Supporten schwer.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Ich ändere doch nicht an mehreen Stellen, nur an einer die in dem anderen Threat ausgearbeitet worden ist.
Da sich aber grundsätzlich alle Probleme auf die selbe Ursache zurückführen lassen - nämlich fehlende Funktionen aus der Docker-Configuration - habe ich einfach nur hier auf den Befehl eine rückmeldung gegeben. Wir können uns aber natürlich gerne auf den anderen Threat alleinig konzentrieren.

P.S. es war eigentlich in Code Tags eingeschlossen, aber da ich es in mehreren Teilen rauskopieren musste, ist das wohl schiefgegangen.

Superposchi

#857
So nach dem das Fhemconnect Problem aus dem anderen Threat gelöst ist wollte ich mich an Googlecast und text2speech ranwagen.

Habe wie empfohlen das neue Modul von dominic entsprechend der Anleitung unter https://github.com/dominikkarall/fhem_pythonbinding angelegt.
Leider ist das Device "disconnect". Das List sieht folgendermaßen aus:
Internals:
   BindingType Python
   CFGFN     
   DEF        Python
   DeviceName ws:127.0.0.1:15733
   FUUID      5fba74b5-f33f-793a-1760-e724b98ba1bd9e5e
   NAME       local_pybinding
   NEXT_OPEN  1606055967
   NR         51
   NTFY_ORDER 50-local_pybinding
   PARTIAL   
   STATE      disconnected
   TYPE       BindingsIo
   nextOpenDelay 10
   READINGS:
     2020-11-22 15:39:17   state           disconnected
Attributes:
   group      Google
   room       hidden


Hier ein Auszug aus dem Startprotokoll des Fhem-Servers:

Abbild :
fhem/fhem-arm32v7_linux:latest
ID : 2db911d82719
Applikation : - -
Eingangspunkt : /entry.sh
Befehl : start
CPU : 19%
RAM : 1%
Netzwerkauslastung :
3.8 KB/s 614 B/s
10k
0
10k
20k
30k
40k
Konsole
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
2020.11.22 17:05:05.006 3: Pythonbinding_0: starting                                                                               
2020.11.22 17:05:05.011 3: Pythonbinding_0: using logfile: ./log/PythonBinding-2020-11-22.log                                       
2020.11.22 17:05:11.005 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 17:05:21.060 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 17:05:21.060 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 17:05:28.572 3: Pythonbinding_0: read: end of file reached while sysread                                                 
2020.11.22 17:05:28.572 3: Pythonbinding_0: stopped

Anbei packe ich auch mal das Log

dominik

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

Superposchi

Hatte ich schon in einer der Anleitungen gelesen und gemacht. Habs aber gerade eben noch mal probiert. Hier das Ergebnis:
[code]Collecting cryptography                                                                                                                                                                                                                                                         
  Downloading https://files.pythonhosted.org/packages/94/5c/42de91c7fbdb817b2d9a4e64b067946eb38a4eb36c1a09c96c87a0f86a82/cryptography-3.2.1.tar.gz (540kB)                                                                                                                     
    100% |████████████████████████████████| 542kB 420kB/s                                                                                                                                                                                                                       
  Installing build dependencies ... error                                                                                                                                                                                                                                       
  Complete output from command /usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-dp7ppjw4 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=40.6.0 wheel "cffi>=1.8,!=1.11.3; p
latform_python_implementation != 'PyPy'":                                                                                                                                                                                                                                       
  Collecting setuptools>=40.6.0                                                                                                                                                                                                                                                 
    Downloading https://files.pythonhosted.org/packages/6d/38/c21ef5034684ffc0412deefbb07d66678332290c14bb5269c85145fbd55e/setuptools-50.3.2-py3-none-any.whl (785kB)                                                                                                           
  Collecting wheel                                                                                                                                                                                                                                                             
    Downloading https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl                                                                                                                   
  Collecting cffi!=1.11.3,>=1.8                                                                                                                                                                                                                                                 
    Downloading https://files.pythonhosted.org/packages/cb/ae/380e33d621ae301770358eb11a896a34c34f30db188847a561e8e39ee866/cffi-1.14.3.tar.gz (470kB)                                                                                                                           
  Collecting pycparser (from cffi!=1.11.3,>=1.8)                                                                                                                                                                                                                               
    Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)                                                                                                         
  Building wheels for collected packages: cffi                                                                                                                                                                                                                                 
    Running setup.py bdist_wheel for cffi: started                                                                                                                                                                                                                             
    Running setup.py bdist_wheel for cffi: finished with status 'error'                                                                                                                                                                                                         
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ewb32_js/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_w
heel -d /tmp/pip-wheel-d4uny2e2 --python-tag cp37:                                                                                                                                                                                                                             
    Package libffi was not found in the pkg-config search path.                                                                                                                                                                                                                 
    Perhaps you should add the directory containing `libffi.pc'                                                                                                                                                                                                                 
    to the PKG_CONFIG_PATH environment variable                                                                                                                                                                                                                                 
    No package 'libffi' found                                                                                                                                                                                                                                                   
    Package libffi was not found in the pkg-config search path.                                                                                                                                                                                                                 
    Perhaps you should add the directory containing `libffi.pc'                                                                                                                                                                                                                 
    to the PKG_CONFIG_PATH environment variable                                                                                                                                                                                                                                 
    No package 'libffi' found                                                                                                                                                                                                                                                   
    Package libffi was not found in the pkg-config search path.                                                                                                                                                                                                                 
    Perhaps you should add the directory containing `libffi.pc'                                                                                                                                                                                                                 
    to the PKG_CONFIG_PATH environment variable                                                                                                                                                                                                                                 
    No package 'libffi' found                                                                                                                                                                                                                                                   
    Package libffi was not found in the pkg-config search path.                                                                                                                                                                                                                 
    Perhaps you should add the directory containing `libffi.pc'                                                                                                                                                                                                                 
    to the PKG_CONFIG_PATH environment variable                                                                                                                                                                                                                                 
    No package 'libffi' found                                                                                                                                                                                                                                                   
    Package libffi was not found in the pkg-config search path.                                                                                                                                                                                                                 
    Perhaps you should add the directory containing `libffi.pc'                                                                                                                                                                                                                 
    to the PKG_CONFIG_PATH environment variable                                                                                                                                                                                                                                 
    No package 'libffi' found                                                                                                                                                                                                                                                   
    running bdist_wheel                                                                                                                                                                                                                                                         
    running build                                                                                                                                                                                                                                                               
    running build_py                                                                                                                                                                                                                                                           
    creating build                                                                                                                                                                                                                                                             
    creating build/lib.linux-armv7l-3.7
    creating build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                                   
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                   
    copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                   
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                           
    copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                 
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                               
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                     
    copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                     
    copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                 
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                           
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                                 
    copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                               
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                               
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi                                                                                                                                                                                                             
    running build_ext                                                                                                                                                                                                                                                           
    building '_cffi_backend' extension                                                                                                                                                                                                                                         
    creating build/temp.linux-armv7l-3.7                                                                                                                                                                                                                                       
    creating build/temp.linux-armv7l-3.7/c                                                                                                                                                                                                                                     
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -
c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o                                                                                                                                                                                                           
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory                                                                                                                                                                                                     
     #include <ffi.h>                                                                                                                                                                                                                                                           
              ^~~~~~~                                                                                                                                                                                                                                                           
    compilation terminated.                                                                                                                                                                                                                                                     
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                               
    ----------------------------------------                                                                                                                                                                                                                                   
    Failed building wheel for cffi                                                                                                                                                                                                                                             
    Running setup.py clean for cffi                                                                                                                                                                                                                                             
  Failed to build cffi                                                                                                                                                                                                                                                         
  Installing collected packages: setuptools, wheel, pycparser, cffi                                                                                                                  &

dominik

sudo apt install libffi-dev libssl-dev und danach nochmals probieren
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

#861
Hallo alle zusammen
Ich habe das selbe Problem wie Superposchi bei mir geht das Device BindingsIo auch gleich auf disconnect. Selber Log Auszug wie bei Superposchi. Ich habe hier einen Auszug aus meinen log
PythonBinding-2020-11-22.log


Traceback (most recent call last):
  File "FHEM/bindings/python/pythonbinding.py", line 3, in <module>
    import lib.fhem_pythonbinding as fpb
  File "/opt/fhem/FHEM/bindings/python/lib/fhem_pythonbinding.py", line 14, in $
    from . import pkg_installer
  File "/opt/fhem/FHEM/bindings/python/lib/pkg_installer.py", line 20, in <modu$
    from importlib_metadata import (  # pylint: disable=import-error
ModuleNotFoundError: No module named 'importlib_metadata'


Was bei mir komisch ist, ich hatte es schon am 13.11.2020 erfolgreich auf meiner FHEM Instand die sich da noch auf einen USB Stick befunden hatte zum laufen gebracht.
Jetzt habe ich alles auf einem neuen SSD Laufwerk aufgesetzt und bekomme Pyhtonbinding patu nicht zum laufen.
System auf dem USB-Stick war wie jetzt auf der SSD Buster 10.
Die beiden Befehle

sudo pip3 install cryptography
sudo apt install libffi-dev libssl-dev

habe ich ohne Erfolg ausgeführt.

cryptography war bereits installiert und hat mir auf der nicht funktionierenden SSD Festplatte folgendes ausgegeben.


Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (2.6.1)



Die Ausgabe des Befehls sudo pip3 install cryptography auf der funktionierenden USB Version hatte diese Ausgabe

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: cryptography in /opt/fhem/.local/lib/python3.7/site-packages (3.2.1)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /opt/fhem/.local/lib/python3.7/site-packages (from cryptography) (1.14.3)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography) (1.12.0)
Requirement already satisfied: pycparser in /opt/fhem/.local/lib/python3.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography) (2.20)


Vieleicht hilft das ein wenig weiter das Problem zu finden

Superposchi

Jetzt hat es offenbar funktioniert mit der Installation. Wurde mit Code 0 beendet:
Collecting cryptography                                                                                                                                                                                                                                                         
  Using cached https://files.pythonhosted.org/packages/94/5c/42de91c7fbdb817b2d9a4e64b067946eb38a4eb36c1a09c96c87a0f86a82/cryptography-3.2.1.tar.gz                                                                                                                             
  Installing build dependencies ... done                                                                                                                                                                                                                                       
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography) (1.12.0)                                                                                                                                                                       
Collecting cffi!=1.11.3,>=1.8 (from cryptography)                                                                                                                                                                                                                               
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography)                                                                                                                                                                                                                   
  Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl                                                                                                                   
Building wheels for collected packages: cryptography                                                                                                                                                                                                                           
  Running setup.py bdist_wheel for cryptography ... done                                                                                                                                                                                                                       
  Stored in directory: /root/.cache/pip/wheels/93/82/ae/e8b455fc66cb84eb1e07f29af34d888f37fa62fb707b56f57c                                                                                                                                                                     
Successfully built cryptography                                                                                                                                                                                                                                                 
Installing collected packages: pycparser, cffi, cryptography                                                                                                                                                                                                                   
Successfully installed cffi-1.14.3 cryptography-3.2.1 pycparser-2.20


Aber das Device bleibt weiterhin auf Disconnected stehen. Bei einem Neustart von Fhem gibt es Fehlermeldungen im Startprotokoll:
2020.11.22 20:19:36.555 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:19:36.555 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:19:41.004 3: Pythonbinding_0: starting                                                                               
2020.11.22 20:19:41.009 3: Pythonbinding_0: using logfile: ./log/PythonBinding-2020-11-22.log                                       
2020.11.22 20:19:41.681 3: Pythonbinding_0: read: end of file reached while sysread                                                 
2020.11.22 20:19:41.682 3: Pythonbinding_0: stopped                                                                                 
2020.11.22 20:19:46.557 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:19:46.558 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:19:56.561 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:19:56.561 1: BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Connection refused (111)         
2020.11.22 20:20:01.004 3: Pythonbinding_0: starting                                                                               
2020.11.22 20:20:01.009 3: Pythonbinding_0: using logfile: ./log/PythonBinding-2020-11-22.log                                       
2020.11.22 20:20:01.705 3: Pythonbinding_0: read: end of file reached while sysread                                                 
2020.11.22 20:20:01.705 3: Pythonbinding_0: stopped


Das List sieht folgendermaßen aus:
Internals:
   BindingType Python
   DEF        Python
   DeviceName ws:127.0.0.1:15733
   FUUID      5fba74b5-f33f-793a-1760-e724b98ba1bd9e5e
   FVERSION   10_BindingsIo.pm:0.182830/2019-01-16
   NAME       local_pybinding
   NEXT_OPEN  1606072906
   NR         22
   NTFY_ORDER 50-local_pybinding
   PARTIAL   
   STATE      disconnected
   TYPE       BindingsIo
   nextOpenDelay 10
   READINGS:
     2020-11-22 20:21:36   state           disconnected
Attributes:
   group      Google
   room       Test

dominik

#863
@Stelaku, bei dir fehlt importlib. Probier mal
sudo pip3 install importlib_metadata

@Superposchi, bitte PythonBinding Log posten. Bist du auch auf Buster?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi


dominik

Poste bitte die Ausgabe von
sudo pip3 install importlib_metadata
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Wurde mit Code 0 beendet:
Collecting importlib_metadata                                                                                                                                                                                                                                                   
  Downloading https://files.pythonhosted.org/packages/41/fa/7777ba70d10aff203eab65839e53faa029e2cafba8bb7f27cdb25e44393b/importlib_metadata-3.0.0-py2.py3-none-any.whl                                                                                                         
Collecting zipp>=0.5 (from importlib_metadata)                                                                                                                                                                                                                                 
  Downloading https://files.pythonhosted.org/packages/41/ad/6a4f1a124b325618a7fb758b885b68ff7b058eec47d9220a12ab38d90b1f/zipp-3.4.0-py3-none-any.whl                                                                                                                           
Installing collected packages: zipp, importlib-metadata                                                                                                                                                                                                                         
Successfully installed importlib-metadata-3.0.0 zipp-3.4.0

dominik

Startet es jetzt? Wenn nicht, bitte wieder um PythonBinding Log.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Stelaku

Hallo Dominik

sudo pip3 install importlib_metadata

Das war es bei mir.
Jetzt steht das Device BindingsIo auf open so wie es sein soll.

Super und vielen dank für die Hilfe

Gruß

Stephan

dominik

Ist komisch, dass das nicht automatisch installiert wurde. Eigentlich sollte das beim Start installiert werden. Welche Debian Version nutzt du?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik