I have been using a raspberry pi zero 2 w for a project, connecting to it with PuTTY on my computer.
SSH has been working fine until recently, where PuTTY now says “host does not exist”. I tried to use an IP scanner, and the pi does not show up. My wifi password has not changed, everything is the same as before. I tried wpa_supplicant.conf, and no change.
Flashing a new sd card isn’t really an option, since I have all the code on this one for my project and it would take a while to remake it.
Hey there, @Brady317919, and welcome to the forum. Glad to have you here.
Hmm, that is certainly strange, but there could be a number of potential breaks in the chain here. But I want to first focus on the Pi Zero itself. A few quick questions:
Is the Pi Booting:
I can see that you’re using this headless but is there anyway that you can connect it to a HDMI monitor or via a Serial Connection?
If you have another Pi, please swap the SD Cards. Does the Pi Zero boot with a separate SD Card.
Otherwise, with the SD Card still in the Zero, can you plug it into the PC via a USB cable and have it be recognised as a USB device? If you can’t, its deeply indicative that there’s a fault on the board.
I can tell the Pi is booting, because I set a python script to run on startup as a systemd service. I don’t have any way to plug it in to a monitor.
When I connect the pi to my computer, with the usb port on the pi, not pwr in, it doesn’t show up in explorer as a drive, and nothing shows in device manager to say it is connected.
This has happened one other time, where I was still experimenting with the pi. It stopped connecting to wifi, so I flashed a new sd card. If this is the only option, will I be able to use a live usb of Linux on my computer to get the files off?
At this point, backing up your SD Card is probably not a bad idea even if we can get it working. Do you have an SD Card reader? If you connect the Pi’s SD Card onto a computer, it will have two partitions ‘BootFs’ and ‘RootFs’. All your files will be available in ‘RootFS’.
As for the IP Scan, did you assign your Pi to a static IP or are you using DHCP?
And do you have access to the Router’s WiFi Dashboard?
It looks like your Pi isn’t connecting to Wi-Fi anymore, which is why PuTTY can’t find it and the IP scanner shows nothing. Since your network hasn’t changed, the problem is likely on the Pi side.
Try these quick checks (no need to reflash yet):
Look in your router’s device list for a new IP
Connect a monitor to check if it’s booting properly
Recheck wpa_supplicant.conf for small mistakes
Make sure the ssh file is still in the boot folder
Try a different power supply or cable
Usually, it’s a Wi-Fi config or boot issue rather than SSH itself.
Agreed. Backing up the SD card is definitely a good idea at this stage even if the problem is addressed later. Luckily I have an SD card reader so I can access the data if I need to. It was DHCP, not a static IP, and it had been operating properly before this. I also have access to the router dashboard so I’ll check there to see whether the Pi is connecting or getting a different IP address issued.
Are you also having the same problem? In the end I just used a program on windows that can read Ext4 to back up the files and reinstalled pi os. Not sure how long it will last for this time before it ends up not connecting again, at least I have a way to get the files off.
Over the years I have seen SD cards get corupted due to write at the time of a power loss. I don’t think they like to loose power while the “OS” is running. To help offset this a form of UPS may help.
Also keep in mind that SD cards will have a limited write cycle. Cheaper cards may have a sorter life.