ständig absent mit meinen g-tag

Begonnen von Pokerface007, 30 Dezember 2018, 20:49:13

Vorheriges Thema - Nächstes Thema

Pokerface007

Hallo, seit kurzen bin ich ständig auf absent mit meinen g-tag.
in der console sieht es so aus:
pi@raspberrypi:/opt/fhem $ sudo hciconfig hci0 down
pi@raspberrypi:/opt/fhem $ sudo hciconfig hci0 up
Can't init device hci0: Connection timed out (110)

und bei verbose 5 sieht es so aus:
Set scan parameters failed: Connection timed out
2018.12.30 20:25:08 5: PRESENCE (Bluetooth) - function returned with: 0
2018.12.30 20:25:08 5: PRESENCE (Bluetooth) - blocking scan result: Bluetooth|0|absent
2018.12.30 20:25:08 4: PRESENCE (Bluetooth) - rescheduling next check in 30 seconds
2018.12.30 20:25:38 5: PRESENCE (Bluetooth) - stopping timer
2018.12.30 20:25:38 5: PRESENCE (Bluetooth) - starting blocking call for mode function
2018.12.30 20:25:38 5: PRESENCE (Bluetooth) - execute perl function: Bluetooth|{`sudo /opt/fhem/lescan.sh 7C:2F:80:C4:57:87`}|0
Set scan parameters failed: Connection timed out
2018.12.30 20:25:49 5: PRESENCE (Bluetooth) - function returned with: 0
2018.12.30 20:25:49 5: PRESENCE (Bluetooth) - blocking scan result: Bluetooth|0|absent
2018.12.30 20:25:49 4: PRESENCE (Bluetooth) - rescheduling next check in 30 seconds
2018.12.30 20:26:19 5: PRESENCE (Bluetooth) - stopping timer
2018.12.30 20:26:19 5: PRESENCE (Bluetooth) - starting blocking call for mode function
2018.12.30 20:26:19 5: PRESENCE (Bluetooth) - execute perl function: Bluetooth|{`sudo /opt/fhem/lescan.sh 7C:2F:80:C4:57:87`}|0
Set scan parameters failed: Connection timed out

Kann mich da jemand unterstützen???
Danke Gruß Sven

Neuhier

Wenn Du als Server einen RPi3 hast:
shutdown -h now
Vom Strom trennen und nach 5min wieder anschließen.
Klappt zumindest bei meinem zuverlässig.

Pokerface007

#2
Ja ich habe einen Raspi 3 B. Allerdings funktioniert dein Tipp leider nicht bei mir. Allerdings hat sich bei der Fehlermeldung ein wenig geändert.

Set scan parameters failed: Input/output error
2018.12.30 21:55:40 5: PRESENCE (Bluetooth) - function returned with: 0
2018.12.30 21:55:40 5: PRESENCE (Bluetooth) - blocking scan result: Bluetooth|0|absent
2018.12.30 21:55:40 4: PRESENCE (Bluetooth) - rescheduling next check in 30 seconds
2018.12.30 21:56:10 5: PRESENCE (Bluetooth) - stopping timer
2018.12.30 21:56:10 5: PRESENCE (Bluetooth) - starting blocking call for mode function
2018.12.30 21:56:10 5: PRESENCE (Bluetooth) - execute perl function: Bluetooth|{`sudo /opt/fhem/lescan.sh 7C:2F:80:C4:57:87`}|0
Set scan parameters failed: Input/output error
2018.12.30 21:56:21 5: PRESENCE (Bluetooth) - function returned with: 0
2018.12.30 21:56:21 5: PRESENCE (Bluetooth) - blocking scan result: Bluetooth|0|absent
2018.12.30 21:56:21 4: PRESENCE (Bluetooth) - rescheduling next check in 30 seconds
2018.12.30 21:56:51 5: PRESENCE (Bluetooth) - stopping timer
2018.12.30 21:56:51 5: PRESENCE (Bluetooth) - starting blocking call for mode function
2018.12.30 21:56:51 5: PRESENCE (Bluetooth) - execute perl function: Bluetooth|{`sudo /opt/fhem/lescan.sh 7C:2F:80:C4:57:87`}|0

Gruß Sven

Neuhier

Ist der GTag eventuell aus Versehen mit irgendwas gepairt?
Oder mal ohne WLAN, nur BT laufen lassen?
Hin und wieder liest man, daß es am RPi3 zu Konflikten kommen kann, wenn beide Schnittstellen aktiv sind.
Hatte hier auch eine Zeit lang ein BT-Dongle, mittlerweile gehen hier aber beide parallel ganz zufriedenstellend.

PatrickR

Schau Dir mal lepresenced an (FHEMWiki). Das ständige Neustarten von Scanprozessen bekommt bluez nicht gut.


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

Markus Bloch

Ich kann aus meiner Erfahrung berichten, dass ich dieses Problem mit regulärem Bluetooth ebenfalls hatte. Bei mir hat es geholfen, wenn ich die Bluetooth-relevanten Services zyklisch per Cron neugestartet habe um das Problem zu umgehen:

Zitat von: /etc/crontab
0  0    1 * *   root    /etc/init.d/bluetooth restart && hciconfig hci0 up

Viele Grüße

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

kaihs

Sendet der Tag denn überhaupt noch?

Irgendwann ist die Batterie leer, ich habe das auch erst spät bemerkt.

Was gibt denn

sudo hcitool -i hci0 lescan

aus?
Banana Pi, Add-On Board mit 1.8" TFT LCD und IR-Sender, CULFW V1.61, div. Homematic Komponenten, Pollin Funksteckdosen, Selbstbau CUL433 MHz, Jeelink Clone, EC3000
Selbstbau CUL868MHz für Wireless M-Bus, SIGNALduino mit Logilink Temp.-sensoren und Auriol Wetterstation

Pokerface007

Hallo vielen Dank für die vielen Hinweise. Mittlerweile habe ich FHEM auf lepresenced umgestellt und funktioniert. Jetzt möchte ich allerdings einen zweiten g-tag konfigurieren. Das notify soll allerdings nur auslösen, wenn beide g-tags "absent" sind. Wenn nur ein g-tag "absent" ist, sollte das nicht ausreichend um das notify auszulösen. Wie müsste ich sowas konfigurieren???
Gruß Sven

Pokerface007

Ich habe jetzt ein zweiten g-tag als eigenständiges "define" eingerichtet. beide "bluetooth define" funktionen mit einen notify. sobald ein g-tag abwesend ist wird das "absent notfiy" ausgelöst. ziel ist es das notify nur auszulösen wenn beide g-tag absent sind. ich kopiere mal das entscheidene vom notify rein.

Bluetooth_Julia:absent|Bluetooth_Sven:absent set wz_stehlampe off;set wz_heiz.......usw.

ich denke nur die Tilde müsste ersetzt werden. habe das schon mit ein & versucht aber leider ohne erfolg. kann jemand weiterhelfen?

Danke Gruß Sven

PatrickR

Hi!

Dass Du beide G-Tags separat definiert hast, ist schonmal gut.

Jetzt würde ich sie zunächst mit einer structure zusammenfassen (Attribute clientstate_behaviour und clientstate_priority geeignet setzen). Dann kannst Du das notify auf das neue Structure-Device reagieren lassen.

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

Pokerface007

Hallo, aktuell ist Bluetooth_Sven dominant. Structure reagiert nur auf Bluetooth_Sven. Leider finde ich den Fehler auch nach längeren probieren nicht.

define Bluetooth_Julia PRESENCE lan-bluetooth 7C:2F:80:90:89:12 localhost:5333 30
attr Bluetooth_Julia userattr Bluetooth_Julia Bluetooth_Julia_map structexclude
attr Bluetooth_Julia Bluetooth_Julia Bluetooth_Juli_und_Sven
attr Bluetooth_Julia absenceThreshold 3
attr Bluetooth_Julia event-on-change-reading state
attr Bluetooth_Julia room System,Unsorted
attr Bluetooth_Julia userReadings batteryLevel
attr Bluetooth_Julia verbose 3

define Bluetooth_Sven PRESENCE lan-bluetooth 7C:2F:80:C4:57:87 localhost:5333 30
attr Bluetooth_Sven userattr Bluetooth_Sven Bluetooth_Sven_map structexclude
attr Bluetooth_Sven Bluetooth_Julia Bluetooth_Julia_und_Sven
attr Bluetooth_Sven absenceThreshold 3
attr Bluetooth_Sven event-on-change-reading state
attr Bluetooth_Sven room System,Unsorted
attr Bluetooth_Sven userReadings batteryLevel
attr Bluetooth_Sven verbose 3

define Bluetooth_Julia_und_Sven structure Bluetooth_Julia Bluetooth_Sven
attr Bluetooth_Julia_und_Sven clientstate_priority present absent
attr Bluetooth_Julia_und_Sven room System,Unsorted

Weiß jemand Rat.
Danke Gruß Sven

PatrickR

#11
Hi!

Schau Dir mal die Definition einer structure in der Commandref an. Der erste Parameter ist struct_type und dann kommen erst die Geräte.

/Edit: clientstate_priority benötigt übrigens clientstate_behavior relative

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

kjmEjfu

Man sich auch ein RESIDENTS-Device anlegen, dazu zwei ROOMMATE, die jeweils mit einem G-Tag gekoppelt sind.
Verlinkt man das RESIDENTS mit den ROOMMATEs, hat man automatisch das gewünschte Verhalten und muss nur noch RESIDENTS beachten.
So mal als Alternative.
Migriere derzeit zu Home Assistant

Pokerface007

Zitat von: PatrickR am 15 Januar 2019, 15:11:11
Hi!

Schau Dir mal die Definition einer structure in der Commandref an. Der erste Parameter ist struct_type und dann kommen erst die Geräte.

/Edit: clientstate_priority benötigt übrigens clientstate_behavior relative

Patrick


Von unterwegs gesendet.


Das hat wunderbar geklappt....vielen Dank
Gruß Sven