I bought some EDUP 802.11 N Mini Wi-Fi Adapters from China. They’re cheap and do a fine job plugged into my Raspberry Pi’s.
However, by default, they always go to sleep which makes it difficult to connect to them via ssh etc. To fix this, here’s what I did:
To identify the USB WLAN Adapter I did the following:
$ lsusb Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ lsusb -t /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M |__ Port 5: Dev 4, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M
From that I was able to derive that the WLAN adapter was using the rtl8192cu drivers.
A bit of Googling later, I was able to disable power management on the Wifi adapter, like this:
sudo nano /etc/modprobe.d/8192cu.conf Add the following lines: # Disable power management options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
It should return 0 if the power management is off.
Bask in the glory of your WiFi adapter that stays up all the time 🙂