I have a raspberry pi 2 with a canakit WIFI USB (RT5370).
If there's no traffic to the raspberry for about 10 seconds (eg, not typing in my SSH connection), it will go into sleep mode or some sort. I have tried turn off power management as suggested by my sources online but no luck:
$ iwconfig wlan0 IEEE 802.11bgn ESSID:"koikoi" Mode:Managed Frequency:2.437 GHz Access Point: C0:C1:C0:2D:8F:B2 Bit Rate=65 Mb/s Tx-Power=20 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality=63/70 Signal level=-47 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:118 Invalid misc:4 Missed beacon:0
Unable to ping the Raspberry Pi 2 after the interface goes to 'sleep'
$ ping 192.168.1.146 ping: sendto: No route to host ping: sendto: Host is down ping: sendto: Host is down ping: sendto: Host is down ping: sendto: Host is down
At this point, the only way to get the connection alive is to ping out from the Raspberry Pi to the router (192.168.1.1)
$ ping 192.168.1.146 PING 192.168.1.146 (192.168.1.146): 56 data bytes 64 bytes from 192.168.1.146: icmp_seq=0 ttl=64 time=4.242 ms 64 bytes from 192.168.1.146: icmp_seq=1 ttl=64 time=4.992 ms 64 bytes from 192.168.1.146: icmp_seq=2 ttl=64 time=3.717 ms 64 bytes from 192.168.1.146: icmp_seq=3 ttl=64 time=4.222 ms
I've added a cron to ping my router every other second but this isn't ideal. I'm looking for a real solution - any help is appreciated!