vgfede
Posts: 3
Joined: Sun Nov 08, 2020 10:46 pm

How to disable bluetooth at startup

Sun Nov 08, 2020 10:58 pm

Hi,
I'm new to this world, I just bought my first Raspberry Pi (3 B+) and I use it headless mode through ssh. I wanted to disable both Bluetooth and wifi at startup (since I don't use them) to reduce the load and heat of the Raspberry.
I found online how to disable wifi, but I can't find how to disable Bluetooth. For now, I disabled wifi with `sudo crontab -e` and adding `@reboot ifconfig wlan0 down` and I would like to use a similar solution for Bluetooth.
Furthermore, how can I check if I really have disabled Wifi and Bluetooth?
Thanks
Last edited by vgfede on Mon Nov 09, 2020 8:47 am, edited 1 time in total.

User avatar
CaptainMidnight
Posts: 345
Joined: Sun Nov 03, 2019 4:32 pm
Location: UK

Re: How to diable bluetooth at startup

Mon Nov 09, 2020 5:03 am

viewtopic.php?t=180928#p1149938

..... that should help.

But with buster, this changed to the following /boot/config.txt entries to disable both Bluetooth and WiFi.

Code: Select all

dtoverlay=disable-bt
dtoverlay=disable-wifi

That's certainly how it's done in buster for the Pi4B.
"Never get out of the boat."
Absolutely goddamn right!
Unless you were goin' all the way...

vgfede
Posts: 3
Joined: Sun Nov 08, 2020 10:46 pm

Re: How to disable bluetooth at startup

Mon Nov 09, 2020 8:48 am

Ok, thanks. And how can I check if I have really disabled Wifi and Bluetooth?
I found the /boot/overlays/README file and read it, and it says that in order to disable bluetooth I should use also

Code: Select all

sudo systemctl disable hciuart
Is it really needed or not?

User avatar
CaptainMidnight
Posts: 345
Joined: Sun Nov 03, 2019 4:32 pm
Location: UK

Re: How to disable bluetooth at startup

Mon Nov 09, 2020 2:17 pm

vgfede wrote:
Mon Nov 09, 2020 8:48 am
Ok, thanks. And how can I check if I have really disabled Wifi and Bluetooth?
I found the /boot/overlays/README file and read it, and it says that in order to disable bluetooth I should use also

Code: Select all

sudo systemctl disable hciuart
Is it really needed or not?

Earlier reply was missing some prep commands for using the serial port ttyAMA0 and complete removal of Bluetooth/WiFi and kernel serial console

Code: Select all

sudo systemctl disable hciuart
sudo systemctl disable [email protected]
sudo systemctl mask [email protected]
sudo apt purge bluez bluez-firmware wpasupplicant
sudo apt-get autoremove

This gives you the hardware serial UART back for your own use. Testing serial ports are correctly assigned

Code: Select all

ls -l /dev | grep serial
lrwxrwxrwx 1 root root           7 Nov 30 23:27 serial0 -> ttyAMA0
lrwxrwxrwx 1 root root           5 Nov 30 23:27 serial1 -> ttyS0

If you really want to, you can blacklist unused kernel modules

Code: Select all

sudo nano /etc/modprobe.d/raspi-blacklist.conf
	
#Disable wifi
blacklist 8192cu

#Disable bluetooth
blacklist btbcm
blacklist bnep
blacklist bluetooth
"Never get out of the boat."
Absolutely goddamn right!
Unless you were goin' all the way...

vgfede
Posts: 3
Joined: Sun Nov 08, 2020 10:46 pm

Re: How to disable bluetooth at startup

Mon Nov 09, 2020 3:01 pm

I don’t want to remove Bluetooth and WiFi forever because I may need them in the future. I would like to only deactivate them (at startup so when I reboot the raspberry it doesn’t turn on them)

User avatar
CaptainMidnight
Posts: 345
Joined: Sun Nov 03, 2019 4:32 pm
Location: UK

Re: How to disable bluetooth at startup

Mon Nov 09, 2020 3:09 pm

Then disable with the overlays in /boot/config.txt and use sudo systemctl disable hciuart to reuse the UART - job done!
"Never get out of the boat."
Absolutely goddamn right!
Unless you were goin' all the way...

Return to “General discussion”