PRESENCE bluetooth functioniert nicht mit mehere zeilen

Begonnen von soulman, 26 November 2023, 15:06:00

Vorheriges Thema - Nächstes Thema

soulman

Sowohl mit Fhem 6.0 als mit 6.2 ( 6.0 unter debian 11 , 6.2 unter Debian 12 )
Eins functioniert:
define gsm_gert PRESENCE local-bluetooth MAC-address

noch eine zeile dabei: immer absent
log mit eine zeile:
2023.11.26 14:49:30 4: PRESENCE (gsm_gert) - executing: which hcitool
2023.11.26 14:49:30 4: PRESENCE (gsm_gert) - 'which hcitool' returns: /usr/bin/hcitool

2023.11.26 14:49:30 5: PRESENCE (gsm_gert) - executing: hcitool name F0:8A:76:47:E5:11
2023.11.26 14:49:31 4: PRESENCE (gsm_gert) - hcitool returned: Galaxy S9

Log mit zwei zeilen:
2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - stopping timer
2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - starting blocking call for mode local-bluetooth
2023.11.26 14:50:08 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (1979), uses telnetPort to connect back
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - stopping timer
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - starting blocking call for mode local-bluetooth
2023.11.26 14:50:08 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (1980), uses telnetPort to connect back
2023.11.26 14:50:08 4: Connection accepted from telnetPort_127.0.0.1_39230
2023.11.26 14:50:08 5: Cmd: >{BlockingRegisterTelnet($cl,1)}<
2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - starting bluetooth scan: gsm_gert|F0:8A:76:47:E5:11|0|
2023.11.26 14:50:08 4: Connection accepted from telnetPort_127.0.0.1_39246
2023.11.26 14:50:08 5: Cmd: >{BlockingRegisterTelnet($cl,2)}<
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - starting bluetooth scan: gsm_leny|90:81:75:AB:EB:C1|0|
2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - found standard variant of ps command, using "ax" as parameter
2023.11.26 14:50:08 4: PRESENCE (gsm_gert) - executing: which hcitool
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - found standard variant of ps command, using "ax" as parameter
2023.11.26 14:50:08 4: PRESENCE (gsm_leny) - executing: which hcitool
2023.11.26 14:50:08 4: PRESENCE (gsm_leny) - 'which hcitool' returns: /usr/bin/hcitool

2023.11.26 14:50:08 4: PRESENCE (gsm_gert) - 'which hcitool' returns: /usr/bin/hcitool

2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - executing: hcitool name F0:8A:76:47:E5:11
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - executing: hcitool name 90:81:75:AB:EB:C1
2023.11.26 14:50:08 4: PRESENCE (gsm_leny) - hcitool returned:
2023.11.26 14:50:08 4: PRESENCE (gsm_gert) - hcitool returned:
2023.11.26 14:50:08 5: Cmd: >{BlockingStart('2')}<
2023.11.26 14:50:08 5: Cmd: >{BlockingStart('1')}<
2023.11.26 14:50:08 5: Cmd: >{PRESENCE_ProcessLocalScan('gsm_gert|0|absent')}<
2023.11.26 14:50:08 5: PRESENCE (gsm_gert) - blocking scan result: gsm_gert|0|absent
2023.11.26 14:50:08 5: Starting notify loop for gsm_gert, 2 event(s), first is absent
2023.11.26 14:50:08 5: createNotifyHash
2023.11.26 14:50:08 5: End notify loop for gsm_gert
2023.11.26 14:50:08 4: PRESENCE (gsm_gert) - rescheduling next check in 10 seconds
2023.11.26 14:50:08 5: Cmd: >{PRESENCE_ProcessLocalScan('gsm_leny|0|absent')}<
2023.11.26 14:50:08 5: PRESENCE (gsm_leny) - blocking scan result: gsm_leny|0|absent
2023.11.26 14:50:08 5: Starting notify loop for gsm_leny, 2 event(s), first is absent
2023.11.26 14:50:08 5: End notify loop for gsm_leny
2023.11.26 14:50:08 4: PRESENCE (gsm_leny) - rescheduling next check in 10 seconds
.

kadettilac89

Zitat von: soulman am 26 November 2023, 15:06:00Sowohl mit Fhem 6.0 als mit 6.2 ( 6.0 unter debian 11 , 6.2 unter Debian 12 )
Eins functioniert:
define gsm_gert PRESENCE local-bluetooth MAC-address

noch eine zeile dabei: immer absent

was ist "eine zeile dabei". Poste deine Definition dann bekommst du vielleicht Hilfe. Generell hilfreich das im Eröffnungspost gleich mitzuteilen.

soulman

Ich meine 2 definitionen von handy's , und dachte dass man das wohl sehen konn aus dem log.

define gsm_gert PRESENCE local-bluetooth F0:8A:76:47:E5:11 10 60
setuuid gsm_gert 6570a8ad-f33f-872f-4d14-e00bcc45fad50506

define gsm_leny PRESENCE local-bluetooth 90:81:75:AB:EB:C1 10 60

kadettilac89

Zitat von: soulman am 13 Dezember 2023, 12:12:54Ich meine 2 definitionen von handy's , und dachte dass man das wohl sehen konn aus dem log.
Das ist nur Raten wenn man keine Details hat

Welche Hardware, aktuelles Betriebssystem? Bluetooth intern oder USB? Andere Bluetooth Devices gepaired oder anderen Tools/Programme die Bluetooth verwenden?

Teste mal höhere Auflösung als 10 Sekunden, z. B. 120. Der Test braucht den Bluetooth Stack exclusive und der Bluetooth Ping dauert selbst ein paar Sekunden.


soulman

Debian 12, Intel Nuc I5 , interner bluetooth, nichts anderes angebunden.
hcitool kent beide handy's
fhem.cfg nur handy A  -> Gut.
fhem.cfg nur handy B  -> Gut.

Beide handys -> wie geschrieben -> absent

2023.12.17 14:02:47 5: PRESENCE (gsm_leny) - executing: hcitool name 90:81:75:AB:EB:C1
2023.12.17 14:02:47 5: PRESENCE (gsm_gert) - executing: hcitool name F0:8A:76:47:E5:11
2023.12.17 14:02:47 4: PRESENCE (gsm_leny) - hcitool returned:
2023.12.17 14:02:47 4: PRESENCE (gsm_gert) - hcitool returned:
2023.12.17 14:02:47 5: Cmd: >{BlockingStart('2')}<
2023.12.17 14:02:47 5: Cmd: >{BlockingStart('1')}<
2023.12.17 14:02:47 5: Cmd: >{PRESENCE_ProcessLocalScan('gsm_gert|0|absent')}<
2023.12.17 14:02:47 5: PRESENCE (gsm_gert) - blocking scan result: gsm_gert|0|absent
2023.12.17 14:02:47 5: Starting notify loop for gsm_gert, 2 event(s), first is absent
2023.12.17 14:02:47 5: createNotifyHash
2023.12.17 14:02:47 5: End notify loop for gsm_gert

Otto123

Was gibt Dirversion PRESENCE.pm in der FHEM Kommandozeile zurück?
Bitte poste die Ausgabe von
list gsm_lenyund list gsm_gert
Bitte in Codetags, weitere Info unter: https://forum.fhem.de/index.php/topic,71806.0.html

Bei mir sehen die Logeinträge von PRESENCE local-bluetooth völlig anders aus. ::) Das scannen von mehreren Handys ist kein Problem. Für sinnlos halte ich Deine definition mit alle 10 Sekunden, aber sollte schon gehen wenn es sonst nichts tut.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

soulman

73_PRESENCE.pm 20782 2019-12-19 10:51:06Z markusbloch

fhemweb.js                 23453 2021-01-01 18:10:12Z rudolfkoenig

NICHT zu fassen:
Ich hatte fhem.cfg ge-edit und selber den define eingefügt ( 1 gsm functioniert )
2. dabei -> functioniert nicht.

ABER
Wenn ich den definition in der FHEM Kommandozeile einfüge geht es gut !
2, dabei , und functioniert auch !!

soulman

zu früh gejubelt
Beim neustart geht es wieder falsch, sieht so aus dass sie dann gleichzeitig gescand werden.
Wenn ich einfuge im commandzeile ist da naturlich zeit zwischen

Otto123

Zitat von: soulman am 17 Dezember 2023, 17:39:20Wenn ich den definition in der FHEM Kommandozeile einfüge geht es gut !
Und wenn Du danach auch noch save drückst? Vor dem Neustart?

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

soulman

Ich hatte schon auf save geclickt. Also in fhem.cfg stehen 2 definitionen.
Es seht so aus dass linux nicht gleichzeitig mehrere hcitools ausfuhren kann.
Wenn ich zufüge auf dem Kommandozeile geht es gut, bei neustart nicht:
2023.12.18 09:49:30 5: PRESENCE (gsm_gert) - stopping timer
2023.12.18 09:49:30 5: PRESENCE (gsm_gert) - starting blocking call for mode local-bluetooth
2023.12.18 09:49:30 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (1532), uses telnetPort to connect back
2023.12.18 09:49:30 5: PRESENCE (gsm_leny) - stopping timer
2023.12.18 09:49:30 5: PRESENCE (gsm_leny) - starting blocking call for mode local-bluetooth
2023.12.18 09:49:30 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (1533), uses telnetPort to connect back
2023.12.18 09:49:30 4: Connection accepted from telnetPort_127.0.0.1_40758
2023.12.18 09:49:30 5: Cmd: >{BlockingRegisterTelnet($cl,1)}<
2023.12.18 09:49:30 5: PRESENCE (gsm_gert) - starting bluetooth scan: gsm_gert|F0:8A:76:47:E5:11|0|
2023.12.18 09:49:30 4: Connection accepted from telnetPort_127.0.0.1_40762
2023.12.18 09:49:30 5: Cmd: >{BlockingRegisterTelnet($cl,2)}<
2023.12.18 09:49:30 5: PRESENCE (gsm_leny) - starting bluetooth scan: gsm_leny|90:81:75:AB:EB:C1|0|
2023.12.18 09:49:30 5: PRESENCE (gsm_gert) - found standard variant of ps command, using "ax" as parameter
2023.12.18 09:49:30 5: PRESENCE (gsm_leny) - found standard variant of ps command, using "ax" as parameter
2023.12.18 09:49:30 4: PRESENCE (gsm_leny) - executing: which hcitool
2023.12.18 09:49:30 4: PRESENCE (gsm_gert) - executing: which hcitool
2023.12.18 09:49:30 4: PRESENCE (gsm_leny) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 09:49:30 4: PRESENCE (gsm_gert) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 09:49:30 5: PRESENCE (gsm_leny) - executing: hcitool name 90:81:75:AB:EB:C1
2023.12.18 09:49:30 5: PRESENCE (gsm_gert) - executing: hcitool name F0:8A:76:47:E5:11
2023.12.18 09:49:31 4: PRESENCE (gsm_gert) - hcitool returned:
2023.12.18 09:49:31 4: PRESENCE (gsm_leny) - hcitool returned:

Otto123

Zitat von: soulman am 18 Dezember 2023, 09:51:38Es seht so aus dass linux nicht gleichzeitig mehrere hcitools ausfuhren kann.
gleichzeitig sowieso nicht ...

Für mich sieht es so aus, als ob Deine Konfiguration durch manuelles editieren zum Schrott geworden ist. Die Logfile Einträge die Du zeigst, kann ich nicht nachvollziehen, das sieht bei mehreren PRESENCE Definitionen bei mir völlig ander aus.
Zitat von: soulman am 18 Dezember 2023, 09:51:38Wenn ich zufüge auf dem Kommandozeile geht es gut, bei neustart nicht:
Auch nach der Aussage meine ich: Deine fhem.cfg ist Schrott, es wird vom System versucht beim Start etwas zu laden der Rest bleibt unberücksichtigt.
Wenn Du die Definition in der FHEM Kommandozeile mit Syntaxprüfung machst, ist die Online Konfiguration in Ordnung und funktioniert.  ;)

Solange zwischen Fragen und bitten um Info und dem was Du anschließend postest eine derartige Diskrepanz herrscht können wir noch ewig weiter raten was nicht in Ordnung ist. Am Linux und am FHEM liegt es jedenfalls mit ziemlicher Sicherheit nicht. ;D

Guter Rat:
  • hole Dir eine neue initiale fhem.cfg (https://svn.fhem.de/fhem/trunk/fhem/fhem.cfg),
  • setze die Rechte so das user fhem lesen und schreiben kann, lass das die Finger ansonsten von der Datei und
  • teste Deine gewünschte Konfiguration durch FHEM Kommandozeile und save. 
Falls es sinnvolle Dinge in deiner alten fhem.cfg gab, die übernommen werden sollen, dann tu dies Stück für Stück, Block für Block mit der Raw Definition (mit Syntaxprüfung).
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

kadettilac89

Führe mal auf dem OS folgendes aus und poste den Output

sudo hcitool device

und wenn beide Handy in der Nähe sind
sudo hcitool scan

Hast du einen Bluetooth USB Stick? Ich hatte einen NUC dessen internes Bluetooth nie richtig funktioneirt hatte, ein externer Stick jedoch tadellos.

Und hast du mal 120 Sekunden statt 10 getestet wie schon mal gefragt? Was war das Ergebnis - Log?

soulman

hcitool device:
Devices:
        hci0    34:13:E8:28:98:A7
hcitool scan
Scanning ...
        0C:96:E6:0E:92:C8       Woonkamer-TV
Scan gibt also nicht den Handy.
Hatte schon die zeit auf 120 Sekunden gesezt.


Neue fhem.cfg  gibt dasselbe problem
define gsm_leny PRESENCE local-bluetooth 90:81:75:AB:EB:C1 120 120
setuuid gsm_leny 658041f5-f33f-872f-bb60-1b229f7d561556e7
define gsm_gert PRESENCE local-bluetooth F0:8A:76:47:E5:11 120 120
setuuid gsm_gert 6580427d-f33f-872f-f688-b963390847e4b632

Meine log ist mit debug modus !!!
So wie Sie untenstehend sehen können wirden beide gleichzeitig ausgeführt.

2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - stopping timer
2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - starting blocking call for mode local-bluetooth
2023.12.18 14:05:41 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (3457), uses telnetForBlockingFn_1702904621.09019 to connect back
2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - stopping timer
2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - starting blocking call for mode local-bluetooth
2023.12.18 14:05:41 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (3458), uses telnetForBlockingFn_1702904621.09019 to connect back
2023.12.18 14:05:41 4: Connection accepted from telnetForBlockingFn_1702904621.09019_127.0.0.1_48414
2023.12.18 14:05:41 5: Cmd: >{BlockingRegisterTelnet($cl,3)}<
2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - starting bluetooth scan: gsm_leny|90:81:75:AB:EB:C1|0|
2023.12.18 14:05:41 4: Connection accepted from telnetForBlockingFn_1702904621.09019_127.0.0.1_48428
2023.12.18 14:05:41 5: Cmd: >{BlockingRegisterTelnet($cl,4)}<
2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - starting bluetooth scan: gsm_gert|F0:8A:76:47:E5:11|0|
2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - found standard variant of ps command, using "ax" as parameter
2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - found standard variant of ps command, using "ax" as parameter
2023.12.18 14:05:41 4: PRESENCE (gsm_gert) - executing: which hcitool
2023.12.18 14:05:41 4: PRESENCE (gsm_leny) - executing: which hcitool
2023.12.18 14:05:41 4: PRESENCE (gsm_leny) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 14:05:41 4: PRESENCE (gsm_gert) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - executing: hcitool name F0:8A:76:47:E5:11
2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - executing: hcitool name 90:81:75:AB:EB:C1
2023.12.18 14:05:41 4: PRESENCE (gsm_gert) - hcitool returned:
2023.12.18 14:05:41 4: PRESENCE (gsm_leny) - hcitool returned:
2023.12.18 14:05:41 5: Cmd: >{BlockingStart('4')}<
2023.12.18 14:05:41 5: Cmd: >{BlockingStart('3')}<
2023.12.18 14:05:41 5: Cmd: >{PRESENCE_ProcessLocalScan('gsm_leny|0|absent')}<
2023.12.18 14:05:41 5: PRESENCE (gsm_leny) - blocking scan result: gsm_leny|0|absent
2023.12.18 14:05:41 5: Starting notify loop for gsm_leny, 2 event(s), first is absent
2023.12.18 14:05:41 5: createNotifyHash
2023.12.18 14:05:41 5: End notify loop for gsm_leny
2023.12.18 14:05:41 4: PRESENCE (gsm_leny) - rescheduling next check in 120 seconds
2023.12.18 14:05:41 5: Cmd: >{PRESENCE_ProcessLocalScan('gsm_gert|0|absent')}<
2023.12.18 14:05:41 5: PRESENCE (gsm_gert) - blocking scan result: gsm_gert|0|absent
2023.12.18 14:05:41 5: Starting notify loop for gsm_gert, 2 event(s), first is absent
2023.12.18 14:05:41 5: End notify loop for gsm_gert
2023.12.18 14:05:41 4: PRESENCE (gsm_gert) - rescheduling next check in 120 seconds
2023.12.18 14:07:41 5: PRESENCE (gsm_leny) - stopping timer
2023.12.18 14:07:41 5: PRESENCE (gsm_leny) - starting blocking call for mode local-bluetooth
2023.12.18 14:07:41 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (3480), uses telnetForBlockingFn_1702904621.09019 to connect back
2023.12.18 14:07:41 5: PRESENCE (gsm_gert) - stopping timer
2023.12.18 14:07:41 5: PRESENCE (gsm_gert) - starting blocking call for mode local-bluetooth
2023.12.18 14:07:41 4: BlockingCall (PRESENCE_DoLocalBluetoothScan): created child (3481), uses telnetForBlockingFn_1702904621.09019 to connect back
2023.12.18 14:07:41 4: Connection accepted from telnetForBlockingFn_1702904621.09019_127.0.0.1_36252
2023.12.18 14:07:41 4: Connection accepted from telnetForBlockingFn_1702904621.09019_127.0.0.1_36264
2023.12.18 14:07:41 5: Cmd: >{BlockingRegisterTelnet($cl,5)}<
2023.12.18 14:07:41 5: Cmd: >{BlockingRegisterTelnet($cl,6)}<
2023.12.18 14:07:41 5: PRESENCE (gsm_leny) - starting bluetooth scan: gsm_leny|90:81:75:AB:EB:C1|0|
2023.12.18 14:07:41 5: PRESENCE (gsm_gert) - starting bluetooth scan: gsm_gert|F0:8A:76:47:E5:11|0|
2023.12.18 14:07:41 5: PRESENCE (gsm_gert) - found standard variant of ps command, using "ax" as parameter
2023.12.18 14:07:41 5: PRESENCE (gsm_leny) - found standard variant of ps command, using "ax" as parameter
2023.12.18 14:07:41 4: PRESENCE (gsm_gert) - executing: which hcitool
2023.12.18 14:07:41 4: PRESENCE (gsm_leny) - executing: which hcitool

und hcitool returned:  is leer !!

Otto123

Das log was
Zitat von: soulman am 18 Dezember 2023, 14:18:34Scan gibt also nicht den Handy.
Aber wie soll es denn dann in FHEM überhaupt funktionieren?

Was Du zeigst sieht verwirrend aus, alles startet in der gleichen Sekunde, das gibt es bei mir nicht:
2023.12.18 15:29:20 4: PRESENCE (BT_Mi11) - rescheduling next check in 60 seconds
2023.12.18 15:29:21 5: PRESENCE (BT_Mi6_B2) - executing: hcitool name 80:AD:16:E0:42:4C
2023.12.18 15:29:21 4: PRESENCE (BT_Mi6_B2) - hcitool returned: Mi Phone
2023.12.18 15:29:21 5: PRESENCE (BT_Mi6_B2) - blocking scan result: BT_Mi6_B2|0|present|Mi Phone
2023.12.18 15:29:21 4: PRESENCE (BT_Mi6_B2) - rescheduling next check in 60 seconds
2023.12.18 15:30:09 3: CUL_HM set PSD1_Sw off noArg
2023.12.18 15:30:20 5: PRESENCE (BT_Mi11) - stopping timer
2023.12.18 15:30:20 5: PRESENCE (BT_Mi11) - starting blocking call for mode local-bluetooth
2023.12.18 15:30:20 5: PRESENCE (BT_Mi11) - starting bluetooth scan: BT_Mi11|5C:D0:6E:E3:67:5F|0|
2023.12.18 15:30:20 5: PRESENCE (BT_Mi11) - found standard variant of ps command, using "ax" as parameter
2023.12.18 15:30:20 4: PRESENCE (BT_Mi11) - executing: which hcitool
2023.12.18 15:30:20 4: PRESENCE (BT_Mi11) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 15:30:20 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - stopping timer
2023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - starting blocking call for mode local-bluetooth
2023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - starting bluetooth scan: BT_Mi6_B2|80:AD:16:E0:42:4C|0|
2023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - found standard variant of ps command, using "ax" as parameter
2023.12.18 15:30:21 4: PRESENCE (BT_Mi6_B2) - executing: which hcitool
2023.12.18 15:30:21 4: PRESENCE (BT_Mi6_B2) - 'which hcitool' returns: /usr/bin/hcitool

2023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:22 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:23 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:25 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:26 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:27 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:28 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:30 5: PRESENCE (BT_Mi11) - executing: hcitool name 5C:D0:6E:E3:67:5F
2023.12.18 15:30:32 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:33 4: PRESENCE (BT_Mi11) - hcitool returned: Mi 11 Lite 5G
2023.12.18 15:30:33 5: PRESENCE (BT_Mi11) - blocking scan result: BT_Mi11|0|present|Mi 11 Lite 5G
2023.12.18 15:30:33 4: PRESENCE (BT_Mi11) - rescheduling next check in 60 seconds
2023.12.18 15:30:37 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:38 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:40 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:43 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:44 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:47 5: PRESENCE (BT_Mi6_B2) - executing: hcitool name 80:AD:16:E0:42:4C
2023.12.18 15:30:48 4: PRESENCE (BT_Mi6_B2) - hcitool returned: Mi Phone
2023.12.18 15:30:48 5: PRESENCE (BT_Mi6_B2) - blocking scan result: BT_Mi6_B2|0|present|Mi Phone
2023.12.18 15:30:48 4: PRESENCE (BT_Mi6_B2) - rescheduling next check in 60 seconds
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

kadettilac89

Zitat von: Otto123 am 18 Dezember 2023, 15:36:382023.12.18 15:30:21 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:22 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:23 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:25 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:26 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:27 5: PRESENCE (BT_Mi11) - another hcitool command is running. waiting...
2023.12.18 15:30:28 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...
2023.12.18 15:30:30 5: PRESENCE (BT_Mi11) - executing: hcitool name 5C:D0:6E:E3:67:5F
2023.12.18 15:30:32 5: PRESENCE (BT_Mi6_B2) - another hcitool command is running. waiting...

Bei dir ist der Bluetooth Stack blockiert. Solange ein anderer hcitool-Befehl oder was anders auf Bluetooth zuzgreift erzeugt er keinen "Blocking"-Call. Wenn der hci-Stack nicht exclusive bekommt macht er einen sekündlichen Loop bis Cound (10?) oder Zugriff erfolgt.
 Darum der sekündliche "another hcitool"-Eintrag.

TE: hast du mal den Server / Nuc durchgestartet? Kannst du mit einem anderen Server testen? Mögliche Ursache, Energiesparmodus vom Handy der Bluetooth schlafen legt und nicht auf Bluetooth-ping reagiert? Oder halt das selbe Probem welches ich auch hatte, Nuc-Interner Bluetooth ist ... höflich gesagt "blöd".

kadettilac89

damit du nicht immer in fhem config ändern muss ... fhem setzt folgenden Befehl auf dem OS ab. Den kannst du selber nutzen um zu testen

Aus deinem Log entnommen
sudo hcitool name F0:8A:76:47:E5:11
sudo hcitool name 90:81:75:AB:EB:C1

Solange das auf der Console nicht geht brauchst du in fhem überhaupt nicht weitermachen.

Otto123

Zitat von: kadettilac89 am 18 Dezember 2023, 15:48:46Bei dir ist der Bluetooth Stack blockiert.
Das ist mir klar (bei mir scannt er mehr als die Beiden ;) ) , aber vergleichbares sehe ich bei TE nicht? Der feuert einfach zwei Befehle ab.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

soulman

ZitatAber wie soll es denn dann in FHEM überhaupt funktionieren?
Wie gezeigt vorher gab hcitool name <MAC adresse>  immer dass richtige antwort.
Auch beim einführen im Kommando zeile ging es gut.
Dann ein save , und restart FHEM , und es war falsch !

Habe eine externe Bluetooth-dongle verwendet und.....
Jetz lauft es !!!!!!!!!!!!
verstehe nur nicht, dass er bei 2 bluetooth geräte , den richtigen nimmt.
Devices:
        hci1    00:15:83:16:BF:29
        hci0    34:13:E8:28:98:A7
Cheers

Otto123

Zitat von: soulman am 18 Dezember 2023, 19:36:22verstehe nur nicht, dass er bei 2 bluetooth geräte , den richtigen nimmt.
Naja Du gibst doch im define die MAC Adresse vor, diese wird getestet.

Allerdings sind die beiden jetzt völlig anders - MAC spoofing?
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

kadettilac89

Zitat von: soulman am 18 Dezember 2023, 19:36:22
ZitatAber wie soll es denn dann in FHEM überhaupt funktionieren?

Habe eine externe Bluetooth-dongle verwendet und.....
Jetz lauft es !!!!!!!!!!!!
verstehe nur nicht, dass er bei 2 bluetooth geräte , den richtigen nimmt.
Devices:
        hci1    00:15:83:16:BF:29
        hci0    34:13:E8:28:98:A7
Cheers

setze das Attribut
bluetoothHciDevice  hci1
dann nimmt er immer das externe

kadettilac89

Zitat von: Otto123 am 18 Dezember 2023, 19:39:43Allerdings sind die beiden jetzt völlig anders - MAC spoofing?
er meint den Bluetooth sender/empfänger nicht das Handy.

Otto123

Zitat von: kadettilac89 am 18 Dezember 2023, 19:49:40
Zitat von: Otto123 am 18 Dezember 2023, 19:39:43Allerdings sind die beiden jetzt völlig anders - MAC spoofing?
er meint den Bluetooth sender/empfänger nicht das Handy.
Jetzt sehe ich es  :-X  sorry
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz