0

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.

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?

occrg
  • 1
  • 1

1 Answers1

0

Make sure you are not running a cron job that is calling an inaccessible address. I changed my router and forgot to update my cron (Check both user and root crons)

The culprit was

*/5 * * * * /home/cam/bin/keep-wifi-link-alive.sh >/dev/null 2>&1

Where keep_wifi_link_alive.sh was

#!/bin/bash

keep wifi alive

ping -c2 192.168.68.1

if [ $? != 0 ] then echo " " echo "No network connection, restarting wlan0" ifconfig wlan0 down sleep 30 ifconfig wlan0 up else echo " " fi

My rPi was dropping and restarting the link every 5 minutes.

Cam Cairns
  • 101
  • 1