WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 12 & Bluetooth on RPi0 W  (Read 6384 times)

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
piCore 12 & Bluetooth on RPi0 W
« on: November 01, 2020, 06:12:43 PM »
Hi Folks,

I'm back with an oldie but a goodie, enabling Bluetooth on an RPi Zero W (but on piCore 12).  I swore to myself I'd do it on my own (epic fail).  But, alas... I've learned some things along the way and that makes me happy.

I found a couple of posts regarding this topic and some RPi Org stuff.  Hours later, I acquiesced.  You'll let me know how badly I botched this? Please.

The end of my config.txt file looks like this, which I think is correct... maybe I should be safe and place it under ALL and not be specific:
Code: [Select]
[PI0]
dtoverlay=miniuart-bt
enable_uart=1
core_freq=250

When I try modprobe gives me this (seems worrisome, no idea how to resolve):
Code: [Select]
tc@box:~$ sudo modprobe hci_uart
modprobe: can't load module ecc (kernel.tclocal/crypto/ecc.ko): invalid module format

We stay calm and carry on, starting dbus & bluetooth daemons (dbus runs, I think if I leave out the bluetooth options, that runs and hangs?):
Code: [Select]
tc@box:~$ sudo /usr/local/etc/init.d/dbus start
tc@box:~$ sudo /usr/local/lib/bluetooth/bluetoothd -nd
bluetoothd[2380]: Bluetooth daemon 5.54
bluetoothd[2380]: src/main.c:parse_config() parsing /usr/local/etc/bluetooth/main.conf
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “AlwaysPairable” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “JustWorksRepairing” in group “General”
bluetoothd[2380]: src/main.c:parse_config() name=piCore
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “Class” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “Cache” in group “GATT”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “KeySize” in group “GATT”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “ExchangeMTU” in group “GATT”
bluetoothd[2380]: src/main.c:parse_config() Key file does not have key “Channels” in group “GATT”
bluetoothd[2380]: Failed to access management interface
bluetoothd[2380]: Adapter handling initialization failed

Then, I fiddle with firmware - and, yes that is the correct location on my setup (the post had something else):
Code: [Select]
tc@box:~$ hciattach /dev/ttyAMA0 bcm43xx 921600 noflow
bcm43xx_init
Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
Initialization timed out.
tc@box:~$ Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
sh: Flash: not found

I'm hoping (I know we shouldn't) that it's a simple mistake on my part and that once resolved there will be a success domino effect! Yes, folks! The glass is in fact... half full! It's actually all full... the second half with air!

If this is gibberish and makes no sense let me know how to better report the issue and I'm happy to do so.

Peace!
« Last Edit: November 01, 2020, 06:14:54 PM by EversteelE »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #1 on: November 01, 2020, 08:25:57 PM »
How did you download the files?  Is your zero connected to the network?

Do you have the rpi firmware?   You should get everything you need by running

tce-load -wi blues.tcz

« Last Edit: November 01, 2020, 08:39:53 PM by Paul_123 »

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #2 on: November 01, 2020, 09:58:07 PM »
Hi Paul,

Yes, the RPi0 W has network (yay).
Yes, I have firmware rpi bt.
Yes, bluez with a "z" (confirming). Usually, tce-load. Sometimes Apps.

Did any of those warnings or errors point us here or there?

Maybe I did something out of sequence.

Thanks!

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #3 on: November 01, 2020, 11:25:03 PM »
Yes was typing from my ipad...  bluez.tcz, but since you can use other bluetooth radios, the rpi firmware is not a hard dependancy.  I just went through and set this up.  I am not getting any module load errors like you did, so the module packs are good.  Everything working as expected.

Forget the miniuart right now, I've never used it..  Start with the stock config.txt that came with picore12.

Code: [Select]
tce-load -wi firmware-rpi-bt
tce-load -wi bluez

Create a file called 99-com.rules in your home directory.....the contents
Code: [Select]
SUBSYSTEM=="input", GROUP="staff", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="staff", MODE="0660"
SUBSYSTEM=="spidev", GROUP="staff", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="staff", MODE="0660"

SUBSYSTEM=="gpio", GROUP="staff", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
        chown -R root:staff /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
        chown -R root:staff /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
        chown -R root:staff /sys$devpath && chmod -R 770 /sys$devpath\
'"

KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
        ALIASES=/proc/device-tree/aliases; \
        if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
                echo 0;\
        elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
                echo 1; \
        else \
                exit 1; \
        fi\
'", SYMLINK+="serial%c"

KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
        ALIASES=/proc/device-tree/aliases; \
        if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
                echo 0; \
        elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
                echo 1; \
        else \
                exit 1; \
        fi \
'", SYMLINK+="serial%c"

Create a file called bt_start in your home directory.
Code: [Select]
#!/bin/sh

sudo cp /home/tc/99-com.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

sudo /usr/local/etc/init.d/bluez start

sudo modprobe hci_uart

while [ ! -r /dev/serial1 ]; do
        sleep 0.5
done

HCIATTACH=/usr/local/bin/hciattach
if grep -q "Pi 4" /proc/device-tree/model; then
        BDADDR=
else
        SERIAL=`cat /proc/device-tree/serial-number | cut -c9-`
        B1=`echo $SERIAL | cut -c3-4`
        B2=`echo $SERIAL | cut -c5-6`
        B3=`echo $SERIAL | cut -c7-8`
        BDADDR=`printf b8:27:eb:%02x:%02x:%02x $((0x$B1 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B3 ^ 0xaa))`
fi
uart0="`cat /proc/device-tree/aliases/uart0`"
serial1="`cat /proc/device-tree/aliases/serial1`"
if [ "$uart0" = "$serial1" ] ; then
        uart0_pins="`wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' '`"
        if [ "$uart0_pins" = "16" ] ; then
                sudo $HCIATTACH /dev/serial1 bcm43xx 3000000 flow - $BDADDR
        else
                sudo $HCIATTACH /dev/serial1 bcm43xx 921600 noflow - $BDADDR
        fi
else
        sudo $HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR
fi

After saving the file
chmod 755 bt_start
filetool.sh -b

Make sure the backup runs, then reboot just to be safe.

After rebooting just run.

Code: [Select]
tc@box:~$ ./bt_start
no /usr/local/bin/dbus-daemon found; none killed
rm: can't remove '/var/run/dbus/pid': No such file or directory
bcm43xx_init
Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
Set BDADDR UART: b8:27:eb:76:73:9f
Set Controller UART speed to 3000000 bit/s
Device setup complete

Ignore the first two errors, it's just a noisy init.d script starting dbus.  But the rest should look right, and show that the Bluetooth is all setup and good,
Code: [Select]

tc@box:~$ bluetoothctl show
Controller B8:27:EB:76:73:9F (public)
        Name: piCore
        Alias: piCore
        Class: 0x00000000
        Powered: no
        Discoverable: no
        DiscoverableTimeout: 0x000000b4
        Pairable: no
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0536
        Discovering: no
Advertising Features:
        ActiveInstances: 0x00
        SupportedInstances: 0x05
        SupportedIncludes: tx-power
        SupportedIncludes: appearance
        SupportedIncludes: local-name

Couple of other notes, that startup script should work on all RPI devices.   Also that assumes that firmware-rpi-bt.tcz and bluez.tcz are loaded at boot.  If you want to play with the mini uart, it should work.   99-com.rules should properly identify the serial ports for the startup script.

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #4 on: November 02, 2020, 02:04:34 PM »
Paul,

Thank you for taking the time to reply so thoroughly!  That is a lot of good info... I will try it, but it will be a challenge (which I'm up to).

It may take me a couple of days to get back to you with the work week in full swing.


Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #5 on: November 02, 2020, 02:45:36 PM »
Hi Paul,

This is still happening:
Code: [Select]
modprobe: can't load module ecc (kernel.tclocal/crypto/ecc.ko): invalid module format
I created the two files, backed up, rebooted and ran bt_start.

Hope this helps?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #6 on: November 02, 2020, 03:24:40 PM »
You have 1 of 3 problems

1) You downloaded modules for a different architecture.   Check your onboot.lst, there should not be a specific kernel reference in there.  i.e. you should only load modules by using the "KERNEL" reference in the extension name.
2) You somehow corrupted your files.  In that case Remove bluetooth-5.4.51-piCore.tcz and then download it again.
3) You have run out of disk space and that is corrupting downloads.

I setup a pi0w from scratch when I wrote those documents yesterday, so I know the files on the server are good.

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #7 on: November 02, 2020, 07:29:56 PM »
Paul,

When you're right you're right... I may have crossed repo's.  Lesson learned.  Actually, a lot of lesson's learned.

So, I stripped down my onboot.lst to wifi, bluetooth and TC only.  I hacked away at all the files I could remember manually loading or were suspect in any way.  And, re-loaded them.

With your two files in place, it works fine and I was able to pair a mouse. Woohoo!  Getting it to stick is another matter, will do more research and tinkering.

New I will try without your two files, to see if a vanilla install would do it.  Well, almost vanilla.. since there is only wifi for networking on an RPi0 W, wifi extensions had to be added (and are not native to the iso).

With wifi and bluetooth capabilities established, I'm satisfied and will move on to a little Python programming to run on the RPi0 W bugger!

Much thanks for your assistance and patience. And, apologies for the trouble.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #8 on: November 02, 2020, 08:50:01 PM »
Need to backup the pairing files. To get things to stick. But you still may need to force a connection on reboot.

Add To /opt/.filetool.lst

var/lib/bluetooth

    [EDIT]: Fixed  .filetool.lst  spelling.  Rich
« Last Edit: December 27, 2020, 07:29:37 PM by Rich »

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #9 on: November 02, 2020, 09:01:56 PM »
Thanks, again Paul.

Will try those.

Offline creitzel

  • Newbie
  • *
  • Posts: 41
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #10 on: October 01, 2022, 06:39:36 PM »
So I attempted to follow Paul's steps to get bluetooth working on my Pi Zero W, running piCore 13.1.

Everything appears to be going well, until the step where you issue the command.

Code: [Select]
bluetoothctl show 
When I attempt that command, it appears to just hang up in an infinite loop or something, as the command prompt never returns, and it never displays the output that Paul's does.  I can break out of it using ctrl-c, but that just returns me to the command prompt.   

So, am I doing something wrong?  I'm brand new to working with bluetooth on any linux distro, so is there some kind of debug tool I could use to see what bluetoothctl is actually doing?

Any help you guys could give me would be greatly appreciated.

Thanks in advance,

Chris

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #11 on: October 02, 2022, 07:59:00 AM »
Errors should be posted in dmesg.

Offline creitzel

  • Newbie
  • *
  • Posts: 41
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #12 on: October 02, 2022, 03:55:54 PM »
Good to know Paul, unfortunately, I'm not getting any errors in dmesg when it is hanging up.

Here's the steps I've followed:

First, I've made sure to include firmware-rpi-bt.tcz and bluez.tcz in my onboot.lst file

Code: [Select]
tc@box:cat /mnt/mmcblk0p2/tce/onboot.lst
openssh.tcz
libnl.tcz
wpa_supplicant.tcz
firmware-rpi-wifi.tcz
firmware-rpi-bt.tcz
wireless-5.10.77-piCore.tcz
wifi.tcz
wireless_tools.tcz
bluez.tcz

Next, I execute your bt_start script:

Code: [Select]
tc@box:~$ ./bt_start
no /usr/local/bin/dbus-daemon found; none killed
rm: can't remove '/var/run/dbus/pid': No such file or directory
/usr/local/lib/bluetooth/bluetoothd: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
bcm43xx_init
Flash firmware /lib/firmware/brcm/BCM43430A1.hcd
Set BDADDR UART: b8:27:eb:f7:a7:7c
Set Controller UART speed to 3000000 bit/s
Device setup complete

Here's a dump of dmesg after that:

Code: [Select]
tc@box:~$ sudo dmesg -c
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.77-piCore (root@box) (gcc (piCore) 10.2.0, GNU ld (GNU Binutils) 2.34) #1 Sun Nov 7 08:58:38 UTC 2021
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Zero W Rev 1.1
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Reserved memory: created CMA memory pool at 0x17800000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000] On node 0 totalpages: 114688
[    0.000000]   Normal zone: 1008 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 114688 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 113680
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:5D:0D:D6 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  zswap.compressor=lz4 zswap.zpool=z3fold console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
[    0.000000] Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 368992K/458752K available (8867K kernel code, 1324K rwdata, 2824K rodata, 420K init, 837K bss, 24224K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 29890 entries in 88 pages
[    0.000000] ftrace: allocated 88 pages with 3 groups
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x574 with crng_init=0
[    0.000028] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[    0.000088] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[    0.000181] bcm2835: system timer (irq = 27)
[    0.000865] Console: colour dummy device 80x30
[    0.000956] printk: console [tty1] enabled
[    0.001037] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.060338] pid_max: default: 32768 minimum: 301
[    0.060688] LSM: Security Framework initializing
[    0.061023] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.061061] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.063355] cgroup: Disabling memory control group subsystem
[    0.063781] CPU: Testing write buffer coherency: ok
[    0.065896] Setting up static identity map for 0x8200 - 0x8238
[    0.067314] devtmpfs: initialized
[    0.079937] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    0.080313] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.080438] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.089566] pinctrl core: initialized pinctrl subsystem
[    0.091778] NET: Registered protocol family 16
[    0.096173] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.102935] audit: initializing netlink subsys (disabled)
[    0.104561] thermal_sys: Registered thermal governor 'step_wise'
[    0.105177] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.105202] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.105494] Serial: AMBA PL011 UART driver
[    0.110731] audit: type=2000 audit(0.100:1): state=initialized audit_enabled=0 res=1
[    0.129576] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[    0.140847] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-11-05T18:16:55, variant start
[    0.150864] raspberrypi-firmware soc:firmware: Firmware hash is b99321a10f46c9bd662fc87998419c5d6974927a
[    0.204461] Kprobes globally optimized
[    0.214846] bcm2835-dma 20007000.dma: DMA legacy API manager, dmachans=0x1
[    0.218209] SCSI subsystem initialized
[    0.218684] usbcore: registered new interface driver usbfs
[    0.218834] usbcore: registered new interface driver hub
[    0.218959] usbcore: registered new device driver usb
[    0.221515] clocksource: Switched to clocksource timer
[    2.024903] VFS: Disk quotas dquot_6.6.0
[    2.025045] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    2.025340] FS-Cache: Loaded
[    2.025751] CacheFiles: Loaded
[    2.047433] NET: Registered protocol family 2
[    2.047773] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    2.049307] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    2.049415] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    2.049501] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    2.049606] TCP: Hash tables configured (established 4096 bind 4096)
[    2.049830] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    2.049884] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    2.050367] NET: Registered protocol family 1
[    2.051875] RPC: Registered named UNIX socket transport module.
[    2.051901] RPC: Registered udp transport module.
[    2.051916] RPC: Registered tcp transport module.
[    2.051929] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.052432] Trying to unpack rootfs image as initramfs...
[    2.511586] random: fast init done
[    2.727704] Freeing initrd memory: 5224K
[    2.728614] hw perfevents: no irqs for PMU, sampling events not supported
[    2.728700] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[    2.734034] Initialise system trusted keyrings
[    2.734611] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    2.747409] zbud: loaded
[    2.750656] FS-Cache: Netfs 'nfs' registered for caching
[    2.752315] NFS: Registering the id_resolver key type
[    2.752390] Key type id_resolver registered
[    2.752409] Key type id_legacy registered
[    2.752671] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.752696] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    2.754726] Key type asymmetric registered
[    2.754757] Asymmetric key parser 'x509' registered
[    2.754865] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    2.754889] io scheduler mq-deadline registered
[    2.754906] io scheduler kyber registered
[    2.758601] bcm2708_fb soc:fb: FB found 1 display(s)
[    2.790014] Console: switching to colour frame buffer device 240x67
[    2.832433] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 1920x1080
[    2.843387] bcm2835-rng 20104000.rng: hwrng registered
[    2.844085] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    2.846603] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    2.874338] brd: module loaded
[    2.893794] loop: module loaded
[    2.896913] Loading iSCSI transport class v2.0-870.
[    2.899876] libphy: Fixed MDIO Bus: probed
[    2.900460] usbcore: registered new interface driver smsc95xx
[    2.900512] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.900845] dwc_otg: FIQ enabled
[    2.900869] dwc_otg: NAK holdoff enabled
[    2.900887] dwc_otg: FIQ split-transaction FSM enabled
[    2.900920] Module dwc_common_port init
[    2.901700] usbcore: registered new interface driver usb-storage
[    2.902357] mousedev: PS/2 mouse device common for all mice
[    2.904482] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    2.910081] sdhci: Secure Digital Host Controller Interface driver
[    2.910104] sdhci: Copyright(c) Pierre Ossman
[    2.910875] mmc-bcm2835 20300000.mmcnr: could not get clk, deferring probe
[    2.911888] sdhost-bcm2835 20202000.mmc: could not get clk, deferring probe
[    2.912197] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.912899] ledtrig-cpu: registered to indicate activity on CPUs
[    2.913391] hid: raw HID events driver (C) Jiri Kosina
[    2.913636] usbcore: registered new interface driver usbhid
[    2.913653] usbhid: USB HID core driver
[    2.920176] Initializing XFRM netlink socket
[    2.920269] NET: Registered protocol family 17
[    2.920525] Key type dns_resolver registered
[    2.921025] registered taskstats version 1
[    2.921075] Loading compiled-in X.509 certificates
[    2.936127] uart-pl011 20201000.serial: cts_event_workaround enabled
[    2.936282] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    2.939359] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    2.941625] mmc-bcm2835 20300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    2.941653] mmc-bcm2835 20300000.mmcnr: DMA channel allocated
[    2.970381] sdhost: log_buf @ (ptrval) (97910000)
[    3.006267] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    3.008033] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.009780] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.012884] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    3.019727] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.023106] of_cfs_init
[    3.023346] of_cfs_init: OK
[    3.051985] Freeing unused kernel memory: 420K
[    3.052009] Kernel memory protection not selected by kernel config.
[    3.052329] Run /init as init process
[    3.052344]   with arguments:
[    3.052356]     /init
[    3.052410]     nortc
[    3.052423]     noembed
[    3.052432]   with environment:
[    3.052443]     HOME=/
[    3.052453]     TERM=linux
[    3.120129] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.124210] mmc0: new high speed SDHC card at address e624
[    3.127839] mmcblk0: mmc0:e624 SU32G 29.7 GiB
[    3.134581]  mmcblk0: p1 p2
[    3.177849] mmc1: new high speed SDIO card at address 0001
[    4.954983] zram: Added device: zram0
[    6.134738] zram0: detected capacity change from 0 to 104288256
[    6.147116] random: mkswap: uninitialized urandom read (16 bytes read)
[    6.163060] Adding 101840k swap on /dev/zram0.  Priority:-2 extents:1 across:101840k SSFS
[    6.477621] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    7.832350] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    7.958159] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   17.448174] random: dbus-uuidgen: uninitialized urandom read (12 bytes read)
[   17.448362] random: dbus-uuidgen: uninitialized urandom read (8 bytes read)
[   19.872041] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   20.274262] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   20.274569] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   20.274593] cfg80211: failed to load regulatory.db
[   20.539921] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   20.601952] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   20.607691] usbcore: registered new interface driver brcmfmac
[   20.986311] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   20.986528] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   20.986661] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   20.987925] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[  115.111666] random: crng init done
[  116.578637] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[  323.786141] Bluetooth: Core ver 2.22
[  323.786324] NET: Registered protocol family 31
[  323.786342] Bluetooth: HCI device and connection manager initialized
[  323.786379] Bluetooth: HCI socket layer initialized
[  323.786401] Bluetooth: L2CAP socket layer initialized
[  323.786450] Bluetooth: SCO socket layer initialized
[  323.813329] Bluetooth: HCI UART driver ver 2.3
[  323.813358] Bluetooth: HCI UART protocol H4 registered
[  323.813502] Bluetooth: HCI UART protocol Three-wire (H5) registered
[  323.813785] Bluetooth: HCI UART protocol Broadcom registered
[  324.683833] uart-pl011 20201000.serial: no DMA platform data

Then I try to do the bluetoothctl show command:

Code: [Select]
tc@box:~$ bluetoothctl show
^Ctc@box:~$ dmesg
tc@box:~$

Note the ctrl-c there before the last call to dmesg, as I have to break out of the process to get back to the command prompt.  the subsequent dmesg call produces nothing though.

Is it maybe related to the error that I get when running your bt_start script?  I saw that, but ignored it because I'm not interested in bluetooth for audio, rather I just want to be able to connect to the pi via bluetooth and get an ssh terminal.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1246
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #13 on: October 02, 2022, 04:37:11 PM »
Quote
/usr/local/lib/bluetooth/bluetoothd: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

You are missing libasound, you need to install alsa.

Offline creitzel

  • Newbie
  • *
  • Posts: 41
Re: piCore 12 & Bluetooth on RPi0 W
« Reply #14 on: October 02, 2022, 07:49:16 PM »
Thanks Paul, installing alsa fixed it, and I now get similar output as you do for "bluetoothctl show". 

Like I said before, I saw that error and ignored it, because I wasn't planning on doing anything with sound, and your script output seemed like everything was still ok.  So it appeared like it was just an optional thing or something.

Now I've got to familiarize myself with bluetoothctl and figure out how to get my laptop paired to the pi, and get a console up.  :-)

Thanks again for the help.