Can't Connect to Raspberry Pi...AGAIN!
June 24, 2020
I ran into an issue again where I wasn’t able to SSH into my Raspberry Pi…this is how I fixed it this time.
The Lead-Up
I was connected to pi and could see that the disk space was 100% full…apparently it’s been a bit too long since I last checked in on my time lapse project! I started clearing space by copying the files to my laptop via scp
.
Then I started uploading the files to an S3 bucket using the AWS console. Well I soon ran low on disk space on my laptop, and simultaneously ran out of memory on my laptop and everything ground to a halt. I tried closing programs, deleting applications, etc. hoping to just finish the uploads but it wasn’t going to make it. The browser stopped responding all together, and the only way out was to force restart the whole machine.
Unfortunately the SSH connection was still open to pi which I learned is a problem…!
The Problem
When I restarted my computer this was the state of things:
- Finished the uploads and deleted all the files…disk space and memory issues are now gone—fine.
- Try to connect to pi via SSH again (
ssh pi@192.168.0.188
) and it stalls for a long while before timing out:ssh: connect to host 192.168.0.188 port 22: Operation timed out
- Run
nmap
to see if the IP address has changed (this fixed the problem the last time I couldn’t connect)…but it doesn’t show that Pi exists on the network at all:$ nmap -sn 192.168.0.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2020-06-20 00:50 BST
Nmap scan report for hyperwifi.mynet (192.168.0.1)
Host is up (0.0026s latency).
Nmap scan report for nias-awesome-mbp-machine.mynet (192.168.0.231)
Host is up (0.00076s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 9.54 seconds - Try to
ping raspberrypi.local
but it returns:ping: cannot resolve raspberrypi.local: Unknown host
- Restart my computer (turn it off and turn it on again!) and try connecting…nope.
- Run
nmap
from a different laptop on the same network…nope. - Try all of the above a few more times hoping something will magically change 😑
- Log in to the admin dashboard for my Wifi network to check what devices are connected and confirm that it does show Pi with on its IP address.
Because of this last one, the only thing I didn’t try was restarting Pi or connecting it to its own screen for me to troubleshoot on it directly. If there was any chance it was still connected and taking photos I didn’t want to stop it, or physically move it from the position it’s been in for months.
The Solution
Turned out to be a simple fix! I rebooted my wifi router and ran nmap
again to find that Pi could be found again—on a different IP address granted, but I could connect to it!
Once connected I found that it indeed had been taking photos still while it was “offline,” so glad I didn’t dismantle the whole set up to get this fixed.
Now everything’s back up and running normally…yay!