0

When I turn off wifi on ubuntu 20.04, the airplane mode turns on, and when I turn it off, the bluetooth turns on, is this a bug or what? I also had same behaviour in 18.04

I want to have the behaviour of turning on/off only the corresponding option which I have selected, how can I fix this? (I can accept a method that programmatically turns on/off any of these three and prevents the other two from toggling)

for example the command nmcli radio wifi off turns off wifi, but this will cause airplane mode to turn on, I am thinking of a solution where I create a script and place these commands in order, and then add this script to the classpath to call it from the terminal:

    nmcli radio wifi on
    
    turn off airplane mode command (how to do this?)

    turn off bluetooth command (how to do this?)
7
  • What computer are you running this on? Do you have any syslogs or other logs that show some errors related to this? Try dmesg then toggle the wifi and see if any errors. If none try tail -f /var/log/syslog and do the same thing. Also dmesg | grep -i firmware- if you see some errors in the output then this can indicate you need to install some firmware - usually a package from the repository.
    – T Br
    Sep 6 at 22:34
  • Airplane Mode: On and radio off and wifi off are all one and the same thing. You are asking, in effect, how can I turn my wifi off but leave it on.
    – chili555
    Sep 6 at 23:16
  • @chili555 - when he turns wifi to "off" airplane mode turns "on" afterwards without user input. Then he turns airplane mode "off" bluetooth instantaneously turns "on"
    – T Br
    Sep 7 at 0:08
  • " when he turns wifi to "off" airplane mode turns "on" afterwards without user input." Entirely normal and expected. "he turns airplane mode "off" bluetooth instantaneously turns "on" " That's the only question here.
    – chili555
    Sep 7 at 0:24
  • @chili555 how is this normal? by the way I can have wifi and airplane mode and bluetooth all turned off siumultaneously so no this is not normal. @T Br I am running ubuntu 20.04 on hp laptop
    – HHH
    Sep 7 at 12:05
1

Please run the command:

rfkill list all

You will see something like this:

0: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
48: hci0: Bluetooth
Soft blocked: no
Hard blocked: no

Take note of the device identifier values; in this case, 0, 1 and 48.

Toggle the bluetooth off:

sudo rfkill block 48

And on:

sudo rfkill unblock 48

Toggle the wireless off:

sudo rfkill block 1

Check:

rfkill list all

You will see something like this, depending on the make and model of your laptop:

 0: tpacpi_bluetooth_sw: Bluetooth
 soft blocked: no
 Hard blocked: no
 1: phy0: Wireless LAN
 Soft blocked: yes
 Hard blocked: no
 48: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no

The wireless is soft(ware) blocked. It will be hard(ware) blocked by the wireless switch or key combination on your laptop. The rfkill command cannot move the switch!

Toggle the wireless on:

sudo rfkill unblock 1 

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.