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.

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.

2 Likes

Nice! Thanks for sharing this.