[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

CoolTux

Ok hast Jessie das ist gut.
Wir testen nachher mal was. Melde mich, bin gerade unterwegs.
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


gatttool -b MAC --char-read -a 23

und dann

gatttool -b MAC --char-read -a 21


Hier sollte auf alle Fälle was passieren
23 ist 8 Zeichen lang und die 21 ist 16 Zeichen lang
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

joshi

outhouse: ich habe da ein python script geschrieben, dessen Output würde wohl weiterhelfen.

Du müsstest darin deine Bluetooth Mac ändern und dann mit Python ausführen https://github.com/00joshi/playbulb-scan/blob/master/playbulb-scan.py

outhouse

Zitat von: CoolTux am 21 Januar 2017, 17:17:02

gatttool -b MAC --char-read -a 23

und dann

gatttool -b MAC --char-read -a 21


Hier sollte auf alle Fälle was passieren
23 ist 8 Zeichen lang und die 21 ist 16 Zeichen lang

CoolTux. Erst mal besten Dank für deine Geduld

Habe zuerst ein Reboot durchgeführt. Dann die erste Eingabe. Da dauert es gefühlte 30 Sekunden und ich erhalte:
connect error: Connection refused (111)

Erneute Eingabe des ersten Code ergibt:
connect error: Too many levels of symbolic links (40)

Gruss Chris
Raspberry 4 B mit Raspberry Pi OS und FHEM-Image 6.3 von fhem.de
Cul CC 1101 V4 als CUL_HM
Cul V3.4 + V3.4 als RFR
enocean-pi

outhouse

#94
Zitat von: joshi am 21 Januar 2017, 17:36:34
outhouse: ich habe da ein python script geschrieben, dessen Output würde wohl weiterhelfen.

Du müsstest darin deine Bluetooth Mac ändern und dann mit Python ausführen https://github.com/00joshi/playbulb-scan/blob/master/playbulb-scan.py

Hallo Joshi. Herzlichen Dank

Habe das Script auf den Raspi gespitzt. Bei der Ausführung erhalte ich folgende Meldung:

root@raspberrypi3:~# python /opt/fhem/script/playbulb-scan.py
Traceback (most recent call last):
  File "/opt/fhem/script/playbulb-scan.py", line 2, in <module>
    from bluepy.btle import *
ImportError: No module named bluepy.btle
root@raspberrypi3:~#


Nachdem ich "bluepy" nachinstalliert habe, erhalte ich:
root@raspberrypi3:~# python /opt/fhem/script/playbulb-scan.py
Traceback (most recent call last):
  File "/opt/fhem/script/playbulb-scan.py", line 5, in <module>
    MyPlaybulp = Peripheral("A6:7A:4B:0F:AC:E6")
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 318, in __init__
    self.connect(deviceAddr, addrType, iface)
  File "/usr/local/lib/python2.7/dist-packages/bluepy/btle.py", line 367, in connect
    "Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral A6:7A:4B:0F:AC:E6, addr type: public
Raspberry 4 B mit Raspberry Pi OS und FHEM-Image 6.3 von fhem.de
Cul CC 1101 V4 als CUL_HM
Cul V3.4 + V3.4 als RFR
enocean-pi

CoolTux

Zitat von: outhouse am 22 Januar 2017, 07:03:48
CoolTux. Erst mal besten Dank für deine Geduld

Habe zuerst ein Reboot durchgeführt. Dann die erste Eingabe. Da dauert es gefühlte 30 Sekunden und ich erhalte:
connect error: Connection refused (111)

Erneute Eingabe des ersten Code ergibt:
connect error: Too many levels of symbolic links (40)

Gruss Chris

Hallo Chris,

Also das scheitert ja schon bei der eigentlichen Verbindung. Du hast anscheinend ein Raspi3, ich weiß das es da so einiges zu beachten gab mit BT. Schau mal hier im Thread nach Raspi3 da findest Du ein paar Infos.



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

outhouse

Zitat von: CoolTux am 22 Januar 2017, 07:34:06
Du hast anscheinend ein Raspi3, ich weiß das es da so einiges zu beachten gab mit BT. Schau mal hier im Thread nach Raspi3 da findest Du ein paar Infos.

Danke für deine Hilfe. Habe eigentlich alles gem Wiki befolgt. Werde mich aber nochmals schlau machen

Gruss Chris
Raspberry 4 B mit Raspberry Pi OS und FHEM-Image 6.3 von fhem.de
Cul CC 1101 V4 als CUL_HM
Cul V3.4 + V3.4 als RFR
enocean-pi

CoolTux

Ich schaue bei Gelegenheit auch mal. Heute wird das aber nichts.
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

RaspiLED

Hi outhouse,
Ich habe es gerade auch mal versucht. Raspi2/OSMC Dez. 2016/USB BT4 Dongle
Also gleiches Bild wie bei Dir. Nach installieren von Bluepy ebenfalls. Dann:
sudo rfkill list
sudo rfkill unblock all
sudo hciconfig
sudo hciconfig hci0 up
Und danach das Python Script mit richtiger MAC und sudo aufrufe geht es! Einmal ;-)
Danach ist bei mir ein sudo hciconfig reset
sudo hciconfig hci0 down
sudo hciconfig hci0 up
notwendig ;-)

Hat hier jemand ähnlich zickige BT Dongles?

Gruß Arnd



Gesendet von iPhone mit Tapatalk
Raspberry Pi mit FHEM, CUL, Signalduino, MySensors, HomeBridge, Presence, WifiLight2, Bravia, ...

joshi

bei mir funktionierte Bluetooth mit einem aktuellen Raspbian (Jan 17) auf einem Raspberry Pi 3 out of the box ...

outhouse

#100
Zitat von: RaspiLED am 22 Januar 2017, 11:33:07
Hi outhouse,
Ich habe es gerade auch mal versucht. Raspi2/OSMC Dez. 2016/USB BT4 Dongle
Also gleiches Bild wie bei Dir. Nach installieren von Bluepy ebenfalls. Dann:
sudo rfkill list
sudo rfkill unblock all
sudo hciconfig
sudo hciconfig hci0 up
Und danach das Python Script mit richtiger MAC und sudo aufrufe geht es! Einmal ;-)
Danach ist bei mir ein sudo hciconfig reset
sudo hciconfig hci0 down
sudo hciconfig hci0 up
notwendig ;-)

Hallo Joshi

Besten Dank für deine Info. Habe mit dem Python noch immer dieselben Fehlerangaben.

Inzwischen habe ich bluez vollständig de- und neu installiert. Jetzt verbindet sich gatttool mit dem Playbulb Garden

root@raspberrypi3:~# gatttool -b A6:7A:4B:0F:AC:E6 -I
[A6:7A:4B:0F:AC:E6][LE]> connect
Attempting to connect to A6:7A:4B:0F:AC:E6
Connection successful
Notification handle = 0x000e value: ff 00 00 00 25 0b ff 03
[A6:7A:4B:0F:AC:E6][LE]>


Im Fhem habe ich nach einem StatusRequest aber nach wie vor den state auf "unreachable"

Mit:
gatttool -b MAC --char-read -a 23
und
gatttool -b MAC --char-read -a 21

erhalte ich ebenfalls noch immer dieselben Fehlermeldungen

Raspberry 4 B mit Raspberry Pi OS und FHEM-Image 6.3 von fhem.de
Cul CC 1101 V4 als CUL_HM
Cul V3.4 + V3.4 als RFR
enocean-pi

peterk_de

Hallo zusammen,

nach Umzug von FHEM von Ubuntu 14 auf Ubuntu 16 und in eine VM bekomme ich leider auch nur einen State "unreachable":

2017.02.03 14:48:22.421 1: Timeout for PLAYBULB_Run reached, terminated process 3829
2017.02.03 14:48:29.810 4: (Sub PLAYBULB - stube.kerze) - Starte Blocking Call
2017.02.03 14:48:29.817 4: (Sub PLAYBULB_Run - stube.kerze) - Running nonBlocking


gatttool funktioniert aber offenbar:

~$ gatttool -b AC:E6:4B:06:F9:F9 --char-read -a 23
Characteristic value/descriptor: 0a 18 00 fd ff


Gibt es irgendwelche Schräubchen, an denen ich noch mal drehen sollte? ;-)
FHEM auf Ubuntu-VM / 2xNUC Proxmox Cluster
UI: HomeKit, TabletUI, Grafana
IOdevs: 2xHueBridge, RaspiMatic-CCU, CUL868, 2xHarmonyHub, 6xRaspi-Roomnode mit CO2, VOC und lepresenced
Devices: 107xHomematic(IP), 96xPhilips Hue, 17xTECHEM, 12xBTLE, 8xSONOS, 2xHomeConnect, 1xShelly 3em, 1xNanoleaf ...

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

peterk_de

Cooltux, der Auszug aus dem Log oben ist schon mit verbose 5 entstanden, sonst kam da nur die erste der 3 Zeilen. Das war übrigens von einem set ... statusRequest.
FHEM auf Ubuntu-VM / 2xNUC Proxmox Cluster
UI: HomeKit, TabletUI, Grafana
IOdevs: 2xHueBridge, RaspiMatic-CCU, CUL868, 2xHarmonyHub, 6xRaspi-Roomnode mit CO2, VOC und lepresenced
Devices: 107xHomematic(IP), 96xPhilips Hue, 17xTECHEM, 12xBTLE, 8xSONOS, 2xHomeConnect, 1xShelly 3em, 1xNanoleaf ...

CoolTux

Ok, so ein Mist. Kannst du denn schalten? Und der gatttool Aufruf ist auch aus der VM?
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