Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bluetooth not working, PI 4 *SOLVED*
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 191
Location: Dallas, TX

PostPosted: Fri Oct 28, 2022 4:50 pm    Post subject: Bluetooth not working, PI 4 *SOLVED* Reply with quote

I've got a raspberry pi 4B successfully running Gentoo using raspberrpi-firmware, raspberrypi-image and raspberrypi-sources. Btattach threw no errors, ttyAMA0 is present, nothing jumping out at me in any logs. Bluetooth *seems* to be running but it cant find anything.

Code:

pi@gentoopi /etc/init.d $ ls -la /dev/ttyAMA0
crw--w---- 1 root tty 204, 64 Oct 28 11:27 /dev/ttyAMA0


Code:

pi@gentoopi /etc/init.d $ dmesg|grep -i bluetooth
[  945.781584] Bluetooth: Core ver 2.22
[  945.781682] NET: Registered PF_BLUETOOTH protocol family
[  945.781690] Bluetooth: HCI device and connection manager initialized
[  945.781708] Bluetooth: HCI socket layer initialized
[  945.781725] Bluetooth: L2CAP socket layer initialized
[  945.781744] Bluetooth: SCO socket layer initialized
[  974.304445] Bluetooth: HCI UART driver ver 2.3
[  974.304471] Bluetooth: HCI UART protocol H4 registered
[  974.304551] Bluetooth: HCI UART protocol Three-wire (H5) registered
[  974.304824] Bluetooth: HCI UART protocol Broadcom registered
[  974.422932] Bluetooth: hci0: BCM: chip id 107
[  974.425176] Bluetooth: hci0: BCM: features 0x2f
[  974.448330] Bluetooth: hci0: BCM4345C0
[  974.448351] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[  974.455423] Bluetooth: hci0: BCM4345C0 'brcm/BCM4345C0.hcd' Patch
[  980.860246] Bluetooth: hci0: BCM43455 37.4MHz Raspberry Pi 3+-0187
[  980.860280] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0370


Does the 4 use a different Chip? Am I missing a required firmware?

Possibly related: I segfault when I run bluetoothctl:
Code:

pi@gentoopi /etc/init.d $ sudo bluetoothctl
Waiting to connect to bluetoothd...Segmentation fault


Last edited by JumboAg on Sat Oct 29, 2022 3:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Fri Oct 28, 2022 7:01 pm    Post subject: Reply with quote

Hi
What is your
Code:

uname -r

?
_________________
:)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54370
Location: 56N 3W

PostPosted: Fri Oct 28, 2022 8:11 pm    Post subject: Reply with quote

JumboAg,

Does the wifi work?

Wifi and Bluetooth are in the same chip and share some firmware files.
They both use the same antenna, Tx and Rx too.

They do have different data interfaces. Wifi is on mmc1 and bluetooth on the serial part.
Bluetooth also requires that firmware be loaded over the serial port.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 191
Location: Dallas, TX

PostPosted: Fri Oct 28, 2022 8:49 pm    Post subject: Reply with quote

yep, the wifi is working just fine. Bluetooth just isn't finding any BT devices
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54370
Location: 56N 3W

PostPosted: Fri Oct 28, 2022 9:02 pm    Post subject: Reply with quote

JumboAg,

What firmware file do you load over the serial port and how do you load it?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 191
Location: Dallas, TX

PostPosted: Fri Oct 28, 2022 9:07 pm    Post subject: Reply with quote

This is the firmware I'm using: BCM4345C0.hcd

I'm letting the firmware itself autoload

I created a btattach script and put it in init.d and the default runlevel.

Code:

pi@gentoopi /etc/init.d $ cat btattach
#!/sbin/openrc-run

command="/usr/bin/btattach"
command_args="-B /dev/ttyAMA0 -P bcm -S 3000000"
command_background=true
pidfile="/run/btattach.pid"

depend() {
        after coldplug hotplug modules
        need localmount
}
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54370
Location: 56N 3W

PostPosted: Sat Oct 29, 2022 2:07 pm    Post subject: Reply with quote

JumboAg,

This is going back a bit. Its probably Pi3 but the method my be useful.
It might not too, things keep changing.

My
Code:
/mnt/cdrom/etc/local.d/bluetooth.start
contains
Code:
 #!/bin/bash

# Having openrc start the bluetooth service is required
# but not sufficient to have Raspberry Pi bluetooth working
# bluez needs some patches they are in /etc/portage/patches
# so if you want to rebuild bluez, you can :)

# Bluetooth is attached to /dev/ttyAMA0 so attach it and
# load the firmware
/usr/bin/hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -

# thats enough to have it work for some things.

# for sound we need bluealsa or pulseaudio
# pulseaudio reminds me of systemd - its not tested.
bluealsa &

That /usr/bin/hciattach looks very Pi3. The bcm43xx firmware and the 921600 baud rate, in particular.

My Pi4s are all in metal (Faraday cage) enclosures, for passive cooling, so I can't use WiFi or Bluetooth.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 191
Location: Dallas, TX

PostPosted: Sat Oct 29, 2022 3:51 pm    Post subject: Reply with quote

#@%@#% #$@#%@%#@$ % #!@$%%#$@% !!!

Sigh... found it. Typo in my config.txt file. Didnt throw any errors but wouldnt start BT correctly until I fixed.


Wrong line: dtparm=krnbt=on
right line: dtparam=krnbt=on


The hciattach/btattach is not required with the 4b. Just starting the bluetooth service is sufficient.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum