FHEM Forum

FHEM - Hausautomations-Systeme => Unterstützende Dienste => Thema gestartet von: Pokerface007 am 30 Dezember 2018, 20:49:13

Titel: ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 30 Dezember 2018, 20:49:13
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
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Neuhier am 30 Dezember 2018, 21:04:12
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.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 30 Dezember 2018, 22:00:24
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
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Neuhier am 30 Dezember 2018, 22:03:54
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.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: PatrickR am 31 Dezember 2018, 02:12:34
Schau Dir mal lepresenced an (FHEMWiki). Das ständige Neustarten von Scanprozessen bekommt bluez nicht gut.


Von unterwegs gesendet.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Markus Bloch am 02 Januar 2019, 14:05:43
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
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: kaihs am 03 Januar 2019, 23:11:51
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?
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 08 Januar 2019, 16:15:10
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
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 10 Januar 2019, 21:43:12
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
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: PatrickR am 10 Januar 2019, 21:49:42
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.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 15 Januar 2019, 14:40:54
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
Titel: ständig absent mit meinen g-tag
Beitrag 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.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: kjmEjfu am 15 Januar 2019, 16:50:32
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.
Titel: Antw:ständig absent mit meinen g-tag
Beitrag von: Pokerface007 am 17 Januar 2019, 10:42:22
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