[74_XiaomiBTLESens.pm] Xiaomi Bluetooth Sensoren FlowerSens/Thermometer

Begonnen von CoolTux, 11 Januar 2018, 15:42:45

Vorheriges Thema - Nächstes Thema

yrwyddfa

Ah, super, passt. 2.9.4. Hab ich doch glatt überlesen.
Läuft flüssig wie Butter, das Einbinden des zweiten lief auch problemlos und die readings haben mir auch gleich aufgezeigt, dass ich das letzte Gießen vergessen hatte.

Ergo: funktioniert super, tolle Arbeit!
If every day has its number, Monday would be a zero division.

distel

Hat sich was am Timing/Timeout geändert? Hintergrund: Wenn mein Thermometer außerhalb der Funkreichweite ist, hatte ich sonst die Fehlermeldung "connect error,Connection refused (111)"

Jetzt läuft die Abfrage (get sensordata) in ein timeout:
2018.01.24 19:25:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: read
2018.01.24 19:25:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Read XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|read|0x18
2018.01.24 19:25:31 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b <MAC> --char-read -a 0x18 2>&1 /dev/null and loop 0
2018.01.24 19:26:11 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result connect error,Connection refused (111)

2018.01.24 19:26:11 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b <MAC> --char-read -a 0x18 2>&1 /dev/null and loop 1
2018.01.24 19:26:31 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 48
2018.01.24 19:26:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
2018.01.24 19:26:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout

NUC-I37100
Docker: eBus, fhem, ha-bridge, unifi
Hardware: Homematic, FS20, Somfy RTS, 1wire, FBAHA, enOcean

CoolTux

Das liegt dann wenn an gatttool das es auf gedeiht und Verderb versucht eine Verbindung herstellen zu stellen und nicht einfach nach paar Sekunden auf gibt  ;D

Solltest aber ein sauberes Error als Reading bekommen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Tobias

@cooltux, hast du das Protokoll der Sensoren irgendwo nachlesen können oder selbst gerausgetüftelt?
Maintainer: Text2Speech, TrashCal, MediaList

Meine Projekte: https://github.com/tobiasfaust
* PumpControl v2: allround Bewässerungssteuerung mit ESP und FHEM
* Ein Modbus RS485 zu MQTT Gateway für SolarWechselrichter

CoolTux

Das Protokoll war eine Vorarbeit eines anderen Forenmitgliedes. Zum alten Thread gibt es hier irgendwo im Thread einen Link.

Aktuell arbeite ich an einem Bluetooththermostaten und im Zuge dessen habe ich eine Recht gute Anleitung zum BT sniffen. Falls Deine Frage dahin geht  ;D
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

distel

Ich nochmal... hab jetzt nen RPi2 mit BT-Stick als "radiohub" (soll noch mehr Sender/Empfänger bekommen) eingerichtet. Versuche also per ssh abzufragen.

Aus der Konsole per ssh klappt es (also Zertifikate korrekt eingerichtet). Ich bekomme auch sinnige Antworten vom Thermometer.

Für die einfachen Operationen (nur read) klappt es auch in fhem: get devicename bspw. funktioniert.
Bei komplexeren Operationen (z.B. set devicename = write + read) klappt das write, nicht aber das read - timeout. ein nachträgliches get devicename klappt dann aber und liefert den neuen Wert.

Die Abfrage der Sensorwerte klappt allerdings nicht. Obwohl es eigentlich gut aussieht:
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: write
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Write XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|write|0x10|0100
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - stateRequestTimer: Call Request Timer
2018.01.24 20:41:41 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 15 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 0
2018.01.24 20:41:52 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
2018.01.24 20:41:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 31 39 2e 38 20 48 3d 35 32 2e 32 00
...
Notification handle = 0x000e value,54 3d 31 39 2e 34 20 48 3d 35 33 2e 37 00

2018.01.24 20:41:56 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 31 39 2e 38 20 48 3d 35 32 2e 32 00
...
Notification handle = 0x000e value,54 3d 31 39 2e 34 20 48 3d 35 33 2e 37 00

2018.01.24 20:41:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:41:58 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
...
2018.01.24 20:42:38 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:42:40 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:42:40 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 579
2018.01.24 20:42:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
2018.01.24 20:42:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout


1) der Befehl ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen' kommt auch von der Console aus nicht zu einem definierten Ende, sondern läuft weiter
2) Der Aufruf aus fhem hinterlässt einen Zombie Prozess vom gatttool. Alle kommenden sind also aufgrund des bereits laufenden Prozesses zum scheitern verurteilt.

ps axf auf radiohub-1:
4196 ?        Ss     0:00 bash -c gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev
4197 ?        S      0:00  \_ gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen /dev/null


Sachdienliche Hinweise bitte gern an mich :-)
NUC-I37100
Docker: eBus, fhem, ha-bridge, unifi
Hardware: Homematic, FS20, Somfy RTS, 1wire, FBAHA, enOcean

CoolTux

Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

CoolTux

Zitat von: distel am 24 Januar 2018, 20:51:04
Ich nochmal... hab jetzt nen RPi2 mit BT-Stick als "radiohub" (soll noch mehr Sender/Empfänger bekommen) eingerichtet. Versuche also per ssh abzufragen.

Aus der Konsole per ssh klappt es (also Zertifikate korrekt eingerichtet). Ich bekomme auch sinnige Antworten vom Thermometer.

Für die einfachen Operationen (nur read) klappt es auch in fhem: get devicename bspw. funktioniert.
Bei komplexeren Operationen (z.B. set devicename = write + read) klappt das write, nicht aber das read - timeout. ein nachträgliches get devicename klappt dann aber und liefert den neuen Wert.

Die Abfrage der Sensorwerte klappt allerdings nicht. Obwohl es eigentlich gut aussieht:
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: write
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Write XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|write|0x10|0100
2018.01.24 20:41:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - stateRequestTimer: Call Request Timer
2018.01.24 20:41:41 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 15 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 0
2018.01.24 20:41:52 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
2018.01.24 20:41:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 31 39 2e 38 20 48 3d 35 32 2e 32 00
...
Notification handle = 0x000e value,54 3d 31 39 2e 34 20 48 3d 35 33 2e 37 00

2018.01.24 20:41:56 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 31 39 2e 38 20 48 3d 35 32 2e 32 00
...
Notification handle = 0x000e value,54 3d 31 39 2e 34 20 48 3d 35 33 2e 37 00

2018.01.24 20:41:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:41:58 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
...
2018.01.24 20:42:38 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:42:40 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.24 20:42:40 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 579
2018.01.24 20:42:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
2018.01.24 20:42:40 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout


1) der Befehl ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen' kommt auch von der Console aus nicht zu einem definierten Ende, sondern läuft weiter
2) Der Aufruf aus fhem hinterlässt einen Zombie Prozess vom gatttool. Alle kommenden sind also aufgrund des bereits laufenden Prozesses zum scheitern verurteilt.

ps axf auf radiohub-1:
4196 ?        Ss     0:00 bash -c gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev
4197 ?        S      0:00  \_ gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen /dev/null


Sachdienliche Hinweise bitte gern an mich :-)

Ich habe auf GitHub im Devel branch mal eine debug Version für Dich hingelegt. Bitte diese einmal testen und schauen ob es damit besser geht.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

frank_41

moin,
ich habe jetzt auf das neue Modul umgestellt. Irgendwie gibt es jetzt mehr timouts als vorher:
2018.01.25 16:16:03 4: XiaomiBTLESens (zamioculcas) - Run CreateParamGatttool with mod: read
2018.01.25 16:16:04 4: XiaomiBTLESens (zamioculcas) - Read XiaomiBTLESens_ExecGatttool_Run zamioculcas|C4:7C:8D:65:C0:8C|read|0x38
2018.01.25 16:16:04 4: XiaomiBTLESens (zamioculcas) - stateRequestTimer: Call Request Timer
2018.01.25 16:16:04 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:65:C0:8C --char-read -a 0x38 2>&1 /dev/null and loop 0
2018.01.25 16:16:27 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 4093
2018.01.25 16:16:44 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: gatttool loop result connect error,Connection refused (111)

2018.01.25 16:16:44 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:65:C0:8C --char-read -a 0x38 2>&1 /dev/null and loop 1
2018.01.25 16:17:04 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 4119
2018.01.25 16:17:04 4: XiaomiBTLESens (zamioculcas) - WriteReadings: Readings were written
2018.01.25 16:17:04 4: XiaomiBTLESens (zamioculcas) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout


Ist irgendwas am Timing geändert worden ?
Gruss
Frank
Raspberry Pi 3
RFXCOM_RFXtrx433
V 1.62 nanoCUL433
Jeelink LaCrosse
Jeelink PCA301.CUL_HM,Conbee, deCONZ

CoolTux

Zitat von: frank_41 am 25 Januar 2018, 21:55:47
moin,
ich habe jetzt auf das neue Modul umgestellt. Irgendwie gibt es jetzt mehr timouts als vorher:
2018.01.25 16:16:03 4: XiaomiBTLESens (zamioculcas) - Run CreateParamGatttool with mod: read
2018.01.25 16:16:04 4: XiaomiBTLESens (zamioculcas) - Read XiaomiBTLESens_ExecGatttool_Run zamioculcas|C4:7C:8D:65:C0:8C|read|0x38
2018.01.25 16:16:04 4: XiaomiBTLESens (zamioculcas) - stateRequestTimer: Call Request Timer
2018.01.25 16:16:04 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:65:C0:8C --char-read -a 0x38 2>&1 /dev/null and loop 0
2018.01.25 16:16:27 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 4093
2018.01.25 16:16:44 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: gatttool loop result connect error,Connection refused (111)

2018.01.25 16:16:44 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:65:C0:8C --char-read -a 0x38 2>&1 /dev/null and loop 1
2018.01.25 16:17:04 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 4119
2018.01.25 16:17:04 4: XiaomiBTLESens (zamioculcas) - WriteReadings: Readings were written
2018.01.25 16:17:04 4: XiaomiBTLESens (zamioculcas) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout


Ist irgendwas am Timing geändert worden ?
Gruss
Frank

Es wurde nichts verändert. Der Code für die Flower Sense ist so geblieben. Dein gatttool scheint sich aber auch ewig Zeit zu lassen beim 2. Aufruf

2018.01.25 16:16:44 5: XiaomiBTLESens (zamioculcas) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:65:C0:8C --char-read -a 0x38 2>&1 /dev/null and loop 1

Und 30s später erfolgt der Abbruch, so lange hat gatttool auf eine Antwort der Gegenstelle gewartet

2018.01.25 16:17:04 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 4119

Wie oft kommt es denn vor?
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

distel

Zitat von: CoolTux am 25 Januar 2018, 09:19:29
Ich habe auf GitHub im Devel branch mal eine debug Version für Dich hingelegt. Bitte diese einmal testen und schauen ob es damit besser geht.

Hallo,

hab jetzt die 2.0.6devel installiert. Wenn ich es recht sehe, hast Du im Aufruf nicht mehr das "bash" vorangestellt.
Die Kommunikation läuft gefühlt schneller. Auch Ergebnisse werden transportiert.
Aber dennoch ist es nicht unbedingt erfolgreich :-/

Der erste Versuch scheitert (endpoint not connected) die weiteren dann ebenfalls (device busy).
Versuche ich das auf der Kommandozeile (ebenfalls via ssh vom fhem aus), dann bekomme ich zumindest im zweiten Versuch ne Antwort und kein busy.

Das read auf 0x35 hingegen klappt dann zuverlässig.

2018.01.26 19:24:09 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: write
2018.01.26 19:24:09 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Write XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|write|0x10|0100
2018.01.26 19:24:10 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 5 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 0
2018.01.26 19:24:14 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result connect error,Transport endpoint is not connected (107)

2018.01.26 19:24:14 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 5 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 1
2018.01.26 19:24:19 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result
2018.01.26 19:24:19 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 5 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 2
2018.01.26 19:24:20 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result connect,Device or resource busy (16)

2018.01.26 19:24:20 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result connect,Device or resource busy (16)

2018.01.26 19:24:20 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.26 19:24:22 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: another gatttool process is running. waiting...
2018.01.26 19:24:23 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x35 2>&1 /dev/null' and loop 0
2018.01.26 19:24:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:24:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:24:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x35|{"gtResult":"08 36 00 10 00 "}
2018.01.26 19:24:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:24:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


Ggf. sind die 5 Sekunden Timeout etwas optimistisch?! Wie wäre es, das Timeout parametrierbar zu machen, dann könnte ich verschiedene Werte testen.
Hab testweise mal die entsprechende Zeile von Hand auf 7 Sekunden geädert - das funktioniert besser, allerdings liegt jetzt das Thermometer auch direkt daneben. Ich teste mal noch ein wenig.


Gruß

Dirk
NUC-I37100
Docker: eBus, fhem, ha-bridge, unifi
Hardware: Homematic, FS20, Somfy RTS, 1wire, FBAHA, enOcean

trinitywhm

Ich habe hier auch vermehrt Fehler nach der Umstellung. Im Device das Reading
lastGattError
The BlockingCall Process terminated unexpectedly. Timedout


Im Log mit verbose 5 nach einem "get sensorData"
2018.01.26 19:21:06 4: XiaomiBTLESens (WZ_Pflanze1) - Run CreateParamGatttool with mod: read
2018.01.26 19:21:06 4: XiaomiBTLESens (WZ_Pflanze1) - Read XiaomiBTLESens_ExecGatttool_Run WZ_Pflanze1|C4:7C:8D:63:6D:E9|read|0x38
2018.01.26 19:21:34 5: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Run: gatttool loop result connect error,Connection refused (111)

2018.01.26 19:21:34 5: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:63:6D:E9 --char-read -a 0x38 2>&1 /dev/null and loop 1
2018.01.26 19:21:53 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 3521
2018.01.26 19:21:54 4: XiaomiBTLESens (WZ_Pflanze1) - WriteReadings: Readings were written
2018.01.26 19:21:54 4: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout
2018.01.26 19:24:50 4: XiaomiBTLESens (WZ_Pflanze1) - Run CreateParamGatttool with mod: read
2018.01.26 19:24:51 4: XiaomiBTLESens (WZ_Pflanze1) - Read XiaomiBTLESens_ExecGatttool_Run WZ_Pflanze1|C4:7C:8D:63:6D:E9|read|0x38
2018.01.26 19:24:51 4: XiaomiBTLESens (WZ_Pflanze1) - stateRequestTimer: Call Request Timer
2018.01.26 19:24:51 5: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:63:6D:E9 --char-read -a 0x38 2>&1 /dev/null and loop 0
2018.01.26 19:25:31 5: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Run: gatttool loop result connect error,Connection refused (111)
2018.01.26 19:25:31 5: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Run: call gatttool with command gatttool -i hci0 -b C4:7C:8D:63:6D:E9 --char-read -a 0x38 2>&1 /dev/null and loop 1
2018.01.26 19:25:50 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 3798
2018.01.26 19:25:51 4: XiaomiBTLESens (WZ_Pflanze1) - WriteReadings: Readings were written
2018.01.26 19:25:51 4: XiaomiBTLESens (WZ_Pflanze1) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout
2018.01.26 19:26:29 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 3921
2018.01.26 19:27:13 1: Timeout for XiaomiBTLESens_ExecGatttool_Run reached, terminated process 3965

Und diese letzte Timeout-Meldung zieht sich schon durch den ganzen Tag, mal sporadisch, mal im Abstand von ein bis zwei Minuten.

distel

Zitat von: trinitywhm am 26 Januar 2018, 19:42:17
Ich habe hier auch vermehrt Fehler nach der Umstellung. Im Device das Reading
Das müssten aber zwei verschiedene Paar Schuhe sein, da Du den lokalen Bluetooth-Stack abfragst, ich aber auf einem Remote-System via ssh.
NUC-I37100
Docker: eBus, fhem, ha-bridge, unifi
Hardware: Homematic, FS20, Somfy RTS, 1wire, FBAHA, enOcean

distel

Die Abbrüche scheinen nicht wirklich reproduzierbar im Zusammenhang mit dem (ssh-)timeout zu stehen. Zumindest die reinen leseoperationen geben sich unbeeindruckt (verwenden aber auch kein timeout):

Einfaches read - erfolgreich
2018.01.26 19:54:17 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: read
2018.01.26 19:54:17 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Read XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|read|0x3
2018.01.26 19:54:18 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x3 2>&1 /dev/null' and loop 0
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,45 47 2e 54 65 73 74

2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,45 47 2e 54 65 73 74

2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x3|{"gtResult":"45 47 2e 54 65 73 74 "}
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification: handle 0x3
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - Thermo/Hygro Sens Handle0x3
2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


Nochmal einfaches read - erfolgreich
2018.01.26 19:54:55 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: read
2018.01.26 19:54:55 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Read XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|read|0x24
2018.01.26 19:54:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x24 2>&1 /dev/null' and loop 0
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,30 30 2e 30 30 2e 36 36

2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,30 30 2e 30 30 2e 36 36

2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x24|{"gtResult":"30 30 2e 30 30 2e 36 36 "}
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification: handle 0x24
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - Thermo/Hygro Sens Handle0x24
2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


write (get sensordata) - nicht erfolgreich -- obwohl auf 0x000e vernünftige Infos zurückgeliefert werden.
2018.01.26 19:55:20 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: write
2018.01.26 19:55:20 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Write XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|write|0x10|0100
2018.01.26 19:55:21 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 8 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 0
2018.01.26 19:55:29 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 32 31 2e 34 20 48 3d 34 38 2e 37 00
Notification handle = 0x000e value,54 3d 32 31 2e 35 20 48 3d 34 38 2e 36 00

2018.01.26 19:55:29 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 32 31 2e 34 20 48 3d 34 38 2e 37 00
Notification handle = 0x000e value,54 3d 32 31 2e 35 20 48 3d 34 38 2e 36 00

2018.01.26 19:55:30 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x35 2>&1 /dev/null' and loop 0
2018.01.26 19:55:31 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x35|{"gtResult":"08 36 00 10 00 "}
2018.01.26 19:55:31 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written
NUC-I37100
Docker: eBus, fhem, ha-bridge, unifi
Hardware: Homematic, FS20, Somfy RTS, 1wire, FBAHA, enOcean

CoolTux

Zitat von: distel am 26 Januar 2018, 20:04:58
Die Abbrüche scheinen nicht wirklich reproduzierbar im Zusammenhang mit dem (ssh-)timeout zu stehen. Zumindest die reinen leseoperationen geben sich unbeeindruckt (verwenden aber auch kein timeout):

Einfaches read - erfolgreich
2018.01.26 19:54:17 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: read
2018.01.26 19:54:17 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Read XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|read|0x3
2018.01.26 19:54:18 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x3 2>&1 /dev/null' and loop 0
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,45 47 2e 54 65 73 74

2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,45 47 2e 54 65 73 74

2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x3|{"gtResult":"45 47 2e 54 65 73 74 "}
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification: handle 0x3
2018.01.26 19:54:24 5: XiaomiBTLESens (xbtle.temp.eg.flur) - Thermo/Hygro Sens Handle0x3
2018.01.26 19:54:24 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


Nochmal einfaches read - erfolgreich
2018.01.26 19:54:55 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: read
2018.01.26 19:54:55 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Read XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|read|0x24
2018.01.26 19:54:56 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x24 2>&1 /dev/null' and loop 0
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,30 30 2e 30 30 2e 36 36

2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,30 30 2e 30 30 2e 36 36

2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x24|{"gtResult":"30 30 2e 30 30 2e 36 36 "}
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification: handle 0x24
2018.01.26 19:55:03 5: XiaomiBTLESens (xbtle.temp.eg.flur) - Thermo/Hygro Sens Handle0x24
2018.01.26 19:55:03 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


write (get sensordata) - nicht erfolgreich -- obwohl auf 0x000e vernünftige Infos zurückgeliefert werden.
2018.01.26 19:55:20 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Run CreateParamGatttool with mod: write
2018.01.26 19:55:20 4: XiaomiBTLESens (xbtle.temp.eg.flur) - Write XiaomiBTLESens_ExecGatttool_Run xbtle.temp.eg.flur|<MAC>|write|0x10|0100
2018.01.26 19:55:21 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command timeout 8 ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-write-req -a 0x10 -n 0100 --listen 2>&1 /dev/null' and loop 0
2018.01.26 19:55:29 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 32 31 2e 34 20 48 3d 34 38 2e 37 00
Notification handle = 0x000e value,54 3d 32 31 2e 35 20 48 3d 34 38 2e 36 00

2018.01.26 19:55:29 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value was written successfully
Notification handle = 0x000e value,54 3d 32 31 2e 34 20 48 3d 34 38 2e 37 00
Notification handle = 0x000e value,54 3d 32 31 2e 35 20 48 3d 34 38 2e 36 00

2018.01.26 19:55:30 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: call gatttool with command ssh fhem@radiohub-1.home 'gatttool -i hci0 -b <MAC> --char-read -a 0x35 2>&1 /dev/null' and loop 0
2018.01.26 19:55:31 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool loop result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Run: gatttool result Characteristic value/descriptor,08 36 00 10 00

2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - ExecGatttool_Done: gatttool return string: xbtle.temp.eg.flur|<MAC>|ok|read|0x35|{"gtResult":"08 36 00 10 00 "}
2018.01.26 19:55:31 5: XiaomiBTLESens (xbtle.temp.eg.flur) - ProcessingNotification
2018.01.26 19:55:31 4: XiaomiBTLESens (xbtle.temp.eg.flur) - WriteReadings: Readings were written


Also hier sieht alles super aus. Bei allen drei Beispielen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net