When I plug my Pi in and boot up, I am able to connect over the air with SSH at (static IP address set in /etc/network/interfaces).

However if I boot up my Pi and leave it for 1-2 hours or longer, when trying to connect to my Pi with SSH at the same address, I always get the SSH error

Network error: Connection timed out

It seems as though the WiFi may shut down on the Pi after no useage for a certain period, however looking at the Pi physically, the lights seem the same as they are when directly booting up - Flashing WiFi Usb and other solid PI board LEDS.

  • can you connect a screen and keyboard to ensure the Pi is still operating ?
    – rob
    Jan 14, 2015 at 11:29

1 Answer 1


ssh connections timeout after a period of inactivity. This is unlikely to be the Pi, but the client timeout, although the network connection may timeout on inactivity. (My Mac remains connected to my Pis for hours - until the Mac goes to sleep).

You can set ssh timeout on the Pi, but you would be better to do this on your ssh client (you don't tells us which OS or client you are using). This causes to client to send a keep alive message at regular intervals, and it will only disconnect if no response is received.

  • @KerryJames is talking about making new connections not existing connections timing out. FYI I leave ssh connections to my Pi open for days at a time without them timing out (host machine is not allowed to sleep).
    – rob
    Jan 14, 2015 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.