Stopping your wireless from turning off on your Raspberry PI

How to stop your wireless from turning off on your Raspberry Pi

If like me you have had issues with your wireless USB dongle turning off when your Pi thinks it is idle there is an easy way you can fix this.

  • We make a quick edit
  • We restart the networking processes
  • We verify it has worked

Making the Edit

You need to edit your /etc/network/interfaces, we need to do this as sudo.

sudo vim /etc/network/interfaces

(sudo nano works just as well if you don’t like vim.)

The change we need to make is to add wireless-power off to this configuration file, this tells the wireless USB dongle not to attempt to do its own power management.

We should add this to the bottom of the file.

As an example here is my complete file (don’t just copy and paste my entire file, do whatever works for you!);

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off

Restarting the Network Processes

Once we have made this edit we simply need to restart the networking processes, we do this by calling the following;

/etc/init.d/networking restart

Verify the change has worked

Once things have restarted we need to make sure that when we run iwconfig we can see as part of the output “Power Management:off”.

iwconfig | grep "Power Management"

If you an see “Power Management:off” our change has worked.


Recent posts View all

Ruby

How to ignore Bullet in RSpec tests

Using Bullet during a test can pick up mistakes but also has false negatives; here is an easy way to ignore them

Ruby

How we used Nokogiri to fix a sizing issue in YouTube's oEmbed

At some point, one of our calls to YouTube's oEmbed endpoint was returning videos way too small; we fixed in in our Rails application by using Nokogiri