Text File Editing

If you burned the OS image successfully, you should see a folder named boot appear on your main computer. If it doesn't, try removing and reinserting the SD card. If it still doesn't, try burning the image again.

There are three text files we will create/edit in boot.

  1. wpa_supplicant.conf - wifi settings
  2. config.txt - global system settings
  3. ssh - an empty text file to enable ssh

We are going to edit these directly on the SD card before putting it in the Pi Zero. This way you can edit these files using your favorite graphical text editor on your main computer. Try to avoid using a word processor though.

Configure WiFi

The Pi Zero W has built in WiFi so nothing additional is required. If you are using the original Pi Zero, you will need some form of WiFi Adapter and a way to connect it: cable or adapter.

The WiFi configuration file does not exist and needs to be created. The name of the file should be wpa_supplicant.conf and its contents will get copied to the system folder at boot time. It will then be deleted. So this a one time only process. If you want to try again, you have to recreate the file and reboot.

The contents of the file should be as shown below. Replace YOURSSID and YOURPASSWORD with whatever is used for your network setup.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
    ssid="YOURSSID"
    psk="YOURPASSWORD"
    scan_ssid=1
}
Don't put any spaces around the = in this file. It doesn't like that.

Like this:

Save file and move on to next step. (more details here)

Enable UART

The file called config.txt already exists, we are just going to edit its contents. We will add some text to the bottom to enable the UART on the GPIO header pins. This allows a USB console cable to be attached later for troubleshooting.

Open the file in a text editor and add the following text to the bottom.

# Enable UART
enable_uart=1

Like this:

Save it and move on to next step. (more details here)

Enable SSH

SSH used to be enabled by default, but was then (Nov 2016) turned off by default. This was due to security concerns since the pi user id and password are well known. However, you'll likely want this enabled so you can remotely connect to the Pi Zero.

To do so, we simply create a file called ssh. This file does not exist and needs to be created. It can be empty. The system looks for it at boot time and will enable ssh if it is there. It is then deleted. So just create a new file and save it as ssh to the boot folder.

Final Check

After the above steps, you should have the following files on the SD card in the boot folder.

Safely remove the SD card from the main computer and install it in the Pi Zero.

Last updated on 2018-04-19 at 01.07.56 PM Published on 2017-05-17 at 04.09.27 PM