2

I am trying to set up a Raspberry Pi Zero with Raspbian Stretch headlessly.

From my understanding, in order to accomplish this task requires three steps:

  1. Flash Raspbian to a microSD (I did so using Etcher).
  2. Add an empty ssh file in the boot directory.
  3. Add a wpa_supplicant.conf file with my network information in the boot directory.

The problem is, for some reason, both of the aforementioned files disappear after I try to boot up the Pi.

This is the process I use to create the files:

  1. I create the files on the microSD card using sudo (for me the directory is in /media/MyMachine/boot).

  2. Ensure that both files are inside the boot directory (even cat them to see all the right changes have been made).

  3. Stick the card in the Pi.

  4. When I cannot find the Pi on my network, I check the card and find that neither the ssh file nor the wpa_supplicant.conf file are in the boot directory.

EDIT: I should note that I am using Ubuntu on the machine I use to write onto the microSD card--the Pi contains Raspbian as noted above.

  • Make sure the file is being saved in the micro SD, save the file to the card, remove it from your PC, and re-insert it to make sure it is not a problem on the card. – Alessandro Schneider Oct 23 '18 at 20:24
3

ssh will be deleted and wpa_supplicant will be moved. That's why they vanished.

Looks like your wpa_supplicant is not configured correctly and therefore you don't get any WLAN connectivity. Please see Prepare SD card for Wifi on Headless Pi.

  • That's correct and there is likely something wrong with the config for WiFi not to work properly. See my answer here how and whereto wpa_supplicant is moved. – Ghanima Oct 24 '18 at 8:35
2

to the boot directory

That depends on your perspective. If you are referring to a context on a running Pi, then the /boot directory should work.

However...there's probably no reason you would want to do this if that were the case.

If this isn't a running system, "the boot directory" is really a misnomer. This refers to the boot partition which, on a running system, is usually mounted on the /boot directory.

If the system is not running, the /boot direcory (which is on the second partition) is not the same thing as the boot partition, which is the first partition and where you want to leave those files.

So, if you've mounted the SD card, you've either mounted the first, the second, or both partitions. If the partition you are looking at has a /boot directory, that's the wrong place. It will not end up on the boot partition and will be hidden underneath the mount point on a running system.

  • And a further hint to the OP: the mounted boot partition must contain some system files and drivers which include kernel.img and kernel7.img. – Ingo Oct 23 '18 at 20:57

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.