1

I just got a Pi 3, model B. It's running raspbian, and I have it on power and Ethernet only. I have internet connection when on the Pi itself, and can SSH into it for up to ~30 minutes after I last touch it. However, if I leave it running with the monitor disconnected, then it no longer accepts connections. The IP remains correct, and if I return to my room and stir the Pi, then it will respond to SSH again.

I'm new to the Pi. Does it have some kind of sleep mode? Or am I losing my connection from the router.

Thanks!

Zarocross
  • 11
  • 3

3 Answers3

1

Similar questions have been asked before. Here are some things to check to start debugging this:

Raspberry Pi sleep mode, how to avoid

Without some troubleshooting, the answer to one of your questions is that no, the PI doesn't have a sleep mode. However, other devices in the chain might.

J. McCabe
  • 11
  • 1
  • 3
0

Found the answer - it needed to ping the router occasionally to maintain a connection. I set mine to ping ever ten minutes.

Zarocross
  • 11
  • 3
0

You can modify the SSH server or client configuration to avoid timeouts this.

On the server side add the following lines:

ClientAliveInterval 120
ClientAliveCountMax 720

to the /etc/ssh/sshd_config file.

This will send a null packet very 120 seconds and not disconnect the client for 24 hours.

On the client (Mac or Linux) you can add the following line:

ServerAliveInterval 120

to your ~/.ssh/config file, to send a null packet every 120 seconds.

If you are using Putty (PC) you can set the seconds between keep alive to 120. This option is located under the connection menu.

Of the two options, I would suggest using the server based approach first, as you only need to make a single change no matter how many clients you use to connect.

Steve Robillard
  • 34,988
  • 18
  • 106
  • 110