fhempy: ble_monitor (Bluetooth Low Energy)

Begonnen von dominik, 15 Februar 2022, 23:36:47

Vorheriges Thema - Nächstes Thema

Nighthawk

Hier das log:

Exception ignored in: <coroutine object BaseEventLoop._create_connection_transport at 0x7f3d90b44a40>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1122, in _create_connection_transport
    transport.close()
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 697, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 751, in call_soon
    self._check_closed()
  File "/usr/lib/python3.9/asyncio/base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
2022-05-22 19:26:41,967 - ERROR    - asyncio: Task was destroyed but it is pending!
task: <Task pending name='Task-107' coro=<Event.wait() done,
defined at /usr/lib/python3.9/asyncio/locks.py:213> wait_for=<Future pending cb=[<TaskWakeupMethWrapper
object at 0x7f3d907f83a0>()]> cb=[_release_waiter(<Future pendi...d907f8be0>()]>)() at /usr/lib/python3.9/asyncio/tasks.py:416]>


Mir ist auch aufgefallen, dass nichts passiert wenn ich den FHEMPyServer neustarte, weder eine Reaktion im Webinterface, noch im Log.

marboj

nochmals kurz zur Konkretisierung meines Problems:

Ich möchte das Xiaomi Thermometer LY...03 mit der alternativen FW an mein FHEM anbinden.

Bei Nutzung des Moduls ble_monitor erscheint der o.g. Fehler im STATE.

Bei Nutzung des Moduls mitemp wird der Name des Geräts als reading angelegt, nicht mehr nicht weniger...

Gruß
Marco
meine FHEM-Konfiguration: Raspberry Pi4, BT-Dongle, CUL868, CeeBee II

dominik

@Nighthawk, kannst du bitte mit der Version 358 testen? Bitte poste dann wieder das Log, danke!

@marboj, ok, ich hatte wohl übersehen, dass ble_monitor doch 3.8 oder höher benötigt. Sorry! Kannst du bitte nochmals mit 3.9 und Version 358 testen?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Nighthawk

Hallo Dominik,

hier das Log, leider ohne Veränderung:

                                                                                                                                                                                                                                                                                                                                                                                                                                                       
2022-05-23 20:25:32,123 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2022-05-23 20:25:32,705 - ERROR    - fhempy.lib.pkg_installer: Unable to install package fhempy: Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/configuration.py", line 26, in <module>
    from pip._internal.utils.logging import getLogger
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 27, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 39, in <module>
    from pip._internal.locations import get_major_minor_version
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/locations/__init__.py", line 14, in <module>
    from . import _distutils, _sysconfig
  File "/opt/fhem/.local/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
    from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
2022-05-23 20:25:33,196 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2022-05-23 20:25:33,198 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-05-23 20:25:33,227 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-05-23 20:25:43,296 - INFO     - websockets.server: connection open
2022-05-23 20:25:43,299 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2022-05-23 20:25:43,381 - WARNING  - zeroconf: Error with socket 12 (('192.168.42.0', 5353))): [Errno 126] Required key not available
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 1053, in sendto
    self._sock.sendto(data, addr)
OSError: [Errno 126] Required key not available
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
2022-05-23 20:25:48,948 - ERROR    - Feuermelder_SZ: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:25:53,955 - ERROR    - Feuermelder_SZ: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:25:58,962 - ERROR    - Feuermelder_SZ: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:26:03,967 - ERROR    - Feuermelder_SZ: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:26:08,973 - ERROR    - Feuermelder_SZ: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:27:16,753 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2022-05-23 20:27:16,756 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-05-23 20:27:16,791 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-05-23 20:27:34,764 - INFO     - websockets.server: connection open
2022-05-23 20:27:34,767 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2022-05-23 20:27:34,797 - WARNING  - zeroconf: Error with socket 12 (('192.168.42.0', 5353))): [Errno 126] Required key not available
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 1053, in sendto
    self._sock.sendto(data, addr)
OSError: [Errno 126] Required key not available
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 171, in run
    conn[hci], btctrl[hci] = self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 171, in run
    conn[hci], btctrl[hci] = self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/fhem/.local/lib/python3.9/site-packages/fhempy/lib/ble_monitor/hcidump.py", line 183, in run
    self._event_loop.run_until_complete(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 645, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
2022-05-23 20:27:43,823 - ERROR    - Feuermelder_Galerie: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:27:48,827 - ERROR    - Feuermelder_Galerie: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:27:53,831 - ERROR    - Feuermelder_Galerie: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:27:58,835 - ERROR    - Feuermelder_Galerie: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.
2022-05-23 20:28:03,839 - ERROR    - Feuermelder_Galerie: HCIdump thread: Something wrong - interface hci0 not ready, and will be skipped for current scan period.

dominik

Ich glaube da liegt noch ein Fehler beim Update vor. Wie hast du fhempy aktualisiert? Weil das Log ist noch von einer älteren Version.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

marboj

Hallo Dominik,

das Problem ist, dass ich zur Abfrage meiner Tür- und Fensterkontakte ebenfalls Python benötige und die Scripte geben Fehler unter 3.8 aus. Leider bin ich in Python niht fit um zu wissen, wie man die Scripte unter 3.8 lauffähig bekommt.

Was ist denn mit dem mitemp-Modul? Läuft das unter 3.7? Das sollte doch auch funktionieren, oder?

Gruß
Marco
meine FHEM-Konfiguration: Raspberry Pi4, BT-Dongle, CUL868, CeeBee II

marboj

Habe jetzt 3.8 installiert, parallel zu 3.7.

Leider nutzt Fhempy trotzdem beim Start 3.7. Wie kann man das steuern?

Es gibt 2 Auswahlmöglichkeiten für die Alternative python (welche /usr/bin/python bereitstellen).

  Auswahl      Pfad                      Priorität Status
------------------------------------------------------------
* 0            /usr/local/bin/python3.8   2         automatischer Modus
  1            /usr/bin/python3.7         1         manueller Modus
  2            /usr/local/bin/python3.8   2         manueller Modus

meine FHEM-Konfiguration: Raspberry Pi4, BT-Dongle, CUL868, CeeBee II

Nighthawk

Hallo Dominik,

Das Update habe ich wie gewohnt mit Update all ausgeführt und anschließend  ein shutdown restart hinterhergeschoben.

Aktuell sieht es aus wie auf dem Screenshot, wenn ich Update check ausführe.


Nighthawk

Hallo Dominik,

gibt es wirklich keine Möglichkeit das Problem einzufangen und zu lösen?
Ich habe nun alles was mit fhempy zu tun hatte rausgelöscht und fhempy neu angelegt, leider ohne einen sichtbaren Erfolg.