Bug with the RTL8192 wifi driver

If you use a wifi dongle like the Edimax EW-7811Un, or another that needs the RTL8192 driver, then wifi will go to sleep after some period of inactivity, requiring you to restart networking, or disconnect from wifi then reconnect.

This is VERY annoying when the system is remote and you connect to it via ssh / the browser.

Years ago, the RTL8192 driver used to have power management options, so you could create /etc/modprobe.d/rtl8192cu.conf with this line…

options rtl8192cu rtw_power_mgnt=0 rtw_enusbss=0

…and it used to do the right thing.

But nowadays the 8192 kernel modules don’t seem to have power management options anymore. Run modinfo on any related module, and there’s nothing there to work with.

A palliative would be to run ping continuously on the gateway, or on any IP that’s close and guaranteed to stay up. E.g. you could create /etc/rc.local with this content…

#!/usr/bin/env bash
/usr/bin/screen -S ping -dm bash -c 'while [ 1 ]; do ping -n X.Y.Z.K; sleep 1; done'

…and that would prevent wifi from sleeping. Needless to say, this is inadequate and wasteful.

If the kernel source still has power management options for those modules, and those options can be enabled via a compile option, could NVIDIA release a kernel update for the Nano where those options are enabled?

Barring that, what other options are available?

@florin.andrei

Please try iw dev wlan0 set power_saver off to see if there is still a disconnection.