Giter Site home page Giter Site logo

Comments (23)

BelgarionNL avatar BelgarionNL commented on May 27, 2024 11

also getting this straight out of the box after a clean image....

from pi-bluetooth.

skrenes avatar skrenes commented on May 27, 2024 3

Yeah, BT isn't working when this error intermittently occurs (about 80% of the boots on my Pi4). It seems to be a race condition because it'll always work when I restart the service at the prompt. So I've disabled the service (sudo systemctl disable hciuart.service) and then restart the service after booting. My children have a retropie setup, so in its autostart.sh file, before it runs emulationstation, I have the command sudo systemctl restart hciuart.service. Works as a flawless bandaid until this is resolved.

from pi-bluetooth.

AloisKlingler avatar AloisKlingler commented on May 27, 2024 2

@hkayann contrary my last comment, the issue was not reliable solved.
I used now systemd edit to add an override for the affected service, and just restart it on failure. with this the issue is completely gone for me.
the content of /etc/systemd/system/hciuart.service.d/override.conf :

[Unit]
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
Restart=on-failure
RestartSec=5

Best regards

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024 2

You might want to try with dtparam=krnbt in config.txt, which gives the task of initialising the BT modem to the kernel. This is likely to become the default in the future.

from pi-bluetooth.

AloisKlingler avatar AloisKlingler commented on May 27, 2024 1

Yeah, BT isn't working when this error intermittently occurs (about 80% of the boots on my Pi4). It seems to be a race condition because it'll always work when I restart the service at the prompt. So I've disabled the service (sudo systemctl disable hciuart.service) and then restart the service after booting. My children have a retropie setup, so in its autostart.sh file, before it runs emulationstation, I have the command sudo systemctl restart hciuart.service. Works as a flawless bandaid until this is resolved.

thank you - this one works for me as well. :-)

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024

0.1.17 was released yesterday. Please update and report back.

from pi-bluetooth.

drankinatty avatar drankinatty commented on May 27, 2024

Oh, I'm sorry, the log entries I provided for May 21 corresponded to the install of 0.1.17. The terminal lines before the hciuart errors were:

Preparing to unpack .../pi-bluetooth_0.1.17_all.deb ...
Unpacking pi-bluetooth (0.1.17) over (0.1.16) ...
Setting up pi-bluetooth (0.1.17) ...
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024

Please do a full reboot, run this command and post the contents of btlog.txt:

$ grep -i -E "(bt|blue|\bhci)" /var/log/syslog | tail -100 > btlog.txt

from pi-bluetooth.

drankinatty avatar drankinatty commented on May 27, 2024

Here are the logs from each Pi. First the P3:

$ cat btlog.txt
May 22 18:37:18 raspberrypi systemd[1]: Removed slice system-bthelper.slice.
May 22 18:37:27 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
May 22 18:37:31 raspberrypi kernel: [   15.746924] Bluetooth: Core ver 2.22
May 22 18:37:31 raspberrypi kernel: [   15.747033] Bluetooth: HCI device and connection manager initialized
May 22 18:37:31 raspberrypi kernel: [   15.749560] Bluetooth: HCI socket layer initialized
May 22 18:37:31 raspberrypi kernel: [   15.749580] Bluetooth: L2CAP socket layer initialized
May 22 18:37:31 raspberrypi kernel: [   15.749608] Bluetooth: SCO socket layer initialized
May 22 18:37:31 raspberrypi kernel: [   15.773175] Bluetooth: HCI UART driver ver 2.3
May 22 18:37:31 raspberrypi kernel: [   15.773191] Bluetooth: HCI UART protocol H4 registered
May 22 18:37:31 raspberrypi kernel: [   15.773279] Bluetooth: HCI UART protocol Three-wire (H5) registered
May 22 18:37:31 raspberrypi btuart[375]: bcm43xx_init
May 22 18:37:31 raspberrypi btuart[375]: Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
May 22 18:37:31 raspberrypi btuart[375]: Set BDADDR UART: b8:27:eb:cd:d2:66
May 22 18:37:31 raspberrypi btuart[375]: Set Controller UART speed to 921600 bit/s
May 22 18:37:31 raspberrypi btuart[375]: Device setup complete
May 22 18:37:31 raspberrypi kernel: [   15.775015] Bluetooth: HCI UART protocol Broadcom registered
May 22 18:37:31 raspberrypi systemd[1]: Started Configure Bluetooth Modems connected by UART.
May 22 18:37:31 raspberrypi systemd[1]: Created slice system-bthelper.slice.
May 22 18:37:31 raspberrypi systemd[1]: Starting Raspberry Pi bluetooth helper...
May 22 18:37:32 raspberrypi bthelper[813]: Can't init device hci0: Operation not possible due to RF-kill (132)
May 22 18:37:32 raspberrypi systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
May 22 18:37:32 raspberrypi systemd[1]: [email protected]: Failed with result 'exit-code'.
May 22 18:37:32 raspberrypi systemd[1]: Failed to start Raspberry Pi bluetooth helper.
May 22 18:37:32 raspberrypi systemd[1]: Starting Bluetooth service...
May 22 18:37:32 raspberrypi bluetoothd[816]: Bluetooth daemon 5.50
May 22 18:37:32 raspberrypi systemd[1]: Started Bluetooth service.
May 22 18:37:32 raspberrypi systemd[1]: Reached target Bluetooth.
May 22 18:37:32 raspberrypi bluetoothd[816]: Starting SDP server
May 22 18:37:32 raspberrypi bluetoothd[816]: Excluding (cli) sap
May 22 18:37:32 raspberrypi kernel: [   16.084252] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
May 22 18:37:32 raspberrypi kernel: [   16.084273] Bluetooth: BNEP filters: protocol multicast
May 22 18:37:32 raspberrypi kernel: [   16.084384] Bluetooth: BNEP socket layer initialized
May 22 18:37:32 raspberrypi dbus-daemon[384]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.27' (uid=0 pid=816 comm="/usr/lib/bluetooth/bluetoothd --noplugin=sap ")
May 22 18:37:32 raspberrypi bluetoothd[816]: Bluetooth management interface 1.18 initialized
May 22 18:37:32 raspberrypi bluetoothd[816]: Failed to set mode: Blocked through rfkill (0x12)

And now from the Pi 3+:

$ cat btlog.txt
May 22 18:37:14 raspberryz systemd[1]: Removed slice system-bthelper.slice.
May 22 18:37:21 raspberryz systemd[1]: Starting Configure Bluetooth Modems connected by UART...
May 22 18:37:29 raspberryz kernel: [   18.873939] Bluetooth: Core ver 2.22
May 22 18:37:29 raspberryz kernel: [   18.874077] Bluetooth: HCI device and connection manager initialized
May 22 18:37:29 raspberryz kernel: [   18.874182] Bluetooth: HCI socket layer initialized
May 22 18:37:29 raspberryz kernel: [   18.874205] Bluetooth: L2CAP socket layer initialized
May 22 18:37:29 raspberryz kernel: [   18.874236] Bluetooth: SCO socket layer initialized
May 22 18:37:29 raspberryz kernel: [   18.893806] Bluetooth: HCI UART driver ver 2.3
May 22 18:37:29 raspberryz kernel: [   18.893864] Bluetooth: HCI UART protocol H4 registered
May 22 18:37:29 raspberryz kernel: [   18.894453] Bluetooth: HCI UART protocol Three-wire (H5) registered
May 22 18:37:29 raspberryz kernel: [   18.894878] Bluetooth: HCI UART protocol Broadcom registered
May 22 18:37:29 raspberryz btuart[358]: bcm43xx_init
May 22 18:37:29 raspberryz btuart[358]: Flash firmware /lib/firmware/brcm/BCM4345C0.hcd
May 22 18:37:29 raspberryz btuart[358]: Set BDADDR UART: b8:27:eb:33:d1:c8
May 22 18:37:29 raspberryz btuart[358]: Set Controller UART speed to 3000000 bit/s
May 22 18:37:29 raspberryz btuart[358]: Device setup complete
May 22 18:37:29 raspberryz systemd[1]: Started Configure Bluetooth Modems connected by UART.
May 22 18:37:29 raspberryz systemd[1]: Created slice system-bthelper.slice.
May 22 18:37:29 raspberryz systemd[1]: Starting Raspberry Pi bluetooth helper...
May 22 18:37:29 raspberryz bthelper[865]: Raspberry Pi BDADDR already set
May 22 18:37:29 raspberryz systemd[1]: Started Raspberry Pi bluetooth helper.
May 22 18:37:29 raspberryz systemd[1]: Starting Bluetooth service...
May 22 18:37:29 raspberryz bluetoothd[877]: Bluetooth daemon 5.50
May 22 18:37:29 raspberryz systemd[1]: Started Bluetooth service.
May 22 18:37:29 raspberryz systemd[1]: Reached target Bluetooth.
May 22 18:37:29 raspberryz bluetoothd[877]: Starting SDP server
May 22 18:37:29 raspberryz bluetoothd[877]: Excluding (cli) sap
May 22 18:37:29 raspberryz dbus-daemon[360]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.20' (uid=0 pid=877 comm="/usr/lib/bluetooth/bluetoothd --noplugin=sap ")
May 22 18:37:29 raspberryz bluetoothd[877]: Bluetooth management interface 1.18 initialized
May 22 18:37:29 raspberryz kernel: [   19.237201] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
May 22 18:37:29 raspberryz kernel: [   19.237213] Bluetooth: BNEP filters: protocol multicast
May 22 18:37:29 raspberryz kernel: [   19.237229] Bluetooth: BNEP socket layer initialized
May 22 18:37:30 raspberryz bluetoothd[877]: Failed to set privacy: Rejected (0x0b)
May 22 18:37:34 raspberryz bthelper[865]: Changing power off succeeded
May 22 18:37:34 raspberryz bthelper[865]: Changing power on succeeded

Strange that there logs are slightly different, the first on the Pi3 where bthelper fails, then on Pi3+ were bluetoothd complains about a permissions/privacy issue. It almost looks like the boot sequence ordering is different between the two boxes, though I have been through /etc/systemd/system/... with a fine-toothed comb and ensured they are the same.

I'm happy to send anything else you need. Just let me know and post it as soon as I can.

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024
May 22 18:37:32 raspberrypi bthelper[813]: Can't init device hci0: Operation not possible due to RF-kill (132)

Something (probably the user) has disabled Bluetooth, using either the lxpanel Bluetooth plugin or the rfkill command line utility.

from pi-bluetooth.

drankinatty avatar drankinatty commented on May 27, 2024

Well, that one on the Pi 3 was easy enough to fix -- I wonder what dummy did that.... (I plead the 5th)

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024

The privacy failure is on the list of things to investigate, but I'm not aware of it causing real problems. Are you saying that Bluetooth is not working on the 3B+?

from pi-bluetooth.

drankinatty avatar drankinatty commented on May 27, 2024

Bluetooth seems to be up and running fine. It is more of an annoyance error that I don't know what is causing it and whether I should be worried. From the searches I did before opening this ticket, it looks like it isn't hurting anything. Here is the status of bluetooth on the 3+:

● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-05-22 18:37:29 CDT; 2 days ago
     Docs: man:bluetoothd(8)
 Main PID: 877 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 2062)
   CGroup: /system.slice/bluetooth.service
           └─877 /usr/lib/bluetooth/bluetoothd --noplugin=sap

May 22 18:37:29 raspberryz systemd[1]: Starting Bluetooth service...
May 22 18:37:29 raspberryz bluetoothd[877]: Bluetooth daemon 5.50
May 22 18:37:29 raspberryz systemd[1]: Started Bluetooth service.
May 22 18:37:29 raspberryz bluetoothd[877]: Starting SDP server
May 22 18:37:29 raspberryz bluetoothd[877]: Excluding (cli) sap
May 22 18:37:29 raspberryz bluetoothd[877]: Bluetooth management interface 1.18 initialized
May 22 18:37:30 raspberryz bluetoothd[877]: Failed to set privacy: Rejected (0x0b)

So bluetooth is up and running. If this is just one of those annoying errors that isn't really hurting anything, then it can stay on the "get around to it" list and doesn't need immediate attention. I just noticed it and didn't know why it was there and checked and there wasn't an open ticket. Just making sure it doesn't slip though the cracks.

from pi-bluetooth.

pelwell avatar pelwell commented on May 27, 2024

It's literally on my to do list, but I don't know when it might get some attention.

from pi-bluetooth.

jsl303 avatar jsl303 commented on May 27, 2024

I' having the same problem. Any fix for this?
I got this error when updating immediately after flashing 2021-05-07-raspios-buster-armhf-lite.img.

Setting up pi-bluetooth (0.1.17) ...
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
pi@raspberrypi:~ $ sudo systemctl status hciuart.service --no-pager --full
● hciuart.service - Configure Bluetooth Modems connected by UART
   Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-05-30 15:12:15 BST; 3min 7s ago
  Process: 344 ExecStart=/usr/bin/btuart (code=exited, status=0/SUCCESS)
 Main PID: 445 (hciattach)
    Tasks: 1 (limit: 2062)
   CGroup: /system.slice/hciuart.service
           └─445 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow - b8:27:eb:c3:3a:6b

May 30 15:12:08 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
May 30 15:12:15 raspberrypi btuart[344]: bcm43xx_init
May 30 15:12:15 raspberrypi btuart[344]: Flash firmware /lib/firmware/brcm/BCM4345C0.hcd
May 30 15:12:15 raspberrypi btuart[344]: Set BDADDR UART: b8:27:eb:c3:3a:6b
May 30 15:12:15 raspberrypi btuart[344]: Set Controller UART speed to 3000000 bit/s
May 30 15:12:15 raspberrypi btuart[344]: Device setup complete
May 30 15:12:15 raspberrypi systemd[1]: Started Configure Bluetooth Modems connected by UART.
pi@raspberrypi:~ $ sudo systemctl status bluetooth --no-pager --full
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-05-30 15:12:16 BST; 3min 35s ago
     Docs: man:bluetoothd(8)
 Main PID: 459 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 2062)
   CGroup: /system.slice/bluetooth.service
           └─459 /usr/lib/bluetooth/bluetoothd

May 30 15:12:15 raspberrypi systemd[1]: Starting Bluetooth service...
May 30 15:12:16 raspberrypi bluetoothd[459]: Bluetooth daemon 5.50
May 30 15:12:16 raspberrypi systemd[1]: Started Bluetooth service.
May 30 15:12:16 raspberrypi bluetoothd[459]: Starting SDP server
May 30 15:12:16 raspberrypi bluetoothd[459]: Bluetooth management interface 1.18 initialized
May 30 15:12:16 raspberrypi bluetoothd[459]: Sap driver initialization failed.
May 30 15:12:16 raspberrypi bluetoothd[459]: sap-server: Operation not permitted (1)
May 30 15:12:16 raspberrypi bluetoothd[459]: Failed to set privacy: Rejected (0x0b)

from pi-bluetooth.

drankinatty avatar drankinatty commented on May 27, 2024

Known issue, on the maintainers "to be fixed" list. Other than generating the error, there isn't a per-se failure. If you are not using sap, simply disable it to eliminate the error. See SAP error on bluetooth service status

from pi-bluetooth.

jsl303 avatar jsl303 commented on May 27, 2024

from pi-bluetooth.

AloisKlingler avatar AloisKlingler commented on May 27, 2024

same issue here. raspberry pi 4 with retropie (and bluetooth controllers), one of the latest updates made it not working any more until I start hciservice manually: sudo systemctl start hciuart

Any help or hints?

Thank you!

from pi-bluetooth.

hkayann avatar hkayann commented on May 27, 2024

The issue still persists.

from pi-bluetooth.

TomfromBerlin avatar TomfromBerlin commented on May 27, 2024

The problem still persists on Raspberry Pi OS (Debian bullseye) 64bit. The --noplugin=sap flag removed the SAP error msg, but hciuart.service still fails to start occasionally. Sometimes it works without problems, sometimes the said error occurs and bluetooth won't be available in this case.

$sudo systemctl status hciuart.service
● hciuart.service - Configure Bluetooth Modems connected by UART
     Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-02-11 12:08:05 CET; 41min ago
    Process: 422 ExecStart=/usr/bin/btuart (code=exited, status=1/FAILURE)
        CPU: 191ms

Feb 11 12:07:18 raspberrypi systemd[1]: Starting Configure Bluetooth Modems connected by UART...
Feb 11 12:08:06 raspberrypi btuart[481]: Initialization timed out.
Feb 11 12:08:06 raspberrypi btuart[481]: bcm43xx_init
Feb 11 12:08:06 raspberrypi btuart[481]: Flash firmware /lib/firmware/brcm/BCM4345C0.hcd
Feb 11 12:08:05 raspberrypi systemd[1]: hciuart.service: Control process exited, code=exited, status=1/FAILURE
Feb 11 12:08:05 raspberrypi systemd[1]: hciuart.service: Failed with result 'exit-code'.
Feb 11 12:08:05 raspberrypi systemd[1]: Failed to start Configure Bluetooth Modems connected by UART.

In addition - also hardly understandable - systemd-rfkill.service cannot be started and throws an error msg during boot process.

$sudo systemctl status systemd-rfkill.service
● systemd-rfkill.service - Load/Save RF Kill Switch Status
      Loaded: loaded (/lib/systemd/system/systemd-rfkill.service; static)
      Active: inactive (dead) since Sat 2023-02-11 12:08:05 CET; 16min ago
TriggeredBy: ● systemd-rfkill.socket
        Docs: man:systemd-rfkill.service(8)
     Process: 320 ExecStart=/lib/systemd/systemd-rfkill (code=exited, status=0/SUCCESS)
    Main PID: 320 (code=exited, status=0/SUCCESS)
         CPU: 42ms

Feb 11 12:07:17 raspberrypi systemd[1]: Starting Load/Save RF Kill Switch Status...
Feb 11 12:07:17 raspberrypi systemd[1]: Started Load/Save RF Kill Switch Status.
Feb 11 12:08:05 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.

The fact that rfkill.service does not start does not depend on whether WiFi and Bluetooth are activated or not. I've tried both options. It occurs even on a freshly installed system. Not always but often.

The entire boot process is mostly painfully slow and starting the GUI with startx can take minutes until the desktop is available. However, sometimes, although rarely, the system boots within 30 seconds.
I usually boot without a GUI since the Raspberry Pi (4) runs headless in normal operation, but every once in a while I need the VNC connection to transfer files in bidirectional.

I didn't have these problems with 'buster'. What has happened there?

from pi-bluetooth.

hkayann avatar hkayann commented on May 27, 2024

but every once in a while I need the VNC connection to transfer files in bidirectional.

You do not need VNC for this. Please have a look at SFTP. Here is a link from quick google search.

from pi-bluetooth.

TomfromBerlin avatar TomfromBerlin commented on May 27, 2024

but every once in a while I need the VNC connection to transfer files in bidirectional.

You do not need VNC for this. Please have a look at SFTP. [...]

This is completely irrelevant to the problem I'm describing. I only mentioned that in passing.

from pi-bluetooth.

TomfromBerlin avatar TomfromBerlin commented on May 27, 2024

dtparam=krnbt

That seems to work. Thank you for the suggestion.

After adding this to /boot/config.txt and rebooting I had file system errors and the system was inaccessible so I had to turn off the power. I've seen that before too. The errors occur quite randomly and it is difficult to understand what the causes are. I'm using an SSD and maybe the USB connection is causing some issues, although it shouldn't be. But that's probably a different issue, among other things (e.g. the login manager cannot be started) and it doesn't belong in this thread I think.

I then started the system and there were no errors.

from pi-bluetooth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.