# Using the Imager to setup a Pi Zero with ssh and Raspberry Pi Connect
We don't have many monitors and keyboards in V207 for students to use, so we will need to get the Raspberry Pi installed without them.  This is sometimes called "headless" because we think of the monitor as a sort of head.

## Creating an image
1. Download the [Raspberry Pi Imager](https://www.raspberrypi.com/software/) and install it
    - Important note2026-06-28  The Raspberry Pi Imager 2.0.10 may have buttons with gibberish text, a [known problem](https://github.com/raspberrypi/rpi-imager/issues/1648).  The 2.0.9 image doesn't have this problem and can be [downloaded from the github distribution website](https://github.com/raspberrypi/rpi-imager/releases/tag/v2.0.9).
1. Start the Imager program and pick your device
![imager-pickdevice.png](Graphics/imager-pickdevice.png)
1. The lite images are not on the first menu.  We choose the 32-bit lite image to make sure it works with the Zero W and Zero 2 W.
![imager-raspios_other.png](Graphics/imager-raspios_other.png)
![imager-raspios_lite.png](Graphics/imager-raspios_lite.png)
1. V207 has some USB-microSD card interfaces.  I used a multi-card interface which shows up here.
![imager-pickstorage.png](Graphics/imager-pickstorage.png)
1.  It is helpful to know your RU username, which is simply your email address with the @RU.IS removed.  For example, the instructor's username is "foley".  To make it clear what this PI is being used for, he chooses it as the second part of the hostname:  "foley-rover"
![imager-hostname.png](Graphics/imager-hostname.png)
1. The timezone and Wifi frequencies are set by the region the device is being used.  The keyboard setting is important to match the keyboard you will be using with the device.  I have a US keyboard, so I chose that.  Icelandic students will probably want the Icelandic keyboard.
![imager-localization.png](Graphics/imager-localization.png)
1. As before, use the same username as your RU one.  To improve security, choose a password that is different than the one you use to get your email.
![imager-userandpass.png](Graphics/imager-userandpass.png)
1. The iot-research network's password is shown on the whiteboard at V207.  Type it here very carefully.  If you use the device on multiple networks, you can change that later with `sudo nmcli`.  With that tool you can setup multiple networks and it will try them in order of preference.  I usually set my home network as one of the options.
![imager-network.png](Graphics/imager-network.png)
1. SecureShell (ssh) is the best way to connect to it over the network.  You need to have already setup a ssh key to use the public key option.
![imager-ssh_nokey.png](Graphics/imager-ssh_nokey.png)
1. Once you have uploaded your `id_edcsa.pub` file it should look like this. 
![imager-ssh_key.png](Graphics/imager-ssh_key.png)
1. Since we don't have a monitor, keyboard, and mouse available, we will need another way to setup the initial connection.  The officially supported option is Raspberry Pi Connect.  You will need to enable it then:
    1. Register for an account first at https://connect.raspberrypi.com
	2. Confirm your account with email
	2. Login with that account
	2. Click on the Imager button to get a token
    ![imager-raspiconnect.png](Graphics/imager-raspiconnect.png)
    2. This will open a web browser and if you ar logged in, ask for confirmation
    ![connect-newauth.png](Graphics/connect-newauth.png)
	2. If you confirm
    ![connect-imagerkey.png](Graphics/connect-imagerkey.png)
	2. Then the token gets pasted into Imager
	![imager-raspiconnect-token.png](Graphics/imager-raspiconnect-token.png)
1. Now it's time to write the customized image to the SD card.
![imager-writeimage.png](Graphics/imager-writeimage.png)
1. Imager wants to be really sure that you want to do this.
![imager-writeimage-confirm.png](Graphics/imager-writeimage-confirm.png)
1. Now you get to watch the writing then verifying.
![imager-writeimage-progress.png](Graphics/imager-writeimage-progress.png)
![imager-writeimage-verifying.png](Graphics/imager-writeimage-verifying.png)
1. The process is complete!  Now you can [connect to your pi](connect.md)
![imager-complete.png](Graphics/imager-complete.png)
