Auto Power On Bluetooth Adapter on Boot-up

By default, it’s automatically powered on with Raspberry Pi 3 and Raspbian Jessie on boot. But after I updated Bluez from 5.23 to 5.43, it’s not turning on automatically and I needed to do so manually by using hciconfig or bluetoothctl as below.

Powering on manually by hciconfig:

$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	DOWN 
	RX bytes:574 acl:0 sco:0 events:30 errors:0
	TX bytes:368 acl:0 sco:0 commands:30 errors:0

$ sudo hciconfig hci0 up
$ hciconfig
hci0: Type: Primary Bus: USB
 BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING PSCAN 
 RX bytes:1794 acl:0 sco:0 events:102 errors:0
 TX bytes:1772 acl:0 sco:0 commands:102 errors:0

Or, powering on manually by bluetoothctl:

$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	DOWN 
	RX bytes:574 acl:0 sco:0 events:30 errors:0
	TX bytes:368 acl:0 sco:0 commands:30 errors:0

$ bluetoothctl 
[NEW] Controller xx:xx:xx:xx:xx:xx raspberry [default]
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller xx:xx:xx:xx:xx:xx Powered: yes
[bluetooth]# quit
[DEL] Controller xx:xx:xx:xx:xx:xx raspberry [default]
$ hciconfig
hci0:	Type: Primary  Bus: USB
	BD Address: xx:xx:xx:xx:xx:xx  ACL MTU: 310:10  SCO MTU: 64:8
	UP RUNNING PSCAN 
	RX bytes:1184 acl:0 sco:0 events:66 errors:0
	TX bytes:1070 acl:0 sco:0 commands:66 errors:0

 

This is how to power on Bluetooth adapter automatically on Raspberry Pi boot up.

1. Make ‘bluetooth’ directory under /etc

sudo mkdir /etc/bluetooth

2. Open a new file named “main.conf” under the directory.

sudo nano /etc/bluetooth/main.conf

3. Add two lines below, save it and close the file.

[Policy]
AutoEnable=true

4. Restart Raspberry Pi.

sudo reboot

5. Verify if it’s powered on by hciconfig command.

$ hciconfig
hci0: Type: Primary Bus: USB
 BD Address: xx:xx:xx:xx:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING PSCAN 
 RX bytes:658 acl:0 sco:0 events:44 errors:0
 TX bytes:2668 acl:0 sco:0 commands:44 errors:0