Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Is there a document for setting up Bluetooth on a Raspberry Pi 3B?



Hello Michael,

On Thu, 23 May 2024 06:00:15 -0000 (UTC), mlelstv%serpens.de@localhost (Michael
van Elst) wrote:

> christopherhall.hsw%gmail.com@localhost (Christopher Hall) writes:
> 
> >I will try to build tools and a generic kernel to see if it that
> >include the bth5 code.  
> 
> Hello,
> 
> The evbarm GENERIC kernel config has the following lines:
> 
> | # Bluetooth Device Hub
> | bthub* at bcsp?
> | bthub* at btuart?
> | bthub* at bthfive?
> | bthub* at ubt?
> | 
> | include "dev/bluetooth/bluetoothdevices.config"
> 
> and the kernel includes the drivers:
> 
> | # strings /netbsd | grep -c bth5
> | 54
> 
> The evbarm GENERIC64 (== aarch64) one does not, so it lacks these
> drivers, except for:
> 
> | bthub* at ubt?
> 
> which is added in sys/dev/usb/usbdevices.config.
> 
> So the USB adapter is configured.

Some progress:

I created GENERIC64BT from GENERIC64 by adding the set of bluetooth
lines from derived GENERIC config and built a kernel. Took me a few
tries to get it to boot because I initially was copying netbsd to the
/boot/netbsd.img. After I found that file show the original netbsd.img
as a Linux file I realise my mistake. Now I can successfully boot newly
compile GENERIC64BT. (I did not change any device tree files)

At first the bt5 failed - I think the bt chip takes a few seconds after
upload to boot its firmware, so I added a "sleep 10" after the
btattach in /etc/rc.d/bluetooth also added btconfig_bth50="up" to
/etc/rc.conf and this was the result:

….
swapctl: adding /swap as swap device at priority 0
Starting virecover.
attaching Bluetooth controller to dplcom0
[  66.3242968] bthfive0 at tty major 93 minor 524288
configuring Bluetooth controllers: bthfive0[  77.6051809] bthub0 at bthfive0.
starting Bluetooth Link Key/PIN Code manager
attaching Bluetooth HSET service from "speaker"
btdevctl: service HSET not found
starting Bluetooth Service Discovery server
Starting local daemons:.
….

With the speaker in its setup mode "btconfig bthfive0 inquiry" showed it.
I was able to use "btpin -d bthfive0 -a speaker -p 0000 -P" to get a pairing
and the "/var/db/bthcid.keys" was created

It seems like there is some communication with the speaker, but it does
not completely connect. In either setup ofr normal the sdpquery just
waits until the speaker times out:

% sdpquery -a speaker -d bthfive0 search hf hset
sdpquery: sdp_service_search_attribute: Link has been severed

The sdpd is running because "sdpquery -l browse" returns data.

-- 
Best Regards.
Christopher Hall.


Home | Main Index | Thread Index | Old Index