Headless RPi Z

The Raspberry Pi Zero (RPZ) is a great board to due to its size.  It might not be the fastest or the strongest.  but its form factor makes it great for small projects or stuff in tight spaces.

The down side to the RPZ, is it requires many dongles (extra adapters) and a second monitor, and another keyboard and mouse to get it working.  Luckily it does not need all of that stuff, you can set up the RPZ with your computer (windows tutorial) and then access it from your computer saving space and hardware.

Parts:

  • Raspberry Pi Zero
  • Micro SD card
  • usb to micro SD card reader
  • USB to ethernet hub (optional)
  • usd A to usb micro
  • your computer

Programs:

  • WinDiskImg (Free)
  • SDFormatter (Free)
  • PUTTY (Free)
  • VNC Viewer (Free)
  • Notepad ++ (Free)

The first thing we will do is got o the raspberry pi website and down load the latest version of Jessie with GUI  Jessie. Here you will be downloading a ZIP file containing a ISO.  a ZIP file is just a file that was compressed to save space. while the ISO is the actually operating system.

While that is downloading (will take a few minuets, its a large file).  we will download and install a program called SD formatter.  You can do this using the windows built in system for reformatting drives, but I will not since I do not like the built in program.  The other program you will need with WindiskImg.  This is a program that will “burn” the files onto the micro SD card.  Download these programs and install them.

Once Jessie is downloaded and unzipped (put it in a location you know where it is), insert the micro SD card into the sub to micro SD card reader, plug it into your computer and open SD Formatter.  Double, Triple, Quaduple check to make sure you are formatting the correct drive.  IF YOU SEE “C:” YOU ARE FORMATTING THE WRONG DRIVE!!!!

SD formatter

Format the SD card to FAT32.  FAT32 is a file structure used on linux operating systems (OS) (jessie is a linux based OS).  Once the SD card is formatted you will open WinDiskImg and make sure the same letter drive is selected as the one you formatted, and open the jessio ISO form WinDiskImg.  this is done by selecting the little folder icon in WinDiskImg and locating the ISO.  Select “Write” and go make a cup of coffee or mow the lawn, this will take some time (15 min or so).

win23Disk

Once the program finishes, we need to add a file and add a few lines to existing files.  After the writing of the files to the SD card you should see the drive as an USB and can open the drive and see the files.  In the top directory of the SD card we need to add a new text document.  The title will be “ssh” but make sure you remove the extention “.txt”

ssh

In other words your file should be named “ssh” and not “ssh.txt”.  If it was done right, you will get a error message saying there is no extension.  This is a good sign.

These next two files we are adjusting will allow the RPZ to use the USB as a Ethernet gadet, thus not needed a USB to Ethernet hub to initially setup the RPZ.

First we will go to the “config.txt” file with Notepad++, scroll all the way to the bottom , hit enter twice and add “dtoverlay=dwc2”.

config edit

The next file to modify is “cmdline.txt”

comline

scroll over to location where is says “rootwait” and “quiet”.  Inbetween these words we need to add “modules-load=dwc2,g_ether”.  And save, with these files modified, we can SSH into the RPZ through USB.

Next eject the sd card. put it in the RPZ. and plug it in.  Once its powered up,

Next we will start up PUTTY, after the RPZ is pluged in and you see a little green light turn on and blink.  After waiting a little (3 min or so) we will type:

Raspberrypi.local

into Putty with the port set to 22.  if all went well you will see a black box with a promte to log in.  The log in credentials for a RPZ is:

  • Username:pi
  • Password:raspberry

once you log in we can then type in:

  • sudo raspi-config

this will open the configuration of the RPZ.  first we will expand the file system, then we will enable VNC.  First we will go to advanced options>expand filesystem. After we will go to interface options, and enable VNC.

Once all that is done we will select finish and have the RPZ reboot. After it reboots we will log into it again with PUTTY, log into the RPZ and type “sudo apt-get update”.  This will update the RPZ.  After its done updating we will run “sudo shutdown -h now”  this will shutdown the RPZ.

Once you turn the RPZ back on you can now VNC into the RPZ with VNC. using the same log in credentials as you did for PUTTY

 

desktop

Congratulations!!!!