On boot, I can successfully SSH into my pi. Then when I exit the session, I can immediately SSH back into it but if I wait some variable length of time (usually a few hours but sometimes more and a lot less), can’t SSH into it anymore. When I ping it (using ping 192.168.3.106
), I get ping: sendto: No route to host \nRequest timeout for icmp_seq 0\nping: sendto: Host is down
messages. When I look at the SSH status or run SSH in verbose mode on the pi, SSH seems to be running fine but just doesn’t see that anything is trying to connect to it.
At the moment, I can successfully ping and SSH in again if I restart the pi or if I try to SSH back into my laptop (doesn’t matter if I was successful or not).
I’ve tried all of the below but none of them have worked.
- Checking I’m on the same network
- Checking SSH is enabled on the Pi
- Making sure the Pi is fully up to date by running
sudo apt update && sudo apt upgrade -y
- Checking I’m SSHing into the right port/IP. I’ve also set a static IP for the pi
- Assigning the Pi's static IP to the Pi's MAC address on the server
- Adding
TCPKeepAlive no
to my laptop’s SSH config - Adding
IPQoS cs0 cs0
to the pi’s SSH config - Setting up a cron job to ping google every minute
Some other ideas I haven’t tried:
- Turning off APSD / WMM in my router settings. Haven’t done because struggling to access my router settings and also read that this feature makes other devices on the network more energy efficient
- Setting up a cron job to attempt to SSH into my laptop every minute. This is just my idea based on the workaround I mentioned. I haven’t done this as it seems a bit hacky and will probably be unreliable
Other things that could be relevant:
- Pi model: 3B+
- Laptop model: 2019 M1 Macbook Pro
- Connection method: WiFi
- ISP: 3 UK 4G Broadband
Anyone got any ideas on what to try next? Or so I can stop wildly trying random things on the internet, better ways for me to troubleshoot so I can identify whether the issue is my laptop, network or pi?
ping 192.168.3.106
. I've added this to the post