I observed, that after a while (some hours) my Pi isn't reachable over the wlan any more. If I do some excessive ping-ing (i.e. for 70-100 times) the Pi starts at some point to respond and I can successfully establish an ssh-connection.

Q1. Can somebody explain why the above approach works?

Q2. What can I do to keep the Pi connected?


  • distribution: Raspbian GNU/Linux 7 (wheezy), Linux version 3.12.28+
  • wifi-dongle: Edimax Technology Co., Ltd EW-7811Un
  • /etc/interfaces:

    allow-hotplug wlan0
    auto wlan0
    iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp
  • the Pi has a static IP


Today, I received a wifi-dongle from the The Pi Hut which does not suffer from the aforementioned problem up to now. ping and ssh work immediately.

related posts 1st, 2nd

  • You can install something like wicd-curses but you must ditch suplicant. When you configure your wifi there is an option to autmotically connect. Each wifi you tick this on, wicd will try to connect to those wifi until connected.
    – Piotr Kula
    Oct 28, 2014 at 19:05

3 Answers 3


These problems often seem to be related to wireless power management.

As a first attempt try

iwconfig wlan0 power off
  • 2
    I've just checked it: power-management is off. Oct 28, 2014 at 18:54
  • @participant In that case I suggest you edit your opening post and give details of the wireless dongle you are using, the distribution you are using, and anything else which might help localise the problem.
    – joan
    Oct 28, 2014 at 19:32

A crude way of keeping the connection alive: on the Raspberry Pi, create a crontab entry (crontab -e) to ping a host once an hour:-

# m h  dom mon dow   command
  3 *  *   *   *     ping -c 1 somedomain.com > /dev/null
  • I've seen scripts like that around here, but I would prefer a configuration which takes care of that issue. Oct 29, 2014 at 11:55
  • I realise it's not ideal, but it might tide you over until you find a 'correct' solution, and it's not exactly a resource hog.
    – scruss
    Oct 29, 2014 at 14:09
  • Nice workaround. I would replace somedomain.com by the ip address of own router to make it less "interfering".
    – Fabian
    Apr 27, 2018 at 19:02

Using the advice from here I did

$ iw wlan0 get power_save
Power save: on

It was ON, and I set it to OFF with

iw wlan0 set power_save off

Hint To make this setting permanent I did this.

  • Also there are some differences between iw wlan0 get power_save (which works perfectly) and iwconfig (which might display wrong data about the real powermanagement status). Some USB-Antennas also got this problem. I had to update the driver sudo nano /etc/modprobe.d/8192cu.conf and add the line options 8192cu rtw_power_mgnt=0 rtw_enusbss=0. This line will prevent the powermanagement from shuttign down usb and wifi
    – Spears
    Apr 24, 2019 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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