lepresenced: Neue Testversion (lepresenced0.93dev21)

Begonnen von PatrickR, 17 August 2020, 11:30:15

Vorheriges Thema - Nächstes Thema

mi.ke

Zitat von: PatrickR am 09 November 2021, 12:24:34
Wenn es nicht klappt sollte ein Log mit LOG_DEBUG Aufschluss geben.

Habs hinbekommen und den LOG_DEBUG gesetzt.

Nov  9 14:11:14 fhem-Keller lepresenced[577]: [tid:0] main: Sending update for mac address ac:23:3f:xx:xx:xx, ages: 1/1, max age: 60, rssi: -71, battery level: unknown (age: unknown) (ignored), result: present.

wie befürchtet:
battery level: unknown

Readings werden aber keine erzeugt
FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

PatrickR

Zitat von: mi.ke am 09 November 2021, 14:30:56
Habs hinbekommen und den LOG_DEBUG gesetzt.
Wenn die Abfrage stattfindet müsstest Du eine Logmeldung wie die Folgende bekommen:

Battery level for mac %s is %s.

Interessant wäre mal, ob Deine Tags - ich habe das nur mit G-Tags getestet - die Battery-Level-Charakteristik (00002a19-0000-1000-8000-00805f9b34fb) unterstützen.

Zitat von: mi.ke am 09 November 2021, 14:30:56
Readings werden aber keine erzeugt
Ja, das passiert - wie ich nun festgestellt habe - bei unknown auch nicht.

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

mi.ke

Zitat von: PatrickR am 09 November 2021, 15:59:12
Interessant wäre mal, ob Deine Tags - ich habe das nur mit G-Tags getestet - die Battery-Level-Charakteristik (00002a19-0000-1000-8000-00805f9b34fb) unterstützen.

wie/wo kann man das auslesen?


Zitat von: PatrickR am 09 November 2021, 15:59:12
Ja, das passiert - wie ich nun festgestellt habe - bei unknown auch nicht.
Bei "device_name" aber schon, der steht nämlich auf (unknown) inkl. Kammern

LG
mi.ke
FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

PatrickR

#153
Hi!
Zitat von: mi.ke am 09 November 2021, 17:02:37
wie/wo kann man das auslesen?
Bpsw. mit einer entsprechenden Bluetooth LE Software, z. B. LightBlue für iOS. Gibt es aber auch für andere Betriebssysteme. Alternativ könnte man auch den Hersteller fragen.
Spannender wäre aber erst einmal, die entsprechende Logzeile ("Battery level for mac %s is %s.") zu sehen. Wenn Du das erzwingen willst kannst Du über FHEM statusRequest schicken, dann werden 120s später alle erreichbaren Tags gefragt.

Zitat von: mi.ke am 09 November 2021, 17:02:37
Bei "device_name" aber schon, der steht nämlich auf (unknown) inkl. Kammern
Ja, der ist aber auch anders implementiert und wird immer geschickt.

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

mi.ke

Zitat von: PatrickR am 09 November 2021, 17:39:20
Spannender wäre aber erst einmal, die entsprechende Logzeile ("Battery level for mac %s is %s.") zu sehen.

okay, ja, die Zeilen gibt es:

Nov  9 19:55:47 fhem-Keller lepresenced[577]: [tid:0] main::battery_task: Battery level for mac ac:23:3f:xx:xx:xx is unknown.

cheers
Mike
FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

PatrickR

Hi!
Bitte ruhig etwas Kontext, z. B. die 20 Zeilen außenherum, vor allem die mit ,,gatttool".

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

mi.ke

Zitat von: PatrickR am 10 November 2021, 07:35:37
Bitte ruhig etwas Kontext, z. B. die 20 Zeilen außenherum, vor allem die mit ,,gatttool".

Moin,

klar, gerne,
wenn das nicht reicht schick ich Dir gerne den gesamten Log per PM

cheers
Mike



Nov  9 13:55:38 fhem-Keller lepresenced[577]: [tid:0] main::get_battery_level: gatttool (mac: 04:52:c7:xx:xx:xx, address type: 'public'): 'connect error: Function not implemented (38)'
Nov  9 13:55:38 fhem-Keller kernel: [  132.376351] NET: Registered protocol family 38
Nov  9 13:55:38 fhem-Keller kernel: [  132.421444] cryptd: max_cpu_qlen set to 1000
Nov  9 13:55:38 fhem-Keller lepresenced[577]: [tid:0] main::battery_task: Battery level for mac 04:52:c7:xx:xx:xx is unknown.
Nov  9 13:55:40 fhem-Keller lepresenced[577]: [tid:0] main::set_thread_command: Setting thread command of thread 'bluetooth_scan_thread' to 'THREAD_COMMAND_RUN'.
Nov  9 13:55:40 fhem-Keller lepresenced[577]: [tid:0] main::set_thread_command: Setting thread command of thread 'bluetooth_dump_thread' to 'THREAD_COMMAND_RUN'.
Nov  9 13:55:40 fhem-Keller lepresenced[577]: [tid:0] main::battery_task: Battery task completed.
Nov  9 13:55:40 fhem-Keller lepresenced[577]: [tid:0] main::stats_task: Active clients: 3, known devices: 14 (min/max age: 123/124), received beacons (hcitool/hcidump/difference): 0/0/0
Nov  9 13:55:41 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received 'HCI sniffer - Bluetooth packet analyzer ver 5.50'.
Nov  9 13:55:41 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received 'device: hci0 snap_len: 1500 filter: 0xffffffff'.
Nov  9 13:55:41 fhem-Keller lepresenced[577]: [tid:1] main::bluetooth_scan_thread: Received 'LE Scan ...'.
Nov  9 13:56:09 fhem-Keller lepresenced[577]: [tid:0] main: Sending update for mac address ac:23:3f:xx:xx:yy, max age: 60, result: absence.
Nov  9 13:56:14 fhem-Keller lepresenced[577]: [tid:0] main: Sending update for mac address ac:23:3f:xx:xx:xx, ages: 0/1, max age: 60, rssi: -73, battery level: unknown (age: unknown) (ignored), result: present.
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received '< HCI Command: Remote Name Request (0x01|0x0019) plen 10', telling hcidump and hcitool to restart...
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:2] main::set_thread_command: Setting thread command of thread 'bluetooth_scan_thread' to 'THREAD_COMMAND_RESTART'.
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:2] main::set_thread_command: Setting thread command of thread 'bluetooth_dump_thread' to 'THREAD_COMMAND_RESTART'.
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: restarting hcidump...
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:2] main::set_thread_command: Setting thread command of thread 'bluetooth_dump_thread' to 'THREAD_COMMAND_RUN'.
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:1] main::bluetooth_scan_thread: restarting hcitool...
Nov  9 13:56:15 fhem-Keller lepresenced[577]: [tid:1] main::set_thread_command: Setting thread command of thread 'bluetooth_scan_thread' to 'THREAD_COMMAND_RUN'.
Nov  9 13:56:16 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received 'HCI sniffer - Bluetooth packet analyzer ver 5.50'.
Nov  9 13:56:16 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received 'device: hci0 snap_len: 1500 filter: 0xffffffff'.
Nov  9 13:56:16 fhem-Keller lepresenced[577]: [tid:1] main::bluetooth_scan_thread: Received 'LE Scan ...'.
Nov  9 13:56:41 fhem-Keller lepresenced[577]: [tid:0] main::stats_task: Active clients: 3, known devices: 16 (min/max age: 0/19), received beacons (hcitool/hcidump/difference): 659/659/0
Nov  9 13:57:09 fhem-Keller lepresenced[577]: [tid:0] main: Sending update for mac address ac:23:3f:xx:xx:yy, max age: 60, result: absence.
Nov  9 13:57:14 fhem-Keller lepresenced[577]: [tid:0] main: Sending update for mac address ac:23:3f:xx:xx:xx, ages: 1/1, max age: 60, rssi: -74, battery level: unknown (age: unknown) (ignored), result: present.
Nov  9 13:57:15 fhem-Keller lepresenced[577]: [tid:2] main::bluetooth_dump_thread: Received '< HCI Command: Remote Name Request (0x01|0x0019) plen 10', telling hcidump and hcitool to restart...


FHEM 5.9 | RPi4 + 5 x RPi(Z) + FB7590 + FB 6890 LTE via LAN und WAN (VPN) verbunden.
2 x CUL868 + 3 x RFXTRX(e) + 6 x HMwLanGW + 4 x z2tGw + 5 x LGW + 2 x IRBlast + CO2 +++
FS20, FHT, FMS, Elro(mod), CM160, Revolt, LGTV, STV, AVR, withings, HM-sec-*, HM-CC-RT-DN, AMAD, PCA301, arlo, Aqara

PatrickR

Hi!

Zitat von: mi.ke am 10 November 2021, 08:50:56

Nov  9 13:55:38 fhem-Keller lepresenced[577]: [tid:0] main::get_battery_level: gatttool (mac: 04:52:c7:xx:xx:xx, address type: 'public'): 'connect error: Function not implemented (38)'

Ich bin kein Bluetooth-Experte aber ich würde das erst einmal so deuten, dass keine Verbindung möglich ist. Mir fiele dazu nur ein, den Hersteller anzuschreiben und zu fragen, ob generell eine Abfrage des Batteriewerts möglich ist und ob er zufällig exemplarisch einen gatttool-Aufruf spendieren kann. Teilweise kann man die Tags des Herstellers wohl auch konfigurieren, ggf. geht da auch etwas.

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

mumpitzstuff

#158
Falls du Android hast, kannst du dir den BLE Scanner von Bluepixel laden. Dort kannst du genau sehen, welche Services dein Tag unterstützt (auf den grünen Connect Button klicken).

sysmek

Hallo,

es wäre toll, wenn mal jemand den lepresence.d auf einen aktuellen Stand bringt.

"hcitool lescan" wird ja mittlerweile nicht mehr unterstützt (deprecated). Getestet mit debian 12.

neu wird ja "bluetoothctl scan le" verwendet.

mfg Dirk

PatrickR

Zitat von: sysmek am 14 März 2024, 12:01:06es wäre toll, wenn mal jemand den lepresence.d auf einen aktuellen Stand bringt.

"hcitool lescan" wird ja mittlerweile nicht mehr unterstützt (deprecated). Getestet mit debian 12.

neu wird ja "bluetoothctl scan le" verwendet.

Hi!

Nachfolger ist ble2mqttd. Ist aber kein Drop-In-Ersatz sondern verwendet mqtt, was eine Reihe von Vorteilen hat.

https://forum.fhem.de/index.php?topic=127173.0

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

JWRu

ZitatNachfolger ist ble2mqttd. Ist aber kein Drop-In-Ersatz sondern verwendet mqtt, was eine Reihe von Vorteilen hat.
Das kann man aber nicht mit PRESENCE verwenden - oder?
ZBox; RasPi 3B; RasPi Zero W; Homematic; Z-Wave; EnOcean, Shelly; DuoFern; Oregon-Sensoren; TFA-Sensoren; Steuerung Viessmann-Heizung; Arduinos für Strom-, Wasser-, Gaszähler, Rauchmelder und FI-Schutzschalter

PatrickR

Hi!

Zitat von: JWRu am 14 März 2024, 12:59:06Das kann man aber nicht mit PRESENCE verwenden - oder?

Ich benutze es ohne Presence, was auch einer der Vorteile ist. Wenn Du ein Presence-Device willst oder z. B. für ROOMMATE benötigst kannst Du sicherlich ein PRESENCE-Device mit den Modus function oder event anlegen.

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook