Most visited posts/pages in the last 24 hours
Join 189 other subscribers
A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu
I recently tried making wireless work on a laptop, but I got problems with rfkill showing that it was hard blocked. In fact, the wireless switch was off, but when I set it on, it still showed that it was hard blocked.
Here is a solution that I found that works:
sudo rfkill unblock all
for x in `for i in \`lspci -nn | grep 02[80] | awk '{print $1}' | tr ' ' '\n'\`; do lspci -vvvs $i; done | grep "Kernel driver in use:" | awk '{print $NF}'`; do sudo rmmod $x; sudo modprobe $x; done
sudo sed -i 's:false:true:g' /var/lib/NetworkManager/NetworkManager.state
sudo rfkill unblock all
sudo rm /dev/rfkill
If you still can’t connect after the reboot, type this into a Terminal window:
sudo rfkill unblock all
for x in `for i in \`lspci -nn | grep 02[80] | awk '{print $1}' | tr ' ' '\n'\`; do lspci -vvvs $i; done | grep "Kernel driver in use:" | awk '{print $NF}'`; do sudo rmmod $x; sudo modprobe $x; done
sudo rfkill unblock all
If you had any problems with this post, feel free to leave a comment!
None of the commands in step 2 can have effects that survive a reboot. So I wonder why you needed steps 2 and 3 at all.
Actually, they do have effects after reboot, especially the rm /dev/rfkill command.
rm /dev/rfkill cannot have effect after the reboot, because /dev is a tmpfs. If you insist that it does, please explain the mechanism.
For some reason, it does fix some rfkill problems (there were many blog posts using it). I guess that somehow it resets it? I don’t exactly know how it works, but all that I know is that it can help the problem.
Well, here is how that “rm /dev/rfkill” command works.
Applications such as NetworkManager control the rfkill state by opening the /dev/rfkill device and writing some pre-defined sequences of bytes into it. By removing that device, you make them unable to change the current rfkill state. This definitely works (although it is not a proper solution), I am just saying that after the reboot udev will create the device again, thus undoing your work.
Your real problem is that, for some reason, NetworkManager (or some other program – e.g. the laptop-mode script, please find that out) thinks that your radio should be off, and periodically tries to enforce its viewpoint via /dev/rfkill. You should politely (i.e. via configuration files or checkboxes in the GUI) convince that program to change its decision instead of working around its delusion.
The problem can be caused by what you said, but rebooting after removing /dev/rfkill will reset rfkill. Usually, the problem has nothing to do with rfkill, but has to do with a driver thinking that the wireless switch is off.
Removing /dev/rfkill, then rebooting, only works for some rare problems.
Thanks for posting these scripts – they are very useful.
Just one question: could you add some information what they are doing, as I usualy want to understand what I am doing when executing a script?
Cheers and thanks for an interesting blog,
Rainer
The first command tries to unblock the soft blocked.
The second command (the longest one) tries to find all of the network drivers currently in use, then it disables and re-enables the drivers (It almost always works).
The third command repeats what the first one did.
The fourth command simply resets rfkill.
I hope this clarifies it!
Pingback: Blair Armeau » How to fix rfkill Issues « lkubuntu
Please make sure /var/lib/NetworkManager/NetworkManager.state shows “true” for all the items. If not, then yes, NM might be overriding rfkill, though the default setting definitely isn’t to have anything disabled (but you may have run into an old bug if in Lucid).
Otherwise, that’s most likely a kernel bug, you really should file a bug report in Launchpad.
Thanks, I’ll add that to the post.
Pingback: SIOCSIFFLAGS: Operation not possible due to RF-kill « Hayi no Tabi…. another story….
It worked first time!
I am really impressed by this Ubuntu Forum and the Ubuntu program and the people behind it .
Thank you for an excellent product and a first class service
AWESOME!!!!!! Thank you!!!!!!!
Thank you so much!!!!
Thank you. That do the job.