Eurotronic comet blue Modul Entwicklung

Begonnen von gent, 28 November 2016, 21:45:59

Vorheriges Thema - Nächstes Thema

Caleus

18 from 192.168.178.20
root@raspberrypi:~# ps | ax
-bash: ax: Kommando nicht gefunden.
root@raspberrypi:~# ps ax | grep gatttool
  714 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  722 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  724 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  726 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  728 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  730 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  736 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  748 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  820 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  887 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~#

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

Caleus

#212
Also nach dem ich einen Neustart gemacht habe wurde mir ja folgendes mit ps ax | grep gatttool angezeigt

18 from 192.168.178.20
root@raspberrypi:~# ps | ax
-bash: ax: Kommando nicht gefunden.
root@raspberrypi:~# ps ax | grep gatttool
  714 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  722 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  724 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  726 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  728 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  730 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  736 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  748 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  820 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~# ps ax | grep gatttool
  887 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~#


darauf hin habe ich dann mit hciconfig geschaut und es wurde mir wieder

root@raspberrypi:~# hciconfig
hci0:   Type: BR/EDR  Bus: UART
        BD Address: B8:27:EB:6C:2B:D3  ACL MTU: 1021:8  SCO MTU: 64:1
        DOWN
        RX bytes:8397 acl:2 sco:0 events:292 errors:0
        TX bytes:1399 acl:1 sco:0 commands:96 errors:0

root@raspberrypi:~#


dann habe ich sudo hciconfig hci0 up benutzt

root@raspberrypi:~# sudo hciconfig hci0 up
root@raspberrypi:~# hciconfig
hci0:   Type: BR/EDR  Bus: UART
        BD Address: B8:27:EB:6C:2B:D3  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING PSCAN
        RX bytes:10999 acl:2 sco:0 events:392 errors:0
        TX bytes:2240 acl:1 sco:0 commands:146 errors:0

root@raspberrypi:~#


bei einem erneuten abfragen mit ps ax | grep gatttool kam

root@raspberrypi:~# ps ax | grep gatttool
1548 ?        S      0:00 sh -c gatttool -i hci0 -b D6:EA:EE:C7:BD:DD --char-read -a 0x18 2>&1 /dev/null
1549 ?        S      0:00 gatttool -i hci0 -b D6:EA:EE:C7:BD:DD --char-read -a 0x18 /dev/null
7538 pts/0    S+     0:00 grep gatttool
root@raspberrypi:~#


und bei Fhem ist es nach wievor  so das er mir error und timeout anzeigt

Caleus

EDIT: so habe nun den Raspberry Pi neu aufgestzt aber leider kommt immer noch    
T: -100 desired: -100

CoolTux

Schalte mal bitte das Modul ab.

Danach einfach in der Konsole das hier eingeben


gatttool -b MAC --char-read -a 0x3
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

Caleus

Erst mal einen RIESEN DANK an dich COOLTUX für deine ganze mühe.
Es hat sich aber von alleine erledigt, der Raspberry arbeitet nun seit 24 std ruhig vor sich hin alles läuft wie es soll auch das BT, einzig im Log fliegt mir seit 24 std folgendes alle paar Minuten um die Ohren

2018.05.07 20:50:02 3: CometBlueBTLE (Bad) - CreateParamGatttool erstes if
2018.05.07 20:50:02 3: CometBlueBTLE (Bad) - CreateParamGatttool zweites if
2018.05.07 20:50:02 3: CometBlueBTLE (Bad) - ExecGatttool_Done: JSON error while request: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "HASH(0x293a9c8)") at ./FHEM/74_CometBlueBTLE.pm line 636.


bekommen wir das vieleicht auch noch weg ?

Caleus


CoolTux

Es sollte reichen wenn Du das Attribut verbose wieder löschst
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

Caleus

Tja leider ist das nicht mal mehr an.

Caleus

genius777

Hallo zusammen,

ich muss auch mal loswerden, wie toll ich es finde, dass CoolTux dieses Modul entwickelt hat, ich hatte nur die Seite von Torsten Tränkner gesehen und fand es schon aufwendig, immer die PINs nach Little Endian konvertieren zu müssen. Hier ist ja schon alles inklusive :)

Bei mir verhält es sich auf einem Raspberry Pi 3 Model B genau wie bei Caleus, BT lief bei mir seit Beginn an, mit hciconfig lescan bekomme ich alle Module gefunden, bei Aufbau mit gatttools hatte ich jedoch immer den Fehler "connect error: Transport endpoint is not connected (107)"

Leider ist die Aussage
Zitat von: Caleus am 07 Mai 2018, 20:54:49
Erst mal einen RIESEN DANK an dich COOLTUX für deine ganze mühe.
Es hat sich aber von alleine erledigt, der Raspberry arbeitet nun seit 24 std ruhig vor sich hin alles läuft wie es soll auch das BT, einzig im Log fliegt mir seit 24 std folgendes alle paar Minuten um die Ohren
nicht ganz so spezifisch. Kannst du, Caleus, eventuell noch mal schreiben, was du zuletzt gemacht hattest, bevor es lief? Hast du die gatttools bzw. bluez noch mal selbst kompiliert oder von einem anderen Repository geladen?

Oder hast du, CoolTux, noch weitere Ansätze? Für mich wirkte es so, als ob hcitools mit dem eingebauten BT besser klarkommt als die gatttools aber offenbar läuft es ja nun bei Caleus...?!

CoolTux

Zitat von: genius777 am 11 Mai 2018, 11:58:29
Hallo zusammen,

ich muss auch mal loswerden, wie toll ich es finde, dass CoolTux dieses Modul entwickelt hat, ich hatte nur die Seite von Torsten Tränkner gesehen und fand es schon aufwendig, immer die PINs nach Little Endian konvertieren zu müssen. Hier ist ja schon alles inklusive :)

Bei mir verhält es sich auf einem Raspberry Pi 3 Model B genau wie bei Caleus, BT lief bei mir seit Beginn an, mit hciconfig lescan bekomme ich alle Module gefunden, bei Aufbau mit gatttools hatte ich jedoch immer den Fehler "connect error: Transport endpoint is not connected (107)"

Leider ist die Aussagenicht ganz so spezifisch. Kannst du, Caleus, eventuell noch mal schreiben, was du zuletzt gemacht hattest, bevor es lief? Hast du die gatttools bzw. bluez noch mal selbst kompiliert oder von einem anderen Repository geladen?

Oder hast du, CoolTux, noch weitere Ansätze? Für mich wirkte es so, als ob hcitools mit dem eingebauten BT besser klarkommt als die gatttools aber offenbar läuft es ja nun bei Caleus...?!

Hallo,

Mangels eigener Erfahrung mit einem Pi3 fehlt kann ich leider nicht viel dazu sagen. Ansätze sind immer Reichweite oder blockierendes Bluetooth.
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

genius777

#219
Hi,

also auf nem Pi3 ist standardmäßig die bluez 5.43 installiert. Diese ist nicht ganz so stable mMn - leider ist die derzeit aktuelle 5.49 zum einen ohne gatttool und der Fehler war wohl wirklich die Reichweite. Grundsätzlich könnte man diese patchen, habe allerdings nur Patches für ältere Versionen gefunden.

Mit der heaterControl.exp von Torsten Tränkner hatte und habe ich mich auf ein nahes Thermostat verbinden können

root@raspberrypi:/home/pi# ./heaterControl.exp D0:B5:C2:FB:XX:XX 00000000
[D0:B5:C2:FB:BE:43][LE]> connect
Attempting to connect to D0:B5:C2:FB:XX:XX
Connection successful
[D0:B5:C2:FB:XX:XX][LE]> Bluetooth connection established
char-write-req 0x0047 00000000
Characteristic value was written successfully
[D0:B5:C2:FB:XX:XX][LE]>
The PIN was accepted.

char-read-hnd 0x003f
Characteristic value/descriptor: 2f 2d 2d 2d 00 04 0a
[D0:B5:C2:FB:BE:43][LE]>

===== Current temperature: 23.5°C =====
===== Old set temperature: 22.5°C =====

disconnect

(gatttool:4737): GLib-WARNING **: Invalid file descriptor.

[D0:B5:C2:FB:XX:XX][LE]>
Setting bluetooth interface hci0 down.
root@raspberrypi:/home/pi# hciconfig hci0 up


Was komisch ist, ist dass ich über hcitool lesscan alle Thermostate angezeigt bekomme, mit der App EuroProg (iOS) kann ich auch (fast) alle Thermostate von (fast) überall steuern, über das gatttool kann ich nur zu diesem einem nahen verbinden, aber zu eben diesem schlägt die Verbindung mit FHEM wiederrum fehl  - ganz kurz kommt dann "read(ing) sensor data" o.ä. und dann wird die Meldung "T: -100 desired: -100" angezeigt.

gattool Prozesse sind wie zu erwarten nur kurz nach einer Parameteränderung in FHEM aktiv, danach dann nicht mehr.

Kannst du mir kurz beschreiben, woher die Meldung kommt bzw. was sie aussagen soll? Gibt es irgendie BT Sticks für USB mit höherer Reichweite? Ich nehme an, ihr habt nicht alle 20qm Wohnungen...

EDIT: Wie peinlich, hab einfach mal ne Temperatur gesetzt und die hat er auch übernommen (Ausgabe von heaterControl.exp)

===== Current temperature: 23.5°C =====
===== Old set temperature: 16.0°C =====


Jetzt zeigt er als Status im Modul in FHEM auch mehr ausgelesene Attribute an

Readings
desired-temp
0
2018-05-12 20:07:10
lastChangeBy
FHEM
2018-05-12 20:07:10
measured-temp
0
2018-05-12 20:07:10
state
T: 0 desired: 0
2018-05-12 20:10:52
tempComfort
0
2018-05-12 20:07:10
tempEco
0
2018-05-12 20:07:10
tempOffset
0
2018-05-12 20:07:10
winOpnPeriod
0
2018-05-12 20:07:10


aber T: 0 desired: 0 ist jetzt auch nicht viel praktikabler als -100   :D

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

genius777

#221
Die ganz oben bei "Device overview"

DeviceOverview Badezimmer T: 0 desired: 0

Ich vermute, dass dies dann normalerweise T="Current temperature" und desired="Old set temperature" wäre...? Wird aber irgendwie dann nicht richtig gefüllt...

CoolTux

Kann ich Dir leider nicht sagen. Es fehlen die Daten welche er normaler Weise bekommen würde
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

Caleus

Moin Leute

Also bis gestern hatte ich eigentlich keine Probleme mit dem Modul, aber leider verweigert das Modul nun das Auslesen der Temperatur, auch ein Neustart und auch ein Update brachte kein Erfolg, ich hoffe deshalb das mir jemand helfen kann da eine Lösung zu finden.

2018.07.15 08:39:59 4 : CometBlueBTLE (Bad) - Run CreateParamGatttool with mod: read
2018.07.15 08:39:59 5 : CometBlueBTLE (Bad) - Noch in Queue nach pop: 0
2018.07.15 08:39:59 3 : CometBlueBTLE (Bad) - CreateParamGatttool erstes if
2018-07-15 08:39:59 CometBlueBTLE Bad pairing thermostat with pin: 00000000
2018.07.15 08:39:59 4 : CometBlueBTLE (Bad) - Read CometBlueBTLE_ExecGatttool_Run Bad|D6:EA:EE:C7:BD:DD|read|0x3f
2018.07.15 08:40:14 4 : CometBlueBTLE (Bad) - Run CreateParamGatttool with mod: read
2018.07.15 08:40:14 5 : CometBlueBTLE (Bad) - Noch in Queue nach pop: 0
2018.07.15 08:40:14 3 : CometBlueBTLE (Bad) - CreateParamGatttool zweites if
2018-07-15 08:40:14 CometBlueBTLE Bad read sensor data
2018.07.15 08:40:14 4 : CometBlueBTLE (Bad) - Read CometBlueBTLE_ExecGatttool_Run Bad|D6:EA:EE:C7:BD:DD|read|0x3f
2018.07.15 08:40:14 4 : CometBlueBTLE (Bad) - stateRequestTimer: Call Request Timer
2018.07.15 08:40:59 1 : Timeout for CometBlueBTLE_ExecGatttool_Run reached, terminated process 14905
2018-07-15 08:40:59 CometBlueBTLE Bad unreachable
2018.07.15 08:40:59 5 : CometBlueBTLE (Bad) - WriteReadings: Reading lastGattError, value The BlockingCall Process terminated unexpectedly. Timedout altes value The BlockingCall Process terminated unexpectedly. Timedout
2018-07-15 08:40:59 CometBlueBTLE Bad lastGattError: The BlockingCall Process terminated unexpectedly. Timedout
2018-07-15 08:40:59 CometBlueBTLE Bad error
2018.07.15 08:40:59 4 : CometBlueBTLE (Bad) - WriteReadings: Readings were written
2018.07.15 08:40:59 3 : CometBlueBTLE (Bad) - ExecGatttool_Aborted: The BlockingCall Process terminated unexpectedly. Timedout


Caleus

CoolTux

Mach mal bitte

sudo hciconfig hci0 down


Und danach ein

sudo hciconfig hci0 up


Ansonsten mal ein reboot machen.
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