Raspberry Pi and Edimax WiFi Issue - sleeps during periods of inactivity


I have been having difficulty with the Edimax EW-7811Un wifi dongle on my Raspberry Pi model B on the Raspbian OS. It uses the rtl8192cu driver. After periods of inactivity, the wifi would stop. This is very frustrating since I use this Pi as a headless server and rely on SSH via wifi to access it. I have been trying to figure out the proper way to deal with this, and a Google search has saved the day.

I found the following forum post from MrEngman on Raspberry Pi that showed me the way. Basically, disabling power management and turning off USB auto suspend has done the trick.

To do this, we need to specify these module options and create a .conf file in /etc/modprobe.d. My editor of choice is vi.

sudo vi /etc/modprobe.d/8192cu.conf

Add the following lines in the file and save it.

` # Disable power management and USB auto suspend

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 `

After creating my /etc/modprobe.d/8192cu.conf options file, I rebooted to make the change take effect. I recommend this method. However, using ifdown, ifup, modprobe -r and modprobe to remove and add the module back should work as well as long as you aren’t dependent upon the wifi dongle for shell connectivity.