Raspberry Pi Wifi dropping connection

Started playing with my Raspberry Pi this weekend and noticed that the wifi connection would not stay up for long when connected through SSH. After some digging online I found that the wifi was getting put in sleep mode. Here’s how to fix it:

  • Create a new file named 8192cu.conf at the following location /etc/modprobe.d/8192cu.conf
    sudo nano /etc/modprobe.d/8192cu.conf
  • Write the following command
    options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

    (This makes sure that the power management is turned off thus preventing the dongle from going to sleep mode.)

  • You can go further and ensure that the connection remains up and stable by sending a ping request from your Pi to the router using crontab:
    crontab -e

    (Adds a new entry to crontab.)

  • Enter the following at the end of the file:
    */1 * * * * ping -c 1 192.168.1.2

    (Change the 192.168.1.2 to the IP of your router. The IP of the router can be found by opening a command prompt in Windows and running the ipconfig command and checking the number besides “default gateway“.)

If you don’t have a Edimax wifi dongle you may have to find how to disable the power management for your device.

Source: http://www.xbmchub.com/forums/raspberry-pi-discussion/8037-your-wifi-dongle-dropping-connection-mainly-edimax-ew-7811un.html

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *