How to disable WiFi in Raspberry Pi4, possibly keeping the chip powered off.
- 1Does one of the answers solve your question? It should. Please accept one to finish the question.Ingo– Ingo2019-10-25 09:40:12 +00:00Commented Oct 25, 2019 at 9:40
- @ingo None of the answers below will prevent some script or use re-enabling it at boot or later. There is not really a good (non-hardware) answer to this.m4r35n357– m4r35n3572025-02-19 11:15:44 +00:00Commented Feb 19 at 11:15
3 Answers
Raspbian is managing hardware with overlays. In /boot/overlays/README you will find:
Name: pi3-disable-wifi Info: Disable Pi3 onboard WiFi Load: dtoverlay=pi3-disable-wifi Params: <None> I suggest you just add
dtoverlay=pi3-disable-wifi to /boot/config.txt to disable wifi. I have tested it with a Raspberry Pi 4B. It is also valid for Pi4. When disabled you will not get a WiFi interface wlan0 as you can check with ip -br addr.
UPDATE:
@JeffAtwood noted in his comment
They renamed it to
disable-wifiso you can use that,pi3-disable-wifiwas kept as a synonym for compatibility. Same thing with disabling bluetooth.
2019-10-25: seems everything is documented now in /boot/overlays/README.
- 1Has anyone tested this? I don't really want to risk bricking my pi based on an assumption :)Wossname– Wossname2019-07-16 18:05:21 +00:00Commented Jul 16, 2019 at 18:05
- 2@Wossname I have just tested it for you and updated the answer.Ingo– Ingo2019-07-16 22:54:25 +00:00Commented Jul 16, 2019 at 22:54
- 5One small tweak, they renamed it to
disable-wifiso you can use that,pi3-disable-wifiwas kept as a synonym for compatibility. Same thing with disabling bluetooth.Jeff Atwood– Jeff Atwood2019-07-22 09:11:14 +00:00Commented Jul 22, 2019 at 9:11 - @JeffAtwood I cannot find it in the official documentation
/boot/overlays/README. Where do you get it?Ingo– Ingo2019-07-22 10:40:56 +00:00Commented Jul 22, 2019 at 10:40 - 4@Ingo Looking in
/boot/overlays/READMEfrom the September release of Raspbian Buster I can now seedisable-btanddisable-wifidocumented.Heinrich Ulbricht– Heinrich Ulbricht2019-10-24 21:29:35 +00:00Commented Oct 24, 2019 at 21:29
Use rfkill block wifi and reboot to disable and rfkill unblock wifi and reboot to enable it again.
Create /etc/modprobe.d/brcm-blacklist.conf with the following content:
blacklist brcmfmac blacklist brcmutil Reboot, and WiFi should be disabled. You may find errors in the system log depending on what method you are using to configure the network. You can choose to correct those, or not, of course.