I ordered a Raspberry Pi Zero from Adafruit in their Startup Pack right after they were released. There are a few Greater Than Zero Pis (GTZPi) already on my workbench so my purchase was driven by curiosity, not necessity. With no rush on delivery it eventually got here, and I finally got around to looking at it. My experience with the Pi family began with the Pi B+ and, shortly after that, the Pi 2. The speed difference between them was noticeable so I decided to dive in and further test the performance of the Zero.
One of the first hacks for a Zero just used an existing SD card from a GTZPi so I tried that. I connected the USB On the Go (OTG) cable with a WiFi dongle and the mini-HDMI port to my keyboard-video-monitor (KVM) switch. With power applied the activity LED lit… and then flashed eight times, went solid, flashed eight times, and repeated the pattern. Obviously, something was wrong. The Internet to the rescue!
The flashing LED meant the Zero couldn’t read the file system on the SD card. Further searching suggested updating the SD card while running it on a GTZPi, which I did. The commands were the standard for updating a Linux system:
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade
I put the SD card back in the Zero and got eight flashes. Okay, time to create a new SD card.
Off I went to the Pi web site for the newest version of NOOB. That was the slowest download of a 1 Gb file I’ve ever seen but it did finally finish. I formatted the SD card, unzipped the NOOB file, and copied the resulting directory to the SD. I swapped out the WiFi dongle on the OTG for a USB to PS2 keyboard and mouse cable which in turn plugged into the KVM cable.
The Zero booted and the monitor displayed the NOOB setup screen but neither the mouse nor the keyboard responded. My KVM is old enough that sometimes the kludge of USB to PS2 cables isn’t always recognized, requiring a reboot. I powered off to try again. Still no success, so I looked a little closer at everything.
I discovered, with a bit of a red face, that I’d reversed the power and OTG cables. If you’ve wondered about powering the Zero through the OTG port I can tell you it works. I’m not sure I’d recommend doing this unless you’re absolutely sure you’ve only got a single power supply connected. The Pi power circuit has a blocking diode on the USB power input to prevent dueling power supplies. The standard USB ports and GPIO pins do not have that diode. The Pi Foundation recommends adding a blocking diode when powering a Pi through the GPIO ports.
The Adafruit site is a good resource for the Zero. That is where I went to check which connector was power and which OTG. Yes, it’s printed on the board but the room was a little dark, and, well, I just didn’t see the labels. While on the Adafruit page I reread everything to refresh my memory and found a notice:
Raspbian Wheezy 5-15 or earlier do not support the Zero! Try Jessie instead
Sigh! I should have looked here earlier. With the correct version of the OS and cables connected properly, I finally got some success!! The Zero was running with keyboard, mouse and monitor.
Now I needed to get WiFi working. I had a powered hub on my workbench to connect Arduinos to my desktop machine. I connected the OTG cable to the hub’s input and plugged in the keyboard, mouse and WiFi. The Zero booted fine and saw all the USB devices.
In the upper right of the GUI there’s an icon for networking. A right click produced a list of wireless networks. Clicking on the name for my house network presented a dialog box for entering the public shared key (PSK). That’s not going to work for me because I just use WEP security. My router supports WPA but not all the phones, laptops, TVs, etc around the house can handle it so I’ve remained with that level of (in-)security.
My recollection was that wpa_gui came installed with Raspbian, but either my memory is wrong or they dropped it with this distribution. wpa_gui is a GUI application that lets you setup WiFi. Without wpa_gui I couldn’t get the WiFi working through the GUI. I searched for command line setup using my desktop browser but it seemed easier to revert to working with a Pi 2.
I pulled out a Pi 2, hooked it up, plugged in the 100 ft network cable that is just for this purpose, and popped in the SD card from the Zero. It booted fine and much faster than the Zero. With networking working, I loaded wpa_gui. While I was on the faster network I ran updates and upgrades to get the latest software versions. There weren’t many changes. Since I wanted to access the Zero over the network using RDP I also loaded xrdp.
sudo apt-get update sudo apt-get upgrade sudo apt-get install wpagui sudo apt-get install xrdp
Still on the Pi 2, I got the WiFi working using wpa_gui without any hassles and used the Pi configuration utility – it’s at Menu | Preferences – to change the host name to pizero to distinguish it from my other Pis. I’ve had as many as 3 Pis running at the same time so they need different names.
I also setup and tested the RDP access from my desktop. My desktop is Ubuntu 14.04 so my RDP application is Remmina RDP. I copied one of the other Pi connections and changed the name of the target machine to pizero.local to make it all work. The xrdp server on the Pi didn’t require any setup.
With all that completed on the Pi 2, it was back to the Zero. It all worked with the KVM and WiFi plugged into the USB hub.
Time to get brave. I disconnected the USB hub and HDMI cable, put the WiFi dongle on the OTG cable and powered it up. After waiting a moment I tried the RDP connection. Success again!
At this point prudence kicked in and I saved SD image.
Upgrade Wheezy to Jessie
The distribution of Raspbian required by the Zero is called Jessie. The previous version, the one I tried to use, is Wheezy. As you probably know from using various OSs on desktop you can upgrade one version to another. So I tried it.
I went back to the Wheezy SD card on a Pi 2 and ran the following commands:
# remove packages of really large size sudo apt-get remove --remove wolfram-engine sudo apt-get remove --remove libreoffice* # update to the latest Wheezy and clean out debris sudo apt-get update -y sudo apt-get upgrade -y sudo apt-get dist-upgrade -y sudo apt-get clean sudo apt-get autoremove # change the distribution from wheezy to jessie sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list.d/*.list # get the jessie version of everything sudo apt-get update -y sudo apt-get upgrade -y sudo apt-get dist-upgrade -y sudo reboot
This process took a reeeeaaaalllllyyy long time. You can’t walk away because there are prompts throughout that need to be answered. The best you can do is work on something else and keep an eye on the Pi’s activity LED. As long as it’s flashing the process is working. If not, it’s waiting at a prompt.
It finally completed and ran. Still no luck on the Zero. It produced the same 8 flashes on the LED.
I haven’t run this for very long on the Pi 2, so cannot assure you that it is a solid upgrade to Jessie. The reason for trying this is there are a number of installs that will take a while to replicate on a fresh install – Eclipse, Robot Operating System (ROS), OpenCV. I may not want those on the Zero – maybe ROS – but this was a good excuse to try the distribution upgrade since I will want them on the Pi when I upgrade to Jessie.
Having installed the new Raspbian Jessie for the Zero and tried the upgrade on the Pi 2 I now know what to do when I tackle a serious project on the Zero or Pi 2. I’m not comfortable with the upgrade and will probably not follow that path. My next step is to put the Jessie Lite version on the Zero and set up the ability to cross compile from my desktop to that system.
The Zero is a good addition to the Pi family. While slower than its siblings the difference is not that great. For example, the GUI was not snappy but at the margin of usability. It is certainly quite usable as an embedded controller, especially considering it costs just $5.00.