Disable Sunxi-bt

I have an issue with BPI-M2U as reported in another post but I have not had any help from banana pi support.

I want to disable sunxi-bt from the CLI so that it does not start at all or the error of bt: block state already is 0 can be resolved. How can I do this?

I need to do this with the raspbian-jessie install. I’m using the latest version (2017-05-25).

Please help.

Have you already tried to sudo systemctl mask bluetooth.service?

thanks. not exactly this command but I have tried stopping the bluetooth.service

sudo systemctl stop bluetooth.service

this command does stop bluetooth service (have checked using systemctl status) but it doesn’t stop the sunxi-bt bt: block state already is 0 messages.

one strange thing I have found is that rfkill list shows 2 BT devices. Also shows 2 wi-fi devices. I have no idea if this is any help.

the output of rfkill list is:

root@bpi-omv:~# rfkill list

0: sunxi-bt: 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

4: hci0: Bluetooth Soft blocked: no Hard blocked: no

Well, I can’t help since I’ll never again make the mistake to buy any of these Bananas lacking manufacturer and community support. Still hope you get it resolved eventually. Good luck!

Appreciate your help. My banana pi is really not an important project. I wanted to compare performance against my raspberry pi v3. I had no idea that support, development community and product stability would be so different.

So I guess i have learnt to do better research before buying. I will not be buying another banana that is for sure!

@sinovoip - come on! Please help! Is the output from rfkill list normal/expected? There are 2 entries for wi-fi and 2 items for bluetooth. I think sunxi-bt and phy0 are not needed. How do I get rid of them?

0: sunxi-bt: 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

4: hci0: Bluetooth Soft blocked: no Hard blocked: no

This output is the correct list, nothing to worry about.

Googling gives the following answer:

  • sudo systemctl stop [servicename]
  • sudo systemctl disable [servicename]
  • sudo rm /etc/systemd/system/[servicename]
  • sudo rm /etc/systemd/system/[servicename] symlinks that might be related
  • sudo systemctl daemon-reload
  • sudo systemctl reset-failed

You could also remove it from loading the drivers that you see in the list as duplicate if it is compiled as a kernel module: edit the file /etc/modules and remove the modules:

  • hci_uart

Please, note that this could be in modules.conf depending on the distro.

BUT, if you really want to stop BT from working at all just do a:

sudo rm -f /usr/local/bin/ * without the space between / and *

Warning: removing the wrong directory or contents may stop your board from booting!

@avaf - thanks for your help.

I have used sudo systemctl stop and sudo systemctl status etc to stop and start the bluetooth service but this does not resolve the issue I have with the error sunxi-bt bt: block state already is 0

I think sunxi-bt is a bluetooth related config from an older board that has not been removed from the M2U kernel / config. I think sunxi-bt is trying to do stuff with bluetooth and is interfering with the newer BT functionality that is part of bluetooth.service.

I can’t seem to find how/where the sunxi-bt stuff comes from. Nothing in modules.conf. nothing in etc/modules.

How can I track this thing down?

I have found some additional entries in the boot log relating to sunxi-bt. Anything from this that could help me?

017-06-11T16:04:04+0100 bpi-omv kernel: sunxi-bt bt: bt_power_name (vcc-wifi-2)

2017-06-11T16:04:04+0100 bpi-omv kernel: sunxi-bt bt: io_regulator_name (vcc-io-wifi)

2017-06-11T16:04:04+0100 bpi-omv kernel: sunxi-bt bt: bt_rst gpio=236 mul-sel=1 pull=1 drv_level=1 data=0

2017-06-11T16:04:04+0100 bpi-omv kernel: sunxi-bt bt: clk_name (outa)

2017-06-11T16:04:04+0100 bpi-omv kernel: sunxi-bt bt: block state already is 1

This is a Warning, not an error.

sunxi-bt is the bluetooth/wifi driver and is a built-in kernel driver responsible for bt/wifi power, so you CAN’T stop it from loading unless you build the kernel without Wifi/BT driver.

If you just STOP the service, next boot it runs again! I think following my answer should work somehow and you would see the warning only once but you must remove the BT service(s) and BananaPi service(s) or you will get other warnings, and sorry, i don’t have the OS image you are running.

Hope this Helps. Good luck.

@avaf thanks for your continued help.

OK I understand it is a warning and not an error and I wouldn’t mind if the warning happened once in a while. My issue is that I get the warning every 5 seconds - so that’s 17,280 warnings a day or 121,000 a week… I think I have got the message!!! haha

I think I will try your suggestion above but i’m not confident it will work because i can stop the bluetooth service and it has no impact on the warning messages.

will report back after trying this. fingers crossed.

OK. That didn’t work at all.

I can confirm that the bluetooth.service is no longer running - even after a restart but bluetooth seems to be running exactly the same as before and i’m still getting the warning message every 5 seconds.

I personally think that something else (i.e. not bluetooth.service) is doing the bluetooth config/startup. Even with bluetooth.service not starting I see quite a few bluetooth related stuff in the logs.

It looks like something else in systemd is starting bluetooth but it’s not bluetooth.service!

Jun 13 17:16:19 bpi-omv kernel: [ 22.936427] Bluetooth: HCI UART driver ver 2.2

Jun 13 17:16:19 bpi-omv kernel: [ 22.936447] Bluetooth: HCI H4 protocol initialized

Jun 13 17:16:19 bpi-omv kernel: [ 22.936452] Bluetooth: HCI BCSP protocol initialized

Jun 13 17:16:19 bpi-omv kernel: [ 22.936457] Bluetooth: HCILL protocol initialized

Jun 13 17:16:19 bpi-omv kernel: [ 22.936462] Bluetooth: HCIATH3K protocol initialized

Jun 13 17:16:19 bpi-omv kernel: [ 22.936468] Bluetooth: HCI Three-wire UART (H5) protocol initialized

Jun 13 17:16:19 bpi-omv systemd[1]: Starting Load/Save RF Kill Switch Status of rfkill3…

Jun 13 17:16:19 bpi-omv systemd[1]: Starting Bluetooth.

Jun 13 17:16:19 bpi-omv systemd[1]: Reached target Bluetooth.

Jun 13 17:16:19 bpi-omv systemd[1]: Started Load/Save RF Kill Switch Status of rfkill3.