Ubuntu Server Image, No Bluetooth

No bluetooth adapter found

rock@RockPi(~):ls /lib/modules/4.4.154-59-rockchip-g5e70f14/kernel/drivers

bcma block gpu i2c md media misc mtd net pps scsi ssb switch usb w1

rock@RockPi(~):hcitool dev

Devices:

rock@RockPi(~):hcitool scan

Device is not available: No such device

lsmod and dmesg both produce no bluetooth output

Any suggestions?

Here the same. Bluetooth isn`t working under Armbian and Debian. Any solution?

Hi

for Armbian,you can run start_bt.sh

root@rockpi4b:/usr/local/bin# ./start_bt.sh

and you will see that

We must stop getty now, You must physically disconnect your USB-UART-Adapter!
Using /dev/ttyS0 for Bluetooth
Power cycle rockpi BT-section
Start uploader
root@rockpi4b:/usr/local/bin# Done setting line discpline

root@rockpi4b:/usr/local/bin# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 43:45:C5:00:1F:AC ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:876 acl:0 sco:0 events:62 errors:0
TX bytes:4755 acl:0 sco:0 commands:62 errors:0

1 Like

Thank you very much, that helps instantly after a manuell search for adapter on the GUI.
But how can I integrate this in the start prozess? Sorry for that (maybe) stupid question, but I´m a Linux Dummie.:roll_eyes:

You can edit /etc/rc.local file

Add line

/usr/local/bin/start_bt.sh &

Before the exit 0 line.

It will run every time booting.

1 Like

That script does not exits on my system:

Blockquoteroot@rockpi:~# uname -a
BlockquoteLinux rockpi 4.4.154-59-rockchip-g5e70f14 #4 SMP Fri Dec 14 20:55:41 CST 2018 aarch64 aarch64 aarch64 GNU/Linux

Running script /usr/local/bin/test_bt.sh
outputs:

Blockquote root@rockpi:~# /usr/local/bin/test_bt.sh
root@rockpi:~# Rockchip Linux WifiBt init
BT TTY: /dev/ttyS0
Wifi driver is ready for now…
wifibt_load_driver
uevent path:/sys/bus/sdio/devices/./uevent
uevent path:/sys/bus/sdio/devices/…/uevent
uevent path:/sys/bus/sdio/devices/mmc2:0001:1/uevent
line: DRIVER=bcmsdh_sdmmc
, prefix: SDIO_ID=.
line: SDIO_CLASS=00
, prefix: SDIO_ID=.
line: SDIO_ID=02D0:A9BF
, prefix: SDIO_ID=.
pid:vid : 02d0:a9bf
found device pid:vid : 02d0:a9bf
wifi detectd return ret:0
SDIO WIFI identify sucess
check_wifi_chip_type_string: AP6255
Cannot create “/data/wifi_chip”: No such file or directorywifibt_load_driver matched ko file path /system/lib/modules/bcmdhd.ko
wifibt_load_driver insmod /system/lib/modules/bcmdhd.ko
insmod: ERROR: could not load module /system/lib/modules/bcmdhd.ko: No such file or directory
wifibt_load_driver insmod /system/lib/modules/bcmdhd.ko failed

And naturally BT is not working. Image written to emmc is rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt. How to proceed to get this working?

Really? Ofc it doesn’t exist on your system, because your system is not Armbian, so try it with armbian first

Oooops :smiley: I’ll try with correct image

1 Like

Yes…BT works with Armbian and board is able to see my RuuviTag’s :slight_smile:

Added to root’s cron entry: @reboot /usr/local/bin/start_bt.sh >/dev/null 2>&1

Now BT is available after reboot w/o manually activating it.

And naturally BT is not working. Image written to emmc is rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt. How to proceed to get this working? no armlbian.

Faced the same issue. Switched from Armbian to Ubuntu since I did not get iptables there.

But with this ubuntu, no bluetooth:
root@linux:~# rfkill list all
0: bt_default: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
root@linux:~#

root@linux:~# sudo hcitool dev
Devices:
root@linux:~#

Running /usr/local/bin/test_bt.sh gives errors:
root@linux:~# sudo /usr/local/bin/test_bt.sh
Rockchip Linux WifiBt init
BT TTY: /dev/ttyS0
Wifi driver is ready for now…
wifibt_load_driver
uevent path:/sys/bus/sdio/devices/./uevent
uevent path:/sys/bus/sdio/devices/…/event
uevent path:/sys/bus/sdio/devices/mmc2:0001:1/event
line: DRIVER=bcmsdh_sdmmc
, prefix: SDIO_ID=,
line: SDIO_CLASS=00
, prefix: SDIO_ID=.
line: SDIO_ID=02D0:A9BF
, prefix: SDIO_ID=.
pid:vid : 02d0:a9bf
found device pid:vid : 02d0:a9bf
wifi detectd return ret:0
SDIO WIFI identify sucess
check_wifi_chip_type_string: AP6255
Cannot create “/data/wifi_chip”: No such file or directorywifibt_load_driver matched ko file path /system/lib/modules/bcmdhd.ko
wifibt_load_driver insmod /system/lib/modules/bcmdhd.ko
root@linux:~# insmod: ERROR: could not load module /system/lib/modules/bcmdhd.ko: No such file or directory
wifibt_load_driver insmod /system/lib/modules/bcmdhd.ko failed
root@linux:~#

Installed bluetooth and it’s running:
root@linux:~# systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-03-16 11:29:48 EET; 42s ago
Docs: man:bluetoothd(8)
Main PID: 533 (bluetoothd)
Status: “Running”
Tasks: 1 (limit: 4572)
CGroup: /system.slice/bluetooth.service
└─533 /usr/lib/bluetooth/bluetoothd

Mar 16 11:29:48 linux systemd[1]: Starting Bluetooth service…
Mar 16 11:29:48 linux bluetoothd[533]: Bluetooth daemon 5.48
Mar 16 11:29:48 linux systemd[1]: Started Bluetooth service.
Mar 16 11:29:48 linux bluetoothd[533]: Starting SDP server
Mar 16 11:29:48 linux bluetoothd[533]: kernel lacks bnep-protocol support
Mar 16 11:29:48 linux bluetoothd[533]: System does not support network plugin
Mar 16 11:29:48 linux bluetoothd[533]: Bluetooth management interface 1.10 initialized
root@linux:~#

I have troubleshooted and tested with different images and after i finally got iptables working I’d like to stick with ubuntu. But if BT does not start to work I need to continue finding working image with iptables and bt…

Hi, Miha

To enable BT on Ubuntu Server, you should install the following package:

apt-get install bluez ap6256-firmware 

First stop the rfkill

echo 1 > /sys/class/rfkill/rfkill0/state

Download the BT firmware with brcm_patchram_plus1 tool

brcm_patchram_plus1 -d --enable_hci --no2bytes\
--use_baudrate_for_downloade --tosleep  200000 \
--baudrate 1500000 --patchram \
/system/etc/firmware/BCM4345C5.hcd /dev/ttyS0 \
> /dev/null 2>&1  &

It will run on the background.

Now check the hci device

hciconfig
hci0:	Type: Primary  Bus: UART
	BD Address: 43:45:C5:00:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
	UP RUNNING
	RX bytes:785 acl:0 sco:0 events:49 errors:0
	TX bytes:2284 acl:0 sco:0 commands:49 errors:0

Scan other BT devices

hcitool scan

You can add the first two lines on /etc/rc.local to download BT firmware every time.

1 Like

Did following:
root@rockpi:~# apt-get install bluez ap6256-firmware
Reading package lists… Done
Building dependency tree
Reading state information… Done
bluez is already the newest version (5.48-0ubuntu3.1).
ap6256-firmware is already the newest version (0.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@rockpi:~#
root@rockpi:~# echo 1 > /sys/class/rfkill/rfkill0/state
root@rockpi:~# hciconfig
root@rockpi:~#

Decided to reboot because output of the command hciconfig was empty. After reboot:

root@rockpi:~# systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)
root@rockpi:~# brcm_patchram_plus1 -d --enable_hci --no2bytes --use_baudrate_for_downloade --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmware/BCM4345C5.hcd /dev/ttyS0 > /dev/null 2>&1 &
[1] 495
root@rockpi:~# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 43:45:C5:00:1F:1C ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:806 acl:0 sco:0 events:52 errors:0
TX bytes:2817 acl:0 sco:0 commands:52 errors:0
root@rockpi:~# hcitool lescan
LE Scan …
71:72:BA:D5:5A:FB (unknown)
59:66:39:8E:52:50 (unknown)
61:95:49:5E:75:FD (unknown)
EC:D6:63:18:F1:82 (unknown)
48:DC:46:99:D9:4B (unknown)
61:95:49:5E:72:FD [LG] webOS TV SJ850V
48:DC:46:99:D2:4B (unknown)
C8:60:16:8C:BA:4F (unknown)
A0:9E:1A:3E:E2:86 (unknown)
59:66:39:8E:52:50 (unknown)
A0:9E:1A:3E:E3:86 Polar A370 3EE4362B
E7:D0:4C:63:57:C4 (unknown)

^Croot@rockpi:~#

Added to cron and tested how BT survives on reboot:

rock@rockpi’s password:
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.4.154-59-rockchip-g5e70f14 aarch64)
—clip–clip–
rock@rockpi:~$ uptime;hciconfig
14:26:30 up 0 min, 2 users, load average: 0.23, 0.06, 0.02
hci0: Type: Primary Bus: UART
BD Address: 43:45:C5:00:1F:AC ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:806 acl:0 sco:0 events:52 errors:0
TX bytes:2817 acl:0 sco:0 commands:52 errors:0
rock@rockpi:~$ sudo crontab -l
[sudo] password for rock:
—clip—clip–
@reboot brcm_patchram_plus1 -d --enable_hci --no2bytes --use_baudrate_for_downloade --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmware/BCM4345C5.hcd /dev/ttyS0 > /dev/null 2>&1 &

rock@rockpi:~$

Works! Thank you Jack :slight_smile:

2 Likes

Hi guys,
I am a newbie in Linux.
I managed to get Bluetooth connection for my Bluetooth 3.0 keyboard with built in keypad when disable the wifi connection.
Can’t make both BT and WIFI working together…
Any advice?
Don

Hi guys,
Good news.
Try the following link, it works for me.

3 Likes

Nice! Thanks for sharing this.

Back with this crappy bt…

OS and version:
root@rockip4b:~# cat /etc/ele
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION=“Ubuntu 18.04.2 LTS”
NAME=“Ubuntu”
VERSION=“18.04.2 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 18.04.2 LTS”
VERSION_ID=“18.04”
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/
PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@rockip4b:~#

root@rockip4b:~# hciconfig -a
root@rockip4b:~#
root@rockip4b:~# rfkill list all
0: bt_default: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
root@rockip4b:~#

I have done all the tricks mentioned on this thread w/o accepted result. Still no bluetooth and as a bonus, wifi keeps disconnecting. Any ideas how to proceed? Thanks

Hooked BT-dongle to USB-port and now I am able to see btle-devices:

root@rockip4b:~# bluetoothctl lescan
[NEW] Controller 00:1A:7D:DA:71:13 rockip4b [default]
[NEW] Device 98:9E:63:17:8C:B6 Beats Solo³
[NEW] Device C8:60:16:8C:BB:4F C8-60-16-8C-BB-4F
[NEW] Device EC:D6:63:18:F3:82 EC-D6-63-18-F3-82
[NEW] Device 5C:06:9A:0B:22:35 5C-06-9A-0B-22-35
[NEW] Device A0:9E:1A:3E:E6:86 Polar A370 3EE6862B
[NEW] Device 00:22:D0:D1:0D:9C Polar M600 9C1F
[NEW] Device 53:9E:26:D4:CD:8F 53-9E-26-D4-CD-8F
[NEW] Device 5C:23:C8:57:CE:2D [LG] webOS TV SJ850V

Dongle is from Ali and labeled as “CSR”. No more tears with bluetooth :slight_smile:

@anon77784915, thanks for the tip, I found this command works once to activate the Bluetooth adapter, but failed after?

root@rockpi:/home/rock# brcm_patchram_plus1 -d --enable_hci --no2bytes --use_baudrate_for_downloade --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmwar/BCM4345C5.hcd /dev/ttyS0 > /dev/null 2>&1 &
[1] 2098
root@rockpi:/home/rock# hciconfig
[1]+ Exit 5 brcm_patchram_plus1 -d --enable_hci --no2bytes --use_baudrate_for_downloade --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmwar/BCM4345C5.hcd /dev/ttyS0 > /dev/null 2>&1

I have also added the download command to my /etc/rc.local as

#!/bin/sh -e

echo 1 > /sys/class/rfkill/rfkill0/state

brcm_patchram_plus1 -d --enable_hci --no2bytes --use_baudrate_for_downloade --tosleep 200000 --baudrate 1500000 --patchram /system/etc/firmware/BCM4345C5.hcd /dev/ttyS0 > /dev/null 2>&1 &

if [ -f /etc/FIRST_BOOT ]; then
apt-get install --reinstall rockchip-fstab
rm /etc/FIRST_BOOT
fi

exit 0

Then I reboot and run,

root@rockpi:/home/rock# rfkill list all
0: bt_default: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no

root@rockpi:/home/rock# hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: 43:45:C5:00:1F:AC ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:904 acl:0 sco:0 events:66 errors:0
TX bytes:5573 acl:0 sco:0 commands:71 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Can’t read local name on hci0: Connection timed out (110)

root@rockpi:/home/rock# hcitool scan
Scanning …
Inquiry failed: Connection timed out