Divoom Aurabox + Timebox + TimeboxEvo [Update, kommunizieren funktioniert]

Begonnen von schwatter, 25 Dezember 2017, 23:37:43

Vorheriges Thema - Nächstes Thema

schwatter

@namron2000

Poste bitte die Ausgabe von dmesg aus Terminal. Das per Code einfügen oder als Anhang.

Bei mir mit der Suche nach Bluetooth:

root@raspi4fhem:~# dmesg | grep "Bluetooth:"
[   14.308562] Bluetooth: Core ver 2.22
[   14.308651] Bluetooth: HCI device and connection manager initialized
[   14.308672] Bluetooth: HCI socket layer initialized
[   14.308687] Bluetooth: L2CAP socket layer initialized
[   14.308731] Bluetooth: SCO socket layer initialized
[   14.322641] Bluetooth: HCI UART driver ver 2.3
[   14.322655] Bluetooth: HCI UART protocol H4 registered
[   14.322770] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   14.323037] Bluetooth: HCI UART protocol Broadcom registered
[   14.512661] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   14.512667] Bluetooth: BNEP filters: protocol multicast
[   14.512677] Bluetooth: BNEP socket layer initialized
[   14.622027] Bluetooth: RFCOMM TTY layer initialized
[   14.622047] Bluetooth: RFCOMM socket layer initialized
[   14.622062] Bluetooth: RFCOMM ver 1.11
root@raspi4fhem:~#


Und bitte nochmal sudo systemctl status blue*
Schaut bei mir so aus:

root@raspi4fhem:~# sudo systemctl status blue*
● bluealsa.service - BluezALSA proxy
   Loaded: loaded (/lib/systemd/system/bluealsa.service; static; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-30 22:11:17 CEST; 23h ago
Main PID: 427 (bluealsa)
    Tasks: 3 (limit: 4915)
   Memory: 3.0M
   CGroup: /system.slice/bluealsa.service
           └─427 /usr/bin/bluealsa

Sep 30 22:11:17 raspi4fhem systemd[1]: Started BluezALSA proxy.

● bluetooth.target - Bluetooth
   Loaded: loaded (/lib/systemd/system/bluetooth.target; static; vendor preset: enabled)
   Active: active since Mon 2019-09-30 22:11:17 CEST; 23h ago
     Docs: man:systemd.special(7)

Sep 30 22:11:17 raspi4fhem systemd[1]: Reached target Bluetooth.

● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-09-30 22:11:17 CEST; 23h ago
     Docs: man:bluetoothd(8)
Main PID: 424 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   Memory: 3.8M
   CGroup: /system.slice/bluetooth.service
           └─424 /usr/lib/bluetooth/bluetoothd --noplugin=sap

Sep 30 22:11:17 raspi4fhem systemd[1]: Starting Bluetooth service...
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Bluetooth daemon 5.50
Sep 30 22:11:17 raspi4fhem systemd[1]: Started Bluetooth service.
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Starting SDP server
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Excluding (cli) sap
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Bluetooth management interface 1.14 initialized
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Endpoint registered: sender=:1.6 path=/org/bluez/hci0/A2DP/SBC/Source/1
Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Failed to set privacy: Rejected (0x0b)
Oct 01 06:51:42 raspi4fhem bluetoothd[424]: /org/bluez/hci0/dev_11_75_58_45_59_81/fd0: fd(24) ready
root@raspi4fhem:~#                           


edit:

Noch 2 Gegebenheiten können dazu führen, das es nicht richtig funktioniert.


  • Undervolting durch einen Monitor. Du benutzt einen Dektop. Kabel ab, per SSH einloggen und Scripte starten
  • Update von einer Version zur anderen. Du hast von Jessi auf Stretch geupdatet.

schwatter

Bei mir funktioniert alles wie gewünscht, aber einen Fehler habe ich noch bei mir entdeckt.

Sep 30 22:11:17 raspi4fhem bluetoothd[424]: Failed to set privacy: Rejected (0x0b)

Abhilfe schafft /lib/systemd/system/bthelper@.service zu ergenzen

[Service]
Type=simple
ExecStartPre=/bin/sleep 2
ExecStart=/usr/bin/bthelper %I


Erklärung hier, ganz unten.

https://github.com/RPi-Distro/pi-bluetooth/issues/8


Werde die Info im ersten Post einfügen.

namron2000

@schwatter
Hier sind die Outputs:
pi@raspberrypi:~ $ dmesg | grep "Bluetooth:"
[   18.285725] Bluetooth: Core ver 2.22
[   18.285802] Bluetooth: HCI device and connection manager initialized
[   18.285824] Bluetooth: HCI socket layer initialized
[   18.285838] Bluetooth: L2CAP socket layer initialized
[   18.285869] Bluetooth: SCO socket layer initialized
[   18.316033] Bluetooth: RFCOMM TTY layer initialized
[   18.316060] Bluetooth: RFCOMM socket layer initialized
[   18.316078] Bluetooth: RFCOMM ver 1.11
[   27.327726] Bluetooth: HCI UART driver ver 2.3
[   27.327753] Bluetooth: HCI UART protocol H4 registered
[   27.327865] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   27.328119] Bluetooth: HCI UART protocol Broadcom registered
[   31.350896] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   31.350904] Bluetooth: BNEP filters: protocol multicast
[   31.350918] Bluetooth: BNEP socket layer initialized


pi@raspberrypi:~ $ sudo systemctl status blue*
● bluez-5.49.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

● bluez-5.49.tar.xz.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

● bluez-alsa-master.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)



Die Dimmfunktionen funktionieren. Aber wenn die Befehle der setTime.pl ausprobiere wird der Pixoo schwarz und reagiert gar nicht mehr auch nicht mit dem Button. Muss ich dann neu starten :/

schwatter

Es gibt ungünstige Konstellationen von Funktionen.
Probier mal nach dem Timesync zu dimmen auf
50% oder 100%. Meist ist das Display nur auf
Null gedimmt.

namron2000

Also, bei mir gehen nicht alle Befehle, wenn ich in setScreen.pl  set clock ausführe kommt die Temperatur und das Datum. Ich komme durch keinen Befehl auf Die Normale Uhr zurück. Die set animation App und der equalizer gehen ohne Probleme. Die andere Befehle führen Teilweise auch ander Sachen aus. Könntest du mir deine Datein für das Pixoo noch mal schicken oder Posten. Denke das die Befehle zum teil nicht für das Pixoo stimmen.

mumpitzstuff

Die Befehle unterscheiden sich leider mehr oder weniger bei allen Geräten von Divoom. Aurabox und Timebox sind noch sehr ähnlich, bei der TimeBoxEvo und Pixoo sieht es dagegen schon ganz anders aus.

schwatter

Da hat der mumpitzstuff recht.

@namron2000

Im ersten Post sind doch Rawcodebeispiele. Musst
du durchscrollen.

mumpitzstuff

So habe jetzt die Timebox wieder eingebunden und dein Clocksync Script geht. Allerdings habe ich immer noch das Problem, das nach einem disconnect im Script das bluetooth Symbol 10-15 Skunden auf der Timebox blinkt und danach erst wieder zum letzten eingestellten Screen wechselt. Das ist irgendwie nervig.
Ich wollte es daraufhin mal mit pairen versuchen, das hat aber nicht geplappt. Ich kann immer nur mit connect auf die Timebox zugreifen

schwatter

Ok super.

Merkwürdig, bei mir funktioniert der Reconnect im Moment tadellos. Getestet mit aktuellem Buster und der alten Aurabox sowie TimeboxEvo.
Für die Aurabox habe ich im Moment nur /etc/asound.conf angepasst

pcm.!default {
        type plug
        slave.pcm {
                type bluealsa
                device "11:75:58:45:59:81" #Aurabox <- hier passende Mac des Speakers eintragen
                profile "a2dp"
delay 10000
        }
}


Falls das nicht reicht, folgendes in der /etc/rc.local einfügen

echo -e "connect 11:75:58:45:59:81" | bluetoothctl


mumpitzstuff

Hmm komisch irgendwann ging es. Habe auch mit Trust gespielt usw. Connect musste ich auch 2x machen, denn beim ersten Mal wurde nur der Speaker connected und erst beim zweiten Mal die eigentliche timebox. Dummerweise ist ja die Mac gleich und nur der Port unterscheidet sich.

schwatter

Wenn etwas seitens der Treiber vermurkst ist, dann so richtig  ;D

Bei meiner Aurabox war das vorgehen am Anfang von bluealsa immer

1. Es funktionierte nicht, dann in bluetoothctl untrust, delete und reboot.
2. Scan on, pair der Box, trust der Box.
3. Anlegen oder hinzufügen wie oben in der asound.conf
4. Die rc.local folgendermaßen angepasst.

#!/bin/bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 2
echo -e "connect 11:75:58:45:59:81" | bluetoothctl
sleep 5
rfcomm bind 0 11:75:58:45:59:81 1
exit 0


Das sleep war wichtig, wegen Timing.

5. Ein Reboot, und der war auch immer wichtig. Weil es nur danach funktionierte, und auch nur dann. Disconnect und Connect im laufenden Betrieb ging nicht.

LaMa163

Hallo,

die Integration in FHEM funktioniert bei mir nicht wirklich.
Wenn ich in der FHEM Kommandozeile:

{system("sudo perl /opt/fhem/divoom/setWeather.pl &")}

eingebe, passiert leider nix. Wenn ich:

perl setWeather.pl

im Terminal eingebe, schaltet die Timebox korrekt auf die Wetteransicht um.
Die Rechte sollten ok sein:

pi@FHEM:/opt/fhem/divoom $ ls -la
insgesamt 100
drwxr-xr-x  4 fhem dialout  4096 Dez 27 20:13 .
drwxrwxrwx 14 fhem dialout  4096 Dez 25 21:37 ..
drwxr-xr-x  2 fhem dialout  4096 Dez 25 21:36 aurabox
-rw-r--r--  1 fhem dialout  3735 Dez 25 21:36 commands.txt
-rw-r--r--  1 fhem dialout 10852 Dez 25 21:39 divoom.pl
-rw-r--r--  1 fhem dialout 35149 Dez 25 21:36 LICENSE
-rw-r--r--  1 fhem dialout  3943 Dez 25 21:36 README.md
-rw-r--r--  1 fhem dialout   946 Dez 25 22:10 setAnimation.pl
-rw-r--r--  1 fhem dialout   545 Dez 25 21:36 setCalendar.pl
-rw-r--r--  1 fhem dialout   164 Dez 26 22:22 setClock.pl
-rw-r--r--  1 fhem dialout   280 Dez 26 20:28 setPicture.pl
-rw-r--r--  1 fhem dialout   294 Dez 25 21:36 setPictureTbEvo.pl
-rw-r--r--  1 fhem dialout   488 Dez 26 21:29 setScreen.pl
-rw-r--r--  1 fhem dialout   801 Dez 25 22:15 setWeather.pl
drwxr-xr-x  2 fhem dialout  4096 Dez 25 21:36 timebox


Hat jemand eine Idee?

schwatter

Morgen,

ich nutze

fhem    ALL=NOPASSWD: ALL

in /etc/sudoers. Was grundsätzlich nicht zu empfehlen ist. Löst aber (ist schon lange her, ich weiß es nicht mehr genau) das Problem.

Schau mal hier. Da gibt es auch eine sichere Lösung.

https://forum.fhem.de/index.php/topic,12611.15.html

LaMa163

Hi,

hilt leider nicht. Timebox reagiert weiterhin nicht auf FHEM Befehle.

Das Logfile sagt:

Can't locate ./divoom.pl in @INC (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabihf/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabihf/perl-base) at /opt/fhem/divoom/setWeather.pl line 2.

schwatter

Morgen,

ändere mal den Pfad im Script (Arbeitsverzeichnis).

require "./divoom.pl";

zu

require "/opt/fhem/divoom2/divoom.pl";