Context: I'm trying to set up pihole as per these two tutorials. I'm using a Raspberry Pi Zero W.

I created an SSH file which I added to the sd card. I also created a wpa_supplicant.conf file as per the instructions here, which I then copied to the sd card. I then put it into the pi and hooked it up to power, which should've sufficed for it to connect to wifi. However, when running nmap -sn, the Pi is nowhere to be found (the devices that show up, which are probably two phones, my computer, and the router itself, refuse my attempts to ssh into them). Does this mean that the Pi is not connected to the network?

Due to presumably unrelated reasons, I'm not able to access my router via my browser. I can reset it to factory settings, which wouldn't be too annoying, but I'm concerned about the pre existing wpa_supplicant.conf file. Assuming I reset the router, create a new network, and make a new wpa_supplicant.conf file, will it overwrite the preexisting one? Moreover, is it possible to navigate to the .conf file through my laptop using a card reader? It would be nice to check whether I actually inputted the correct information. My attempts so far have proven futile.

For reference, I made my wpa_supplicant file cd ing into my Desktop, writing touch in my terminal, opening the file in TextEdit, and writing:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


I then saved and dragged the file into my sd card.

Thanks in advance!

  • If you want help tell us what YOU did NOT links to tutorials. – Milliways Sep 11 '20 at 6:01
  • 1
    @Milliways My apologies, I was not familiar with the etiquette, I'll edit the question shortly – Reveillark Sep 11 '20 at 6:21
  • Nothing to do with etiquette - if it doesn't work either you didn't follow the tutorial OR it doesn't work. So we now have 2 problems and no diagnostics. – Milliways Sep 11 '20 at 8:06
  • We could also do with a copy of the wpa_supplicant file (without password) in the code block. Leave quotes etc in. What did you use the create the file? Notepad.exe will not work as it adds crlf to the end of lines and the Mac file editor changes quotes – user115418 Sep 11 '20 at 12:35

It is difficult to understand with your description what may be the problem. I assume it is mainly due to the installation of pihole. I suggest to verify first your network environment by using a default Raspberry Pi OS (32-bit) Lite. Follow the official documentation to enable SSH (Secure Shell) and WiFi by Setting up a Raspberry Pi headless. This must work and you are able to correct your network environment.

A new wpa_supplicant.conf in the boot partition will overwrite the existing one on the next boot up.

If you have another SD Card available the you can use it to setup your pihole. If it doesn't work then you can boot the RasPi with the default SD Card and attach the pihole SD Card with a USB card reader to it. So you are able to access all partitions on it and modify its configuration files, like etc/wpa_supplicant/wpa_supplicant.conf or what you want.

You do not tell us what operating system do you use to create the wpa_supplicant.conf. If it is MS Window$ then it may be possible that the editor you are using does not store the file with the correct line endings. MS Window$ uses CR+LF (carriage return and line feed, two bytes), Unix uses only LF (one byte). To be on the save side you should ensure that wpa_supplicant.conf only uses LF.

  • I have not yet installed pihole, as I'm unable to ssh into my pi since it's seemingly not connected to wifi. Sorry if that was unclear. I sadly don't have another SD card available right now. – Reveillark Sep 11 '20 at 16:15
  • @Reveillark Yes, of course, that is logical :-) I haven't thought on this. If you haven't done a typo on wpa_supplicant.conf then a problem with the RasPi is very unlikely. A new wpa_supplicant.conf in the boot partition will overwrite the existing one on the next boot up. – Ingo Sep 11 '20 at 17:00
  • @Reveillark I have updated the answer about file format. – Ingo Sep 11 '20 at 17:18
  • Thanks for your help. I'm using macOS as an operating system and TextEdit as a text editor – Reveillark Sep 11 '20 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.