WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bluetooth not initializing  (Read 2438 times)

Offline xenodius

  • Newbie
  • *
  • Posts: 43
Bluetooth not initializing
« on: February 05, 2021, 08:29:03 PM »
I hesitate to ask more questions but I'm hard stuck and have run out of old threads to inform any troubleshooting. I'm trying to setup a serial bluetooth connection to communicate with a BLE battery management system on a pi4, with piCore 12 armv7l. However I haven't been able to enable bluetooth-- hciattach results in 'initialization timed out' every time.

I first followed Juanito's and then Paul_123's steps for enabling bluetooth, but hciattach always results in 'Initialization timed out', tried 921600/3000000 and flow/noflow manually in addition to the script. All packages downloaded via tce-load-- to be certain, I deleted all dbus/bluetooth extensions and re-downloaded. Nothing bluetooth-related in config.txt... just display, SPI, i2c stuff, I'm not using /dev/ttyAMA0. Any advice is greatly appreciated.

Code: [Select]
tc@box:~$ ./bt_start
no /usr/local/bin/dbus-daemon found; none killed
rm: cannot remove '/var/run/dbus/pid': No such file or directory
bcm43xx_init
Initialization timed out.

Previously suggested checks yielded no clues;
Code: [Select]
tc@box:~$ dmesg
...
[11133.331791] Bluetooth: Core ver 2.22
[11133.331844] NET: Registered protocol family 31
[11133.331852] Bluetooth: HCI device and connection manager initialized
[11133.331869] Bluetooth: HCI socket layer initialized
[11133.331882] Bluetooth: L2CAP socket layer initialized
[11133.331902] Bluetooth: SCO socket layer initialized
[11667.200328] Bluetooth: HCI UART driver ver 2.3
[11667.200346] Bluetooth: HCI UART protocol H4 registered
[11667.200446] Bluetooth: HCI UART protocol Three-wire (H5) registered
[11667.201361] Bluetooth: HCI UART protocol Broadcom registered

lsmod:

tc@box:~$ tce-status -i | grep dbus & tce-status -i | grep blue & tce-status -i | grep bt
dbus
dbus-dev
dbus-glib
dbus-glib-dev
bluetooth-5.4.51-piCore-v7l+
bluez
libbluetooth
libbluetooth-dev
firmware-rpi-bt

tc@box:~$ ps aux | grep dbus
 4101 tc       /usr/local/bin/dbus-daemon --system
 4256 tc       grep dbus

tc@box:~$ lsmod
Module                  Size  Used by    Tainted: G
bnep                   20480  2
hci_uart               40960  0
btbcm                  16384  1 hci_uart
bluetooth             393216  9 bnep,hci_uart,btbcm
ecdh_generic           16384  1 bluetooth
ecc                    36864  1 ecdh_generic
evdev                  24576  0
i2c_dev                20480  0
brcmfmac              323584  0
brcmutil               24576  1 brcmfmac
cfg80211              688128  1 brcmfmac
rfkill                 28672  4 bluetooth,cfg80211
squashfs               40960 332
spidev                 20480  0
raspberrypi_hwmon      16384  0
zram                   28672  1
i2c_bcm2835            16384  0
zsmalloc               28672  1 zram
spi_bcm2835            20480  0
rpivid_mem             16384  0
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11588
Re: Bluetooth not initializing
« Reply #1 on: February 05, 2021, 10:40:56 PM »
Hi xenodius
...
Code: [Select]
tc@box:~$ tce-status -i | grep dbus & tce-status -i | grep blue & tce-status -i | grep bt

For what it's worth, you can also do that like this:
Code: [Select]
tce-status -i | grep -E "dbus|blue|bt"

Offline xenodius

  • Newbie
  • *
  • Posts: 43
Re: Bluetooth not initializing
« Reply #2 on: February 05, 2021, 11:26:51 PM »
Thanks, I appreciate all the little tips.

Will try this again on a fresh OS over the weekend. If it works maybe I can find the problem by comparison.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1243
Re: Bluetooth not initializing
« Reply #3 on: February 06, 2021, 10:16:08 AM »
Need to be careful you don’t have cut and paste errors in the scripts.


Offline xenodius

  • Newbie
  • *
  • Posts: 43
Re: Bluetooth not initializing
« Reply #4 on: February 14, 2021, 12:11:10 PM »
Late followup as I didn't find a solution-- but I determined it's not my Pi hardware since I was able to setup bluetooth on another piCore 12.x 32bit installation no problem. But it still doesn't work on this image-- it's definitely not 1. the script, 2. config.txt or 3. extension related. I'm not sure what possible causes that leaves, but I can only conclude it's something else I've done on this image; in the end I just decided to use a physical serial connection for this device instead.