This blog is also available on Gemini (What's Gemini?)

Keep WiFi Alive on Raspberry Pi


So solving my connection problems to a Pi by turning off power savings didn't work. I'm now using a crude but effective method where the Pi pings the gateway every 2 minutes.

Start by adding this script to /etc/



while : do ping -c 1 ${PING_HOST} > /dev/null sleep ${SECONDS_BETWEEN_PINGS} done

This script works in an infinite loop, sending a single ping every 120 seconds. Call `chmod 755 /etc/` to make it executable. Next, call it from /etc/rc.local:

/etc/ &

Which will run the script on the next reboot. Call `/etc/ &` in a shell to start it running, and you're done.

So far, this seems to make ssh connections start immediately every time. I'd like to figure out what the actual problem is, but this will do.