BLE - Gigaset Keeper ca. 30s present, dann dauerhaft absent

Begonnen von zontorro, 06 Januar 2020, 16:09:52

Vorheriges Thema - Nächstes Thema

zontorro

Hallo zusammen,

ich habe basierend auf dieser Anleitung (http://reimann2.de/heimautomatisierung/fhem45.html) einen Gigaset Keeper eingerichtet mit lepresenced-0.83-3 und bluetoothctl.

Nach einem Raspberry-Reboot schaltet der PRESENCE-Zustand auf "present", der BLE-Tag wird also erkannt. Nach ca. 30s jedoch wechselt der Zustand auf "absent" und bleibt dort dauerhaft.

Wenn ich nochmals einen Reboot mache, schaltet er wieder auf present und kurz darauf wieder zurück. Mittels hcitool lescan und auch am Smartphone mit BLEScanner ist der Tag weiterhin zu finden.

Den Tag habe ich, wie in der Anleitung beschrieben, direkt mit dem Raspberry gepairt.

Kann mir jemand helfen das Problem zu lösen?

Technische Daten:
-Gigaset Keeper
-Raspberry Pi 3 Model B
-internes BT-Modul verwendet, kein USB-BT
-System ist auf aktuellem Stand
-lepresenced V0.9-1
-Homematic-CUL angeschlossen
-Elero-Stick angeschlossen
-sonst keine weiteren Funkmodule

Danke und Grüße
zontorro

PRESENCE-obj list

Internals:
   ADDRESS    58:9E:C6:09:D5:45
   CHANGED   
   DEF        lan-bluetooth 58:9E:C6:09:D5:45 127.0.0.1:5333    10
   DeviceName 127.0.0.1:5333
   FD         22
   FUUID      5e0e1bc3-f33f-67bb-e40e-09ce7ed8bcb9d88e
   INTERVAL_NORMAL 10
   INTERVAL_PRESENT 10
   MODE       lan-bluetooth
   NAME       Keeper_Flo
   NOTIFYDEV  global
   NR         242
   NTFY_ORDER 50-Keeper_Flo
   PARTIAL   
   STATE      absent
   TYPE       PRESENCE
   Helper:
     DBLOG:
       model:
         DBLogging:
           TIME       1578322703.27523
           VALUE      lan-lepresenced
       presence:
         DBLogging:
           TIME       1578322758.05919
           VALUE      absent
       rssi:
         DBLogging:
           TIME       1578322758.05919
           VALUE      unreachable
       state:
         DBLogging:
           TIME       1578322758.05919
           VALUE      absent
   READINGS:
     2020-01-06 15:22:57   command_accepted yes
     2020-01-06 16:08:08   daemon          lepresenced V0.9
     2020-01-06 15:59:08   device_name     Gigaset keeper
     2020-01-06 16:08:08   model           lan-lepresenced
     2020-01-06 16:08:08   presence        absent
     2020-01-06 16:08:08   rssi            unreachable
     2020-01-06 16:08:08   state           absent
   helper:
     CURRENT_STATE present
     CURRENT_TIMEOUT normal
Attributes:
   event-on-change-reading .*

PatrickR

Deinstalliere mal die Bluetooth-Pakete aus dem Tutorial (blueman etc.) wieder und danach nur das lepresenced-Paket inkl. Abhängigkeiten.


Von unterwegs gesendet.
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

#2
Vielleicht ein Rechteproblem? lescan benötigt normalerweise root Rechte. lepresenced hat diese vielleicht nicht und kann deshalb den Service gar nicht starten. Was kommt denn bei:

ps -aux | grep hcitool

Aktuell ist der present Status wahrscheinlich der Startwert und da lepresenced nie einen Status bekommt, geht der Status nach 30s auf absend.


Hier ist beschrieben, wie man das auch mal kurz ändern kann, um dieses Problem auszuschliessen:

https://forum.fhem.de/index.php/topic,68104.msg999291.html#msg999291

zontorro

@PatrickR:
Ich habe alles deinstalliert und lepresenced0.9-1 neu installiert, das Problem besteht immer noch...

@mumpitzstuff:
Der Tag wird richtig erkannt, wenn ich ihn in den Keller trage und anschließend reboote ist er direkt auf absent. Zurück damit in die Wohnung und nach dem Reboot startet er kurz mit present. Nichtsdestotrotz habe ich die Schritte im verlinkten Post ausgeführt:

ps -aux VOR Änderung:
pi@fhempi:~ $ ps -aux | grep hcitool
root      1230  0.0  0.0   2552   624 ?        S    13:21   0:00 hcitool -i hci0 lescan --duplicates
pi        1575  0.0  0.0   4368   548 pts/0    S+   13:28   0:00 grep --color=auto hcitool


ps -aux NACH Änderung:
pi@fhempi:~ $ ps -aux | grep hcitool
root      1297  0.0  0.0   2552   656 ?        S    13:36   0:00 hcitool -i hci0 lescan --duplicates
pi        2181  0.0  0.0   4368   536 pts/0    S+   14:30   0:00 grep --color=auto hcitool


Weiterhin ist es nicht möglich, hcitool lescan ohne "sudo" auszuführen

pi@fhempi:~ $ hcitool lescan
Set scan parameters failed: Operation not permitted
pi@fhempi:~ $ sudo hcitool lescan
LE Scan ...
[...]
XX:XX:XX:XX:XX:XX Gigaset keeper
[...]


Der Keeper ist weiterhin über hcitool auffindbar währen fhem ihn als "absent" markiert.

Gibt es noch weitere Lösungsvorschläge?

mumpitzstuff

#4
Der Zugriff ist exklusiv. Läuft lepresenced, dann darfst du mit diesem Bluetooth Dongle nichts mehr machen, sonst funktioniert lepresenced nur mit Aussetzern oder gar nicht mehr.
Hast du z.b. bletagbattery auf dem gleichen hci Device laufen, dann hast du die Ursache gefunden.

PatrickR

#5
Guten Abend,

ok, lasst uns mal strukturiert vorgehen.

1.) Bitte mal die Ausgabe posten von dpkg -l|egrep '(hci|blue)'
2.) Benutzt Du noch irgendwelche andere Bluetooth-Funktionalitäten? (Das PRESENCE-Modul mit local-bluetooth etc.)?
3.) Kannst Du mal testweise das Batterieskript komplett deaktivieren?
4.) Bitte setze mal den Loglevel auf LOG_DEBUG und poste ein Log vom Start bis zum Auftreten des Problems.

Patrick

/Edit: Update nach nochmaligem Lesen der verlinkten Anleitung.
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

zontorro

1)
pi@fhempi:~ $ dpkg -l|egrep '(hci|blue)'
rc  bluealsa                              0.9                                armhf        Bluetooth ALSA Audio backend
ii  bluej                                 3.1.7b                             all          A simple but powerful Java IDE.
rc  blueman                               2.0.4-1+b4                         armhf        Graphical bluetooth manager
ii  bluetooth                             5.43-2+rpt2+deb9u2                 all          Bluetooth support
ii  bluez                                 5.43-2+rpt2+deb9u2                 armhf        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-3+rpt7                         all          Firmware for Bluetooth devices
ii  bluez-hcidump                         5.43-2+rpt2+deb9u2                 armhf        Analyses Bluetooth HCI packets
ii  bluez-obexd                           5.43-2+rpt2+deb9u2                 armhf        bluez obex daemon
ii  libbluetooth3:armhf                   5.43-2+rpt2+deb9u2                 armhf        Library to use the BlueZ Linux Bluetooth stack
ii  lxplug-bluetooth                      0.6                                armhf        Bluetooth plugin for lxpanel
ii  pi-bluetooth                          0.1.10                             all          Raspberry Pi 3 bluetooth


2) Ich benutze das PRESENCE-Modul nur für den Gigaset Keeper, der Modus steht auf "lan-bluetooth", das vollständige device-list ist im ersten Post.
3) Da es bisher noch gar nicht richtig funktioniert hat mit dem presence-Status habe ich den Batterieteil noch gar nicht umgesetzt
4) Hier der Log ab Boot-Zeitpunkt bis zum dauerhaften "absent", dieses mal hat es 2x hin- und hergewechselt.
Der BT-Tag liegt einen knappen Meter vom Raspberry entfernt, an der Reichweite sollte es also nicht liegen...

22:42:42 3: Opening Keeper_Flo device 127.0.0.1:5333
22:42:42 5: SW: 58:9E:C6:09:D5:45|10
22:42:42 3: Keeper_Flo device opened
22:42:42 0: Featurelevel: 5.9
22:42:42 0: Server started with 208 defined entities (fhem.pl:20415/2019-10-27 perl:5.024001 os:linux user:fhem pid:904)
22:42:42 5: PRESENCE (Keeper_Flo) - received data: command accepted
22:42:42 5: PRESENCE (Keeper_Flo) - received data: present;device_name=Gigaset keeper;rssi=-63;model=lan-lepresenced;daemon=lepresenced V0.9
22:42:59 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:09 5: PRESENCE (Keeper_Flo) - received data: present;device_name=Gigaset keeper;rssi=-64;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:19 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:29 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:39 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:49 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:43:59 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:44:09 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:44:19 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:44:29 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:44:39 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9
22:44:49 5: PRESENCE (Keeper_Flo) - received data: absence;rssi=unreachable;model=lan-lepresenced;daemon=lepresenced V0.9


Vielen Dank schon mal für die Unterstützung!

PatrickR

#7
Hi!

Zitat von: zontorro am 07 Januar 2020, 22:50:50
1)
pi@fhempi:~ $ dpkg -l|egrep '(hci|blue)'
rc  bluealsa                              0.9                                armhf        Bluetooth ALSA Audio backend
ii  bluej                                 3.1.7b                             all          A simple but powerful Java IDE.
rc  blueman                               2.0.4-1+b4                         armhf        Graphical bluetooth manager
ii  bluetooth                             5.43-2+rpt2+deb9u2                 all          Bluetooth support
ii  bluez                                 5.43-2+rpt2+deb9u2                 armhf        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-3+rpt7                         all          Firmware for Bluetooth devices
ii  bluez-hcidump                         5.43-2+rpt2+deb9u2                 armhf        Analyses Bluetooth HCI packets
ii  bluez-obexd                           5.43-2+rpt2+deb9u2                 armhf        bluez obex daemon
ii  libbluetooth3:armhf                   5.43-2+rpt2+deb9u2                 armhf        Library to use the BlueZ Linux Bluetooth stack
ii  lxplug-bluetooth                      0.6                                armhf        Bluetooth plugin for lxpanel
ii  pi-bluetooth                          0.1.10                             all          Raspberry Pi 3 bluetooth

Da ist noch einiges installiert, was nicht (für lepresenced) benötigt wird und ggf. Nebenwirkungen verursacht.

Zitat von: zontorro am 07 Januar 2020, 22:50:50
22:42:42 3: Opening Keeper_Flo device 127.0.0.1:5333
22:42:42 5: SW: 58:9E:C6:09:D5:45|10
22:42:42 3: Keeper_Flo device opened
22:42:42 0: Featurelevel: 5.9
22:42:42 0: Server started with 208 defined entities (fhem.pl:20415/2019-10-27 perl:5.024001 os:linux user:fhem pid:904)
22:42:42 5: PRESENCE (Keeper_Flo) - received data: command accepted
[...]


Das FHEM-Log ist leider keine gute Quelle für Informationen. lepresenced loggt ins Syslog:

grep lepresenced /var/log/syslog

Bitte auf jeden Fall vorher den Loglevel auf LOG_DEBUG setzen. Dafür musst Du - wenn Du das Paket verwendest - in /etc/default/lepresenced die Zeile

#SYSLOG_LEVEL="LOG_WARNING"

in

SYSLOG_LEVEL="LOG_DEBUG"

ändern. Achtung, das Hashzeichen am Anfang muss auch weg. Dann lepresenced neu starten und ihn loggen lassen bis das Problem auftritt. Den Log-Level solltest Du auf jeden Fall später zurücksetzen, damit die SD-Karte nicht überstrapaziert wird.

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

zontorro

So jetzt hab ich alles leergeräumt und anschließend lepresence0.9-1 neu installiert, da bei der Installation unerfüllte Abhängkeiten zu libnet-server-perl, bluez und bluez-hcidump anmeckert habe ich diese durch "apt --fix-broken install" installiert.
Jetzt sieht das dpkg-listing so aus:
root@fhempi:/home/pi# dpkg -l|egrep '(hci|blue)'
ii  bluez                                 5.43-2+rpt2+deb9u2                 armhf        Bluetooth tools and daemons
ii  bluez-hcidump                         5.43-2+rpt2+deb9u2                 armhf        Analyses Bluetooth HCI packets


Jetzt ist der Keeper dauerhaft (auch direkt nach dem Reboot) auf absent.
Ein "hcitool lescan" wird mit "Could not open device: No such device" beantwortet.
root@fhempi:/home/pi# hcitool lescan
Could not open device: No such device


Ausgabe im syslog:

root@fhempi:/home/pi# grep lepresenced /var/log/syslog
22:12:19 fhempi systemd[1]: Starting lepresenced...
22:12:29 fhempi systemd[1]: Started lepresenced.
22:12:29 fhempi lepresenced[1192]: [tid:0] main: Version 0.9 started (device: hci0, listen addr: 0.0.0.0, listen port: 5333, daemonize: 0, legacy mode: 0, rssi threshold: 10, log level: 7, debug: 0).
22:12:29 fhempi lepresenced[1192]: [tid:0] main::sanity_check: md5 digest of '/usr/sbin/lepresenced' is: efa3c9088eddd1bdbc428cf52c6562d1.
22:12:29 fhempi lepresenced[1192]: [tid:0] main::sanity_check: hciconfig found at '/bin/hciconfig'.
22:12:29 fhempi lepresenced[1192]: [tid:0] main::sanity_check: hcitool found at '/usr/bin/hcitool'.
22:12:29 fhempi lepresenced[1192]: [tid:0] main::sanity_check: hcidump found at '/usr/bin/hcidump'.
22:12:30 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:30 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:30 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:31 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:31 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:31 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:32 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:32 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:32 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:33 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:33 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:33 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:34 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:34 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:34 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:35 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:35 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:35 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:36 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:36 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:36 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:37 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:37 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:37 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:38 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:38 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:38 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:39 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:39 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:39 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:40 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:40 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:40 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:40 fhempi lepresenced[1192]: [tid:0] main: Connection from 127.0.0.1:38152. Connected clients: 1.
22:12:40 fhempi lepresenced[1192]: [tid:0] main::handle_command: Received query for mac address 58:9e:c6:09:d5:45, interval: 10. Adding client 127.0.0.1:38152 to clients list.
22:12:40 fhempi lepresenced[1192]: [tid:0] main: Connection from 127.0.0.1:38154. Connected clients: 2.
22:12:40 fhempi lepresenced[1192]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
22:12:41 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:41 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:41 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:42 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:42 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:42 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:43 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:43 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:43 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:44 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:44 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:44 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...
22:12:45 fhempi lepresenced[1192]: [tid:2] main::bluetooth_dump_thread: hcidump exited, retrying...
22:12:45 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: Received unknown output: 'Invalid device: No such device'!
22:12:45 fhempi lepresenced[1192]: [tid:1] main::bluetooth_scan_thread: hcitool exited, retrying...


Ich vermute jetzt fehlt das pi-bluetooth Paket? Direkt nach Installieren des pi-bluetooth-Pakets wechselt der Keeper wieder wie bisher nach ~30s auf absent.

syslog:

23:04:35 fhempi systemd[1]: Starting lepresenced...
23:04:45 fhempi systemd[1]: Started lepresenced.
23:04:45 fhempi lepresenced[1242]: [tid:0] main: Version 0.9 started (device: hci0, listen addr: 0.0.0.0, listen port: 5333, daemonize: 0, legacy mode: 0, rssi threshold: 10, log level: 7, debug: 0).
23:04:45 fhempi lepresenced[1242]: [tid:0] main::sanity_check: md5 digest of '/usr/sbin/lepresenced' is: 79a271f5171f90ef5b0e9f0e1258a431.
23:04:45 fhempi lepresenced[1242]: [tid:0] main::sanity_check: hciconfig found at '/bin/hciconfig'.
23:04:45 fhempi lepresenced[1242]: [tid:0] main::sanity_check: hcitool found at '/usr/bin/hcitool'.
23:04:45 fhempi lepresenced[1242]: [tid:0] main::sanity_check: hcidump found at '/usr/bin/hcidump'.
23:04:45 fhempi lepresenced[1242]: [tid:1] main::bluetooth_scan_thread: Received 'LE Scan ...'.
23:04:57 fhempi lepresenced[1242]: [tid:0] main: Connection from 127.0.0.1:36250. Connected clients: 1.
23:04:57 fhempi lepresenced[1242]: [tid:0] main::handle_command: Received query for mac address 58:9e:c6:09:d5:45, interval: 10. Adding client 127.0.0.1:36250 to clients list.
23:04:57 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 0/1, max age: 10, rssi: -63, result: present.
23:05:12 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 9/9, max age: 10, rssi: -62, result: present.
23:05:22 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 4/4, max age: 10, rssi: -61, result: present.
23:05:32 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
23:05:42 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
[...]
23:09:42 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
23:09:46 fhempi lepresenced[1242]: [tid:0] main::stats_task: Active clients: 1, known devices: 12 (min/max age: 267/273), received beacons (hcitool/hcidump/difference): 2945/393/2552
23:09:52 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
23:10:02 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.


dpkg-list nach pi-bluetooth install:
root@fhempi:/home/pi# dpkg -l|egrep '(hci|blue)'
ii  bluez                                 5.43-2+rpt2+deb9u2                 armhf        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-3+rpt7                         all          Firmware for Bluetooth devices
ii  bluez-hcidump                         5.43-2+rpt2+deb9u2                 armhf        Analyses Bluetooth HCI packets
ii  pi-bluetooth                          0.1.10                             all          Raspberry Pi 3 bluetooth

PatrickR

Zitat von: zontorro am 08 Januar 2020, 23:13:51
Ich vermute jetzt fehlt das pi-bluetooth Paket? Direkt nach Installieren des pi-bluetooth-Pakets wechselt der Keeper wieder wie bisher nach ~30s auf absent.

[...]

dpkg-list nach pi-bluetooth install:
root@fhempi:/home/pi# dpkg -l|egrep '(hci|blue)'
ii  bluez                                 5.43-2+rpt2+deb9u2                 armhf        Bluetooth tools and daemons
ii  bluez-firmware                        1.2-3+rpt7                         all          Firmware for Bluetooth devices
ii  bluez-hcidump                         5.43-2+rpt2+deb9u2                 armhf        Analyses Bluetooth HCI packets
ii  pi-bluetooth                          0.1.10                             all          Raspberry Pi 3 bluetooth

Du hast Recht. pi-bluetooth fehlt tatsächlich als Dependency im Paket. Jetzt sieht es aber gut aus.

Zitat von: zontorro am 08 Januar 2020, 23:13:51
syslog:

23:04:35 fhempi systemd[1]: Starting lepresenced...
23:04:45 fhempi systemd[1]: Started lepresenced.
23:04:45 fhempi lepresenced[1242]: [tid:0] main: Version 0.9 started (device: hci0, listen addr: 0.0.0.0, listen port: 5333, daemonize: 0, legacy mode: 0, rssi threshold: 10, log level: 7, debug: 0).
[...]
23:09:42 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
23:09:46 fhempi lepresenced[1242]: [tid:0] main::stats_task: Active clients: 1, known devices: 12 (min/max age: 267/273), received beacons (hcitool/hcidump/difference): 2945/393/2552
23:09:52 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
23:10:02 fhempi lepresenced[1242]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.

Was man auch gut sieht, ist, dass hcitool deutlich mehr (2945) Beacons sieht als hcidump (393). Das werde ich mal als weiteren Indikator für (D)ein Problem im Hinterkopf behalten. Tausche doch mal bitte bei sonst unverändertem System das lepresenced-Skript durch das hier angehängte aus und starte den Dienst (oder den Pi) neu:

cp /usr/sbin/lepresenced{,.org}
cp lepresenced.0.91dev /usr/sbin
service lepresenced restart

Danach muss in FHEM das Reading "daemon" des PRESENCE-Devices "lepresenced V0.91dev1" sein. Dann bitte schauen, ob das Problem noch auftritt und sowohl bei ja als auch nein brauche ich ein Log mit LOG_DEBUG wie oben.

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

zontorro

Der cp[...]{,.org} von dir hat nicht bewirkt, dass in fhem 0.91dev1 als daemon steht. Deswegen habe ich das existierende "lepresenced"-file gesichert und durch deines überschrieben. Anschließend kam irgendein access-denied-Fehler -> ich habe mit chmod die Berechtigungen von "-rw-r--r--" auf "-rwxr--r--" gedreht, so wie das Original-Skript war.

Funktioniert leider immer noch nicht, weiterhin kurz auf present und anschließend auf absent.

21:40:20 fhempi systemd[1]: Starting lepresenced...
21:40:30 fhempi systemd[1]: Started lepresenced.
21:40:30 fhempi lepresenced[1221]: [tid:0] main: Version 0.91dev1 started (device: hci0, listen addr: 0.0.0.0, listen port: 5333, daemonize: 0, legacy mode: 0, rssi threshold: 10, log level: 7, debug: 0).
21:40:30 fhempi lepresenced[1221]: [tid:0] main::sanity_check: md5 digest of '/usr/sbin/lepresenced' is: 7d51ceee533bf831a61f5c69a34922c9.
21:40:30 fhempi lepresenced[1221]: [tid:0] main::sanity_check: hciconfig found at '/bin/hciconfig'.
21:40:30 fhempi lepresenced[1221]: [tid:0] main::sanity_check: hcitool found at '/usr/bin/hcitool'.
21:40:30 fhempi lepresenced[1221]: [tid:0] main::sanity_check: hcidump found at '/usr/bin/hcidump'.
21:40:30 fhempi lepresenced[1221]: [tid:1] main::bluetooth_scan_thread: Received 'LE Scan ...'.
21:40:41 fhempi lepresenced[1221]: [tid:0] main: Connection from 127.0.0.1:59196. Connected clients: 1.
21:40:41 fhempi lepresenced[1221]: [tid:0] main::handle_command: Received query for mac address 58:9e:c6:09:d5:45, interval: 10. Adding client 127.0.0.1:59196 to clients list.
21:40:41 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 1/1, max age: 10, rssi: -64, result: present.
21:40:58 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 10/10, max age: 10, rssi: -64, result: present.
21:41:08 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, ages: 8/9, max age: 10, rssi: -63, result: present.
21:41:18 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
21:41:28 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
21:41:38 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
21:41:48 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
21:41:58 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.
21:42:08 fhempi lepresenced[1221]: [tid:0] main: Sending update for mac address 58:9e:c6:09:d5:45, max age: 10, result: absence.


Kleine Anmerkung:
Ich habe den Keeper, wie in der Anleitung die ich gefunden habe beschrieben ist, mit dem Raspberry gepairt. Kann das Probleme verursachen? Ich hätte noch einen weiteren ungepairten Keeper rumliegen. Ich befürchte jedoch, dass sich der Keeper im ungepairten Zustand nach einer gewissen Zeit ausschaltet und er durch Drücken des Knopfes wieder gestartet werden muss. Zumindest verschwindet er im BLE Scanner nach 2min.
Der gepairte Keeper ist dauerhaft auffindbar.

zontorro

Nachtrag:
Den ungepairten Keeper habe ich jetzt im "wachen" Zustand in FHEM wiefolgt definiert:
define Keeper_unpaired PRESENCE lan-bluetooth xx:xx:xx:xx:xx:xx 127.0.0.1:5333    60

Das Verhalten ist identisch wie beim gepairten Keeper.

juemuc

Hallo zontorro,

reicht ein PRESENCE local-bluetooth nicht aus?
Bei mir ist das Smartphone so eingebunden.

Viele Grüße
Jürgen
3x Sonos Play 1, 1x Sonos Arc + Sub, 1 Sonos-One, 1x Sonos Playbar
FB6690 + FB7490 mit 4x Dect 200 und 3 Dect-ULE-Thermostate,  raspberry3B+, HM Funkmodul HM-MOD-RPI-PCB, HM Klingelsensor HM-Sen-DB-PCB, HM (IP) Fensterkontakte und  Amazon Echo Dot,  piVCCU, pi OS (bookworm).

PatrickR

Zitat von: juemuc am 09 Januar 2020, 22:03:09
reicht ein PRESENCE local-bluetooth nicht aus?
Bei mir ist das Smartphone so eingebunden.
Dein Smartphone ist kein Bluetooth-LE-Gerät, der Keeper schon.

Patrick


Von unterwegs gesendet.
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

PatrickR

@Zontorro: Schaue mir das morgen nochmal näher an. Was noch helfen würde wäre ein Log, in dem mindestens eine stats_task-Zeile nach dem Problem auftaucht.

Ich habe auch einen Keeper, der aber nicht mit dem Pi gepaart ist. Weitere Erfahrungen habe ich leider nicht.


Von unterwegs gesendet.
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