0

As the WiFi hardware is working with 2.4GHz and and a more important device in my system is using the same frequency for broad casting, I would like to turn off the actual WiFi hardware for the majority of the workflow of my application. Towards the end, once it is safe to broadcast at 2.4GHz, I'd like to turn the hardware on and start using WiFi.

After some search, it seems like most of the solutions either require a reboot (like adding the WiFi to the /etc/modprobe.d/blacklist.conf or they only result in software block:

pi@raspberrypi:~ $ sudo rfkill block all; sudo rfkill list all
0: phy0: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
1: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no
pi@raspberrypi:~ $

Any thoughts on this issue?

Thanks.

3
  • Hmm... Since it is possible to enable/disable the wifi transmitter in the gui, I suppose this can be achieved with a command as well. – PMF May 22 '20 at 17:25
  • "like adding the WiFi to the /etc/modprobe.d/blacklist.con" -> If just not loading the module works, try removing it dynamically via sudo rmmod. You may have to look at lsmod if there are dependent things that have to be rmmod'd first. I can't promise the hardware ends up in the same state as if it had never been initialized but it is worth a quick try. – goldilocks May 22 '20 at 17:31
  • I thought rmmod only removes the mod interface rather than actually turning off the device... is that incorrect? – Mohsen Najafi Yazdi May 22 '20 at 17:54
1

You can enable and disable WiFi with

sudo ip link set wlan0 up
sudo ip link set wlan0 down

in Raspbian but I am unsure if this fully powers off the hardware as they are still not hard blocked.

You can disable WiFi and Bluetooth via entries in config.txt BUT they require a reboot to be activated:

dtoverlay=disable-bt
dtoverlay=disable-wifi

Interestingly after these are added in, sudo rfkill list all does not return anything.

One odd thought I had was to wonder if you could use a Pi Zero and add a WiFi dongle when needed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.