- Отключить wifi raspberry pi
- How to disable your Raspberry Pi’s WiFi | 3 Easy Methods
- How to Disable your Raspberry Pi’s WiFi
- 1: Disable WiFi through Taskbar
- 2: Disable WiFi through Command Line Interface
- 3: Disable WiFi through Configuration File
- Conclusion
- About the author
- Awais Khan
- Disable WiFi (wlan0) on Pi 3
- 11 Answers 11
- See Ludovic Ronsin’s answer above about using dtoverlay, a method added in January 2017.
Отключить wifi raspberry pi
За большое время работы с Raspberry PI и экспериментами с ним выяснилось, что внутреннй BT работает не совсем идеально и общее использование сети на 2.4 GHZ
приводит к небольшим траблам и сеть может пропустить пару пакетиков или БТ подтупливает при передаче или приеме данных.
Да и субьективное мнение сложилось, что чувствительность страдает и работает со сбоями.
В общем как отключить внутренний BT и WI-FI и воткнуть USB BT и WI-FI донглы этот блог.
- /boot/config.txt
и в конце дописываем (спасибо SoulTaker, подправил строчку про WI-FI)
# Disable Bluetooth dtoverlay=pi3-disable-bt # Disable WI-FI dtoverlay=pi3-disable-wifi
В консоли для этого делаем:
sudo nano /boot/config.txt
Вписываем выделенное выше и Ctrl+X, потом Y
Это в принципе достаточно, но можно и другим путем, где можно выключить и BT, и WI-FI размазанные по плате.
Идем по пути:
/etc/modprobe.d/raspi-blacklist.conf
и там пишем:
# Отключение BT blacklist btbcm blacklist hci_uart # Отключение WI-FI blacklist brcmfmac blacklist brcmutil
Все, внутренние железки не работают.
Напомню, что если конфиги правите любыми внешними редакторами, то не забывайте про кодировку UTF-8.
Втыкаем USB BT CSR 4.0.
У меня был только такой и драйвера подхватились автоматически, с другим чипсетом возможно придется поставить драйвера к нему.
Проверяем командой, что cистема увидела донгл:
lsusb
Там должны увидеть Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
ID какой у него и куда прилепился ( у меня Device 005: ID 0a12:0001) не особо интересует, это нужно, к примеру для того, что бы работать с конфигами устройства.
Ну допустим описать его в Pulse Audio.
В общем обнаружили и удостоверились, что все живое.
Дальше на всякий случай апдейтнем систему и модули:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install bluetooth bluez-utils blueman bluez python-gobject python-gobject-2
Для BT 4.0 лучше всего использовать модуль Bluez последней версии.
Сейчас актуальный 5.9
Как ставить.
Качаем:
wget www.kernel.org/pub/linux/bluetooth/bluez-5.9.tar.xz
Распаковываем:
tar xvf bluez-5.9.tar.xz && cd bluez-5.9
Конфигурируем:
./configure —prefix=/usr —mandir=/usr/share/man —sysconfdir=/etc —localstatedir=/var —enable-experimental
Компилируем:
make -j4
Устанавливаем:
sudo make install
И после не длительных по времени ожиданий обязательно ребутим:
sudo reboot
Идем снова в консоль и удостоверяемся, что поставили 5.9 версию:
bluetoothctl -v
Высветит 5.9
Аналогично ставим USB WI-FI на 5 Ghz.
Не думаю, что у кого-то возникнут проблемы по установке USB донгла на 5 Ghz, но если возникнут вопросы — пишите в комменты или форум.
How to disable your Raspberry Pi’s WiFi | 3 Easy Methods
WiFi is one of the crucial features of your Raspberry Pi device that enables you to access the Internet and perform online activities. However, it may consume your device resources if it turns on for a longer time and may reduce your device speed. If you are working on an important task on your Raspberry Pi device that doesn’t require a WiFi connection, you may disable it to boost your working speed.
If you don’t know how to disable your WiFI on Raspberry Pi, you should follow this article, where you will see several ways to do this task.
How to Disable your Raspberry Pi’s WiFi
There are three important methods to disable WiFi on Raspberry Pi and the details of these methods are discussed in the following sections:
1: Disable WiFi through Taskbar
This method is the easiest one to follow for the Raspberry Pi users to disable the WiFi. To perform this method, you will need to go to the WIFI icon that appears on your taskbar and then right click on it.
There you will see the option “Turn Off Wireless LAN” and as soon as you click on the option, your WiFi will be disabled.
2: Disable WiFi through Command Line Interface
You can also disable WiFi on Raspberry Pi through a command-line interface called “rkfill” that allows you to block and unblock WiFi on your device. To perform this method, first, you have to install the “rkfill” utility through the following command:
After completing the installation, apply the following command to disable WiFi on Raspberry Pi.
To enable the WiFi any time on Raspberry Pi device, you can use the following command:
3: Disable WiFi through Configuration File
The boot configuration file of Raspberry Pi provides you with the option to enable and disable your WiFi connection any time. For this purpose, you just need to add a one-line text to disable the WiFi on your device.
To perform this method, first you will need to open the boot configuration file through following command:
Scroll down to the end of the file and there add the following text right below the “[all]” text as shown below:
Save the file by pressing the “CTRL+X” keys, use “Y” to confirm the changes and press enter to go back to the command-line terminal. After saving the file, reboot the device and when it restarts, the WiFi will be disabled on your device.
Conclusion
Disabling WiFi on Raspberry Pi boosts your device speed and is important when you don’t require internet connectivity or have an Ethernet cable for high-speed internet. The above three methods will be the easiest to follow for the Raspberry Pi users who want to disable WiFi, and it depends entirely on you to pick the best one to disable the WiFi on Raspberry Pi.
About the author
Awais Khan
I’m an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.
Disable WiFi (wlan0) on Pi 3
Got a Pi 3 which will always use ethernet, so trying to figure out how to disable the WiFi such that it does not even turn on after a reboot. If I do an ifconfig I see the wlan0 device. I can do ifconfig wlan0 down but it will come back up again after a reboot. I tried commenting out anything about wlan0 (and wlan1 ) in /etc/network/interfaces but that has not made a difference. eth0 is not commented out so it can be used.
What is the setting for wlan0 in /etc/network/interfaces ? If it is auto change it to manual followed by ifdown wlan0 .
Thanks, @ott. You just reminded me how to have the internal one stop grabbing a DHCP address while the USB WLAN unit connects with static. I just commented out the wpa_supplicant line and added ifdown wlan0 — Thanks again.
11 Answers 11
To completely disable the onboard WiFi from the firmware on the Pi3 / Pi4, add
This is documented here. Please be sure to use an up to date firmware, this feature was added in January 2017.
There is also an overlay for disabling onboard bluetooth : disable-bt . If you want to disable both wifi and bluetooth, you need to add these 2 lines :
dtoverlay=disable-wifi dtoverlay=disable-bt
NOTE : If you are using an old ‘Pi3 only’ firmware, you need to prefix the overlay name with pi3- . See this issue
At the time that I wrote my answer (the current accepted one) I did not know of this way, nor do I know if it was even an option at that time. This is a far superior method than the one described in my answer.
The overlay did not exist at the time you wrote your answer. As stated in my response, this was added on January 2017. So don’t worry, you were right !
@deanresin Please see updated response. TL;DR; The way the dtoverlay configuration works can be seen as a sequence of command. They are executed in the order they are encountered. So you can declare it more than once. Overlay parameters, if any, are set with dtparam=. ‘command’ and refer to previous declared dtoverlay . For more info see official documentation at raspberrypi.org/documentation/configuration/…
See Ludovic Ronsin’s answer above about using dtoverlay, a method added in January 2017.
This post seems to be talking about this. The answer talks about disabling the drivers by editing the file /etc/modprobe.d/raspi-blacklist.conf and adding:
blacklist brcmfmac blacklist brcmutil
Alternatively, you could use crontab -e and add:
So that command runs at each boot.
Hope this helps, I’m still waiting for my Pi 3 to arrive.
The blacklist method worked for me. Just created a /etc/modprobe.d/local-blacklist.conf file, instead of appending to an existing file.
As far as I know, the blacklist method is closer to administratively down’ing the interface. It does not completely power down the interface.
I like using the crontab to do it. As a matter of style I would edit the root crontab instead of any other user, and leave out sudo . For stretch, you need to use ip link set wlan0 down instead of ifdown
If you are using debian stretch and ifdown returns unknown interface wlan0 then use: sudo ifconfig wlan0 down instead. If it still doesn’t work, use ifconfig to list all available network interfaces.
sudo iwconfig wlan0 txpower off
This should disable the wifi adapter.
Use sudo iwconfig wlan0 txpower on to enable it again.
I’ll take your word for that then. In future you might want to include more explanation in your answer, since this got automatically flagged yesterday as «low quality» (due I think to length and lack of formatting) by the system, which is when I noticed it. In itself that sort of doesn’t matter; I dismissed the flag. However, a moderator can dismiss a flag (not act on it) as «helpful», and if it was a «low quality» flag, that automatically gets you a downvote.
. I didn’t do that, but one of the other mods probably did out of habit (or because they agreed the answer as originally posted did not indicate much effort being made), which is how you got one down vote (automatic) and one up (from me), since flags are sometimes left for review by multiple mods. Note I don’t like this «automatic downvote» policy and have actually complained on S.E. Meta about it to no avail (the justification is that actual people flag things as low quality but «forget» to also downvote).
@Erutan409 to re-enable the wifi adapter you should write two times «sudo iwconfig wlan0 txpower auto». but as a say you should write it two times otherwise it wont work (i believe there is some glitch in the firmware)
We have measured the RF from the Pi 3 (when used as a WiFi hotspot) and confirmed that this statement disables the Pi’s WiDi transmitter when used as a hot spot:
You can also easily create a clickable button on the taskbar to do this. Instructions are found here: http://orbisvitae.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=81166#Post81166
I modified the rc.local using command sudo nano /etc/rc.local , and added ifconfig wlan0 down in it. However, if Ethernet is not connected or IP is not assigned to wired interface then the WiFi is on. This gives a backup way to connect the RasPi when running headless.
Install ethtool with sudo apt-get install ethtool .
Then copy the script below to sudo nano /etc/rc.local right before exit 0 , so the last lines look like this:
# Disable WiFi if wired. logger "Checking Network interfaces. " if ethtool eth0 | egrep "Link.*yes" && ifconfig eth0 | grep "inet"; then logger 'Disabling WiFi. ' ifconfig wlan0 down else logger 'WiFi is still enabled: Ethernet is down or ethtool is not installed.' fi exit 0
Then save using CTRL + X and reboot. It seems to work for me, as after reboot ifconfig does not give wlan0.