[31_PLAYBULB.pm] Modul für MiPow PLAYBULB Candle Bluetooth Lampen

Begonnen von CoolTux, 15 November 2016, 20:22:00

Vorheriges Thema - Nächstes Thema

KNUT345


CoolTux

Hallo Knut,

Im Moment leider nicht. Auch ich habe hin und wieder dieses Problem. Ich habe vor das Modul neu zu schreiben, aber ein bisschen wird es wohl noch dauern.



Grüße
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

KNUT345


Byte09

#378
hi cooltux,

ich habe die tage mein system komplett neu aufgesetzt , mit raspian stretch ( hatte ein sd-karten-desaster).

leider kann ich mit der neuen insatllatin keine meiner playbulbs merh steuern.

list device
Internals:
   BTMAC      E8:CD:4B:16:AC:E6
   CFGFN     
   DEF        E8:CD:4B:16:AC:E6
   NAME       Sphere
   NR         394
   STATE      unreachable
   TYPE       PLAYBULB
   VERSION    1.4.0
   READINGS:
     2018-01-27 10:49:55   state           unreachable
   helper:
     color      on
     effect     RainbowFade
     onoff      1
     rgb        F7FF00
     sat        0
     speed      120
     statusRequest
Attributes:
   devStateIcon unreachable:light_question
   model      BTL301W
   room       Wohnzimmer
   verbose    5
   webCmd     rgb:rgb FF0000:rgb 00FF00:rgb 0000FF:rgb FFFFFF:rgb F7FF00:rgb 00FFFF:rgb F700FF:effect


wenn ich sie über gatttool anspreche scheint alles ok:
fhem@raspberrypi:~$ gatttool -b E8:CD:4B:16:AC:E6  --characteristics
handle = 0x0002, char properties = 0x20, char value handle = 0x0003, uuid = 00002a05-0000-1000-8000-00805f9b34fb
handle = 0x0006, char properties = 0x0a, char value handle = 0x0007, uuid = 00002a00-0000-1000-8000-00805f9b34fb
handle = 0x0008, char properties = 0x02, char value handle = 0x0009, uuid = 00002a01-0000-1000-8000-00805f9b34fb
handle = 0x000a, char properties = 0x02, char value handle = 0x000b, uuid = 00002a04-0000-1000-8000-00805f9b34fb
handle = 0x000d, char properties = 0x0a, char value handle = 0x000e, uuid = 00001013-d102-11e1-9b23-00025b00a5a5
handle = 0x000f, char properties = 0x08, char value handle = 0x0010, uuid = 00001018-d102-11e1-9b23-00025b00a5a5
handle = 0x0011, char properties = 0x12, char value handle = 0x0012, uuid = 00001014-d102-11e1-9b23-00025b00a5a5
handle = 0x0014, char properties = 0x02, char value handle = 0x0015, uuid = 00001011-d102-11e1-9b23-00025b00a5a5
handle = 0x0017, char properties = 0x10, char value handle = 0x0018, uuid = 00002a37-0000-1000-8000-00805f9b34fb
handle = 0x001a, char properties = 0x08, char value handle = 0x001b, uuid = 0000fff2-0000-1000-8000-00805f9b34fb
handle = 0x001c, char properties = 0x06, char value handle = 0x001d, uuid = 0000fff3-0000-1000-8000-00805f9b34fb
handle = 0x001e, char properties = 0x02, char value handle = 0x001f, uuid = 0000fff1-0000-1000-8000-00805f9b34fb
handle = 0x0020, char properties = 0x08, char value handle = 0x0021, uuid = 00001234-0000-1000-8000-00805f9b34fb
handle = 0x0022, char properties = 0x0a, char value handle = 0x0023, uuid = 0000fff7-0000-1000-8000-00805f9b34fb
handle = 0x0024, char properties = 0x02, char value handle = 0x0025, uuid = 0000fff8-0000-1000-8000-00805f9b34fb
handle = 0x0026, char properties = 0x06, char value handle = 0x0027, uuid = 0000fffb-0000-1000-8000-00805f9b34fb
handle = 0x0028, char properties = 0x06, char value handle = 0x0029, uuid = 0000fffc-0000-1000-8000-00805f9b34fb
handle = 0x002a, char properties = 0x0a, char value handle = 0x002b, uuid = 0000fffd-0000-1000-8000-00805f9b34fb
handle = 0x002c, char properties = 0x0a, char value handle = 0x002d, uuid = 0000fffe-0000-1000-8000-00805f9b34fb
handle = 0x002e, char properties = 0x0a, char value handle = 0x002f, uuid = 0000ffff-0000-1000-8000-00805f9b34fb
handle = 0x0030, char properties = 0x0a, char value handle = 0x0031, uuid = 0000fff5-0000-1000-8000-00805f9b34fb
handle = 0x0033, char properties = 0x12, char value handle = 0x0034, uuid = 00002a19-0000-1000-8000-00805f9b34fb
handle = 0x0037, char properties = 0x08, char value handle = 0x0038, uuid = c4edc000-9daf-11e3-8000-00025b000b00
handle = 0x0039, char properties = 0x02, char value handle = 0x003a, uuid = c4edc000-9daf-11e3-8001-00025b000b00
handle = 0x003b, char properties = 0x0a, char value handle = 0x003c, uuid = c4edc000-9daf-11e3-8002-00025b000b00
handle = 0x003d, char properties = 0x1c, char value handle = 0x003e, uuid = c4edc000-9daf-11e3-8003-00025b000b00
handle = 0x0040, char properties = 0x1c, char value handle = 0x0041, uuid = c4edc000-9daf-11e3-8004-00025b000b00
handle = 0x0043, char properties = 0x0a, char value handle = 0x0044, uuid = c4edc000-9daf-11e3-8005-00025b000b00
handle = 0x0045, char properties = 0x0a, char value handle = 0x0046, uuid = c4edc000-9daf-11e3-8006-00025b000b00
handle = 0x0048, char properties = 0x02, char value handle = 0x0049, uuid = 00002a26-0000-1000-8000-00805f9b34fb
handle = 0x004a, char properties = 0x02, char value handle = 0x004b, uuid = 00002a50-0000-1000-8000-00805f9b34fb
fhem@raspberrypi:~$


aus fhem heraus bekomme ich nur ein 'unreachable' mit folgendem log (verbode 5) :

2018.01.27 10:31:23 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:31:23 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:31:33 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 2924
2018.01.27 10:31:33 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:36:41 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:36:41 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:36:47 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3136
2018.01.27 10:36:47 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
2018.01.27 10:36:47 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:36:47 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:36:51 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3241
2018.01.27 10:36:51 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
2018.01.27 10:36:51 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:36:51 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:37:01 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3314
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:37:01 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
2018.01.27 10:37:10 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:37:10 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:37:20 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3499
2018.01.27 10:37:20 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:37:23 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:37:23 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:37:33 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3656
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:37:33 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
2018.01.27 10:37:49 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:37:49 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:37:59 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 3837
2018.01.27 10:37:59 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)


das betrifft alle meine lampen . das Log ist ja nicht sooo gesprächig und ich weiss mir nicht mehr zu helfen, kannst du ggf. mal drüberschauen.

auch ein get statusrequest ergiebt nur folgende logdaten:
2018.01.27 10:49:21 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:49:22 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:49:28 1: MSwitch_Notif incoming for Bad_Ctrl -> HASH(0x35e2d10), HASH(0x2b76400) - ARRAY(0x363b6a8) 1226
2018.01.27 10:49:28 3: CUL_HM set HM_13E599_Sw_01 on-for-timer 300
2018.01.27 10:49:28 3: CUL_HM set HM_13E599_Sw_01 on-for-timer 300
2018.01.27 10:49:28 3: CUL_HM set HM_13E599_Sw_01 on-for-timer 300
2018.01.27 10:49:31 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 4890
2018.01.27 10:49:32 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)
2018.01.27 10:49:42 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.01.27 10:49:42 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.01.27 10:49:55 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 5051
2018.01.27 10:49:55 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout
grep: Schreibfehler: Datenübergabe unterbrochen (broken pipe)



mit bluetooth ansich scheint alles ok zu sein , wie gesagt kann ich die lampen per gatttool ansprechen, auch mit meinen XiaomiFlowerSenshabe ich keine probleme und fhem holt sich die daten.

danke und gruss Byte09

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

Byte09

Zitat von: CoolTux am 27 Januar 2018, 10:54:14
Ich schaue mal.

Hi Cooltux,

hattest du mal Zeit , ein Auge darauf zu werfen wo das Problem liegen könnte ? ( nur mal vorsichtig nachgefragt  ;) )

Gruss Byte09

CoolTux

Da ich ähnliche Beobachtungen gemacht habe kann ich erstmal sagen das es mit dem neuen bluez wohl kleine Probleme gibt. Liegt aber mehr am Modul.
Ich nehme mir schon so lange vor das um zu schreiben. Aktuell mache ich noch ein Thermostatmodul fertig und schreibe dann das Modul komplett neu.

Bisschen Geduld bitte noch. Aber nachfragen alle 2 Woche ist OK  ;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

Byte09

Dank dir für die Info

Gruss Byte09

Gesendet von meinem SM-G900F mit Tapatalk



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

Byte09

#385
Zitat von: CoolTux am 12 Februar 2018, 18:22:33
Muss Mal kurz nachfragen. Verwendest Du SSH?

nein , läuft alles über einen Pi

zumindest was hier direkt betroffen ist . Von diesem Pi erfolgen allerdings Zugriffe auf einen weiteren Pi (Hyperion )

gruss Byte09

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

Byte09

Zitat von: CoolTux am 12 Februar 2018, 18:49:13
ok. Danke Dir

Hi Cooltux,

habe jetzt mal selber angefangen zu schauen ,

das Modul kommt aus dieser schleife nicht mehr raus :

  while ( (qx(ps ax | grep -v grep | grep "gatttool -b $mac") and $loop = 0) or (qx(ps ax | grep -v grep | grep "gatttool -b $mac") and $loop < 5) ) {
            #printf "\n(Sub PLAYBULB_Run) - gatttool noch aktiv, wait 0.5s for new check\n";
            sleep 0.5;
Log3 $name, 4, "(Sub PLAYBULB_gattCharRead - $name) - loop $loop";

            $loop++;
        }


und läuft bis zum timeout

2018.02.13 17:32:18 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.02.13 17:32:18 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.02.13 17:32:18 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop gestarted  sshhost none
2018.02.13 17:32:19 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:21 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:22 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:23 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:24 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:25 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:26 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:27 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:29 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:30 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:31 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:32 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:32:33 1: Timeout for PLAYBULB_BlockingRun reached, terminated process 23685
2018.02.13 17:32:33 4: (Sphere) - The BlockingCall Process terminated unexpectedly. Timedout


... ist aber leider nicht meine Baustelle und ich müsste mich da erstmal reinarbeiten, was es da eigentlicht tut ( bzw. nicht tut ) , aber ggf. hilft es dir ja weiter.

gruss Byte09



CoolTux

Also auf den ersten Blick kommt mir

while ( (qx(ps ax | grep -v grep | grep "gatttool -b $mac") and $loop = 0)

das $loop = 0 komisch vor. Sollte sicherlich $loop == 0 heißen oder so
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

Byte09

Zitat von: CoolTux am 13 Februar 2018, 17:52:58
Also auf den ersten Blick kommt mir

while ( (qx(ps ax | grep -v grep | grep "gatttool -b $mac") and $loop = 0)

das $loop = 0 komisch vor. Sollte sicherlich $loop == 0 heißen oder so

ja, zumindest das hätte ich auch sehen können. habe das jetzt mal geändert und nun komme ich ein stück weiter und er bleibt zumindest nicht mehr in dieser schleife hängen.

leider beendet er jetzt mit folgendem log:

2018.02.13 17:55:44 4: (Sub PLAYBULB - Sphere) - Call BlockingRun
2018.02.13 17:55:45 4: (Sub PLAYBULB_Run - Sphere) - Running nonBlocking
2018.02.13 17:55:45 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop gestarted  sshhost none
2018.02.13 17:55:46 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 0
2018.02.13 17:55:47 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 1
2018.02.13 17:55:48 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 2
2018.02.13 17:55:49 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 3
2018.02.13 17:55:51 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop 4
2018.02.13 17:55:51 4: (Sub PLAYBULB_gattCharRead - Sphere) - loop verlassen
connect: Device or resource busy (16)
connect: Device or resource busy (16)
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $ccc in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $cec in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $csat in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $crgb in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $ceffect in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 1: PERL WARNING: Use of uninitialized value $cspeed in concatenation (.) or string at ./FHEM/31_PLAYBULB.pm line 334.
2018.02.13 17:55:51 4: (Sub PLAYBULB_Run - Sphere) - ccc,cec,csat,crgb,ceffect,cspeed  ,,,,,
2018.02.13 17:55:51 4: (Sub PLAYBULB_Run - Sphere) - Rückgabe an Auswertungsprogramm beginnt


verstehe ich nicht wirklich , es greift ausser der einen Lampe derzeit nicht auf btooth zu . Aber Busy bekomme ich immer, wenn der fhemdienst läuft , auch von der console ist dann kein zugriff möglich :

root@raspberrypi:/home/pi# gatttool -b E8:CD:4B:16:AC:E6 --char-read -a 0x1f    connect: Device or resource busy (16)
root@raspberrypi:/home/pi#


da ggf. noch eine idee ?

gruss Byte09