Hallo,
so langsam verzweifel ich etwas über die Unzuverlässigkeit von Bluetooth, wenn man ein Modul aufgesteckt hat.
Damit ich das RaspBee-Modul und Bluetooth nutzen kann, hab ich diese Einträge in /boot/config.txt:
dtoverlay=pi3-miniuart-bt
enable_uart=1
core_freq=250
Damit sind die richtigen "serial"-Devices schonmal angelegt:
pi@raspberrypi:~ $ ls -l /dev/serial?
lrwxrwxrwx 1 root root 7 Dez 20 18:11 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Dez 20 18:11 /dev/serial1 -> ttyS0
Die /lib/systemd/system/hciuart.service ist auch i.O.:
[Unit]
Description=Configure Bluetooth Modems connected by UART
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
Before=bluetooth.service
After=dev-serial1.device
[Service]
Type=forking
ExecStart=/usr/bin/hciattach /dev/serial1 bcm43xx 921600 noflow -
[Install]
WantedBy=multi-user.target
Nach dem Booten startet der Service aber in 95% der Fälle nicht.
Dez 21 08:33:02 raspberrypi sudo[27558]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/systemctl start hciuart.service
Dez 21 08:33:02 raspberrypi sudo[27558]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Dez 21 08:33:02 raspberrypi systemd[1]: apparmor.service: Cannot add dependency job, ignoring: Unit apparmor.service is masked.
Dez 21 08:33:02 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
-- Subject: Unit hciuart.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hciuart.service has begun starting up.
Dez 21 08:33:12 raspberrypi hciattach[27564]: Initialization timed out.
Dez 21 08:33:12 raspberrypi hciattach[27564]: bcm43xx_init
Dez 21 08:33:12 raspberrypi hciattach[27564]: Set Controller UART speed to 921600 bit/s
Dez 21 08:33:12 raspberrypi hciattach[27564]: Flash firmware /etc/firmware/BCM43430A1.hcd
Dez 21 08:33:12 raspberrypi systemd[1]: hciuart.service: Control process exited, code=exited status=1
Dez 21 08:33:12 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
-- Subject: Unit hciuart.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hciuart.service has failed.
--
-- The result is failed.
Dez 21 08:33:12 raspberrypi systemd[1]: hciuart.service: Unit entered failed state.
Dez 21 08:33:12 raspberrypi sudo[27558]: pam_unix(sudo:session): session closed for user root
Dez 21 08:33:12 raspberrypi systemd[1]: hciuart.service: Failed with result 'exit-code'.
Starte ich den Service manuell mit sudo systemctl start hciuart.service, dann kann ich Glück haben und er startet, ein anderes Mal läuft er auch nach 10 Versuchen noch nicht.
Gibt es keine Möglichkeit, Bluetooth und Module stabil zu nutzen? Ich könnte natürlich einen BT-Dongle verwenden, aber wozu hab ich BT denn eingebaut?
kennst du das wiki?
hier wird wegen timingproblemen beim booten noch eine verzögerung von fhem empfohlen https://wiki.fhem.de/wiki/Raspberry_Pi_3:_GPIO-Port_Module_und_Bluetooth (https://wiki.fhem.de/wiki/Raspberry_Pi_3:_GPIO-Port_Module_und_Bluetooth)
Ja, kenne ich. ;)
Das Problem besteht aber unabhängig von fhem. Der Service will einfach nicht starten, auch manuelles Starten funktioniert ja nicht immer. Das Schlimme ist, daß der Start ja auch ab und zu funktioniert, beim nächsten Mal dann aber ohne irgendwelche Änderungen nicht mehr.
Ich dachte, ich finde hier noch jemanden, der vielleicht ein ähnliches Problem hat, bevor ich mich mal wieder in diversen anderen Foren anmelde. Ich habe mir schon etliche Seiten dazu im Netz durchgelesen, entsprechende Empfehlungen umgesetzt, aber leider bisher ohne Erfolg.
bei mir leider das selbe.
beim letzten reboot vor einer woche konnte der service nicht gestartet werden.
manuell hat es gerade beim ersten mal zufällig funktioniert. :)
dann aber, mal ja, mal nein, egal ob mit oder ohne fhem.
schade, eigentlich wollte ich die tage mal bluetooth nutzen.
Sorry, aber was sagen die Logfiles?
Ohne Input wirst Du kein Output kriegen ...
es gibt leider keine weiteren meldungen. lediglich der timeout mit den abbruch meldungen aus dem syslog, wie es im ersten post bereits zu sehen war. wenn der service gestartet wird, hat auch der kernel eine menge zu berichten. so scheint aber das signal durch den timeout zu "versanden", warum auch immer.
Dec 21 17:11:16 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dec 21 17:11:46 raspberrypi hciattach[12353]: Initialization timed out.
Dec 21 17:11:46 raspberrypi hciattach[12353]: bcm43xx_init
Dec 21 17:11:46 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dec 21 17:11:46 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dec 21 17:11:46 raspberrypi systemd[1]: Unit hciuart.service entered failed state.
Du startest mit dem systemd, dort kann man auch nach logausgaben gucken ;o)
In der kürze nur auf English gefunden:
https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs (https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs)
[offtopic]
Ich kann leider momentan nicht nach den Logs sehen, da ich gestern abend festgestellt habe, daß alle fhem-Backups, die ich jede Nacht auf dem NAS sichere, Schrott sind. :o
Natürlich, nachdem ich das System neu aufgesetzt habe. ::) Aus unerfindlichen Gründen hat gzip die tar-Dateien geschrottet, so daß ich nur noch einen Teil meiner Konfiguration zurück sichern konnte.
[/offtopic]
Zumindest startet auch auf einem völlig jungfräulichen System hciuart nur je nach Lust und Laune und auf keinen Fall zuverlässig.
Zitat von: Wernieman am 22 Dezember 2016, 13:33:00
Du startest mit dem systemd, dort kann man auch nach logausgaben gucken ;o)
In der kürze nur auf English gefunden:
https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs (https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs)
schöne anleitung, aber mehr infos kommen leider nicht.
Ich habe auch nicht mehr im syslog:
Dec 22 17:44:22 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dec 22 17:44:22 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dec 22 17:44:22 raspberrypi systemd[1]: Unit hciuart.service entered failed state.
Dec 22 17:45:27 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dec 22 17:45:57 raspberrypi hciattach[14646]: Initialization timed out.
Dec 22 17:45:57 raspberrypi hciattach[14646]: bcm43xx_init
Dec 22 17:45:57 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dec 22 17:45:57 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dec 22 17:45:57 raspberrypi systemd[1]: Unit hciuart.service entered failed state.
pi@raspberrypi:~ $ sudo journalctl -u hciuart.service --since today --no-pager
-- Logs begin at Do 2016-12-22 16:30:08 CET, end at Do 2016-12-22 17:55:14 CET. --
Dez 22 16:30:11 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dez 22 16:30:48 raspberrypi hciattach[376]: Initialization timed out.
Dez 22 16:30:48 raspberrypi hciattach[376]: bcm43xx_init
Dez 22 16:30:48 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dez 22 16:30:48 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dez 22 16:30:48 raspberrypi systemd[1]: Unit hciuart.service entered failed state.
Dez 22 17:43:52 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dez 22 17:44:22 raspberrypi hciattach[14318]: Initialization timed out.
Dez 22 17:44:22 raspberrypi hciattach[14318]: bcm43xx_init
Dez 22 17:44:22 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dez 22 17:44:22 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dez 22 17:44:22 raspberrypi systemd[1]: Unit hciuart.service entered failed state.
Dez 22 17:45:27 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Dez 22 17:45:57 raspberrypi hciattach[14646]: Initialization timed out.
Dez 22 17:45:57 raspberrypi hciattach[14646]: bcm43xx_init
Dez 22 17:45:57 raspberrypi systemd[1]: hciuart.service: control process exited, code=exited status=1
Dez 22 17:45:57 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.
Dez 22 17:45:57 raspberrypi systemd[1]: Unit hciuart.service entered failed state.