Firing Up a Raspberry Pi Zero

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.

First Try

Pi Zero with WiFi dongle on USB OTG
Pi Zero with WiFi dongle on USB OTG

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.

Second Try

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.

Pi Zero connected to KVM with Pi 2 in corner
Pi Zero connected to KVM with Pi 2 in corner

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.

WiFi??

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.

Pi Zero GUI showing WiFi network icon
Pi Zero GUI showing WiFi network icon

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.

Pi Zero GUI via RDP running web browser
Pi Zero GUI via RDP running web browser

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.

38 thoughts on “Firing Up a Raspberry Pi Zero

    1. -y (–yes) does not answer yes to any prompt which may destroy data, configuration, or your system by potentially answering yes to it.

      For example if you are upgrading a package and the new default configs are different from your versions default configs, or if your live configs differ from the new defaults, you will be prompted what to do.
      “Y” will delete your custom configs and put the new fresh default ones in place (aka occasionally break things for that package.)
      “N” keeps your custom configs at the risk of now missing new entries for new features.
      There is even an option to show a diff and let you attempt to merge the two together by hand.

      Answering yes here basically means your configs get deleted and replaced with defaults – not something you usually want.

      There is another apt-get option you can give, which will not be uttered here, to answer Yes to these questions as well. It’s in the man page if you want to live dangerously with it, but don’t say I didn’t warn you :P

  1. Can’t even find a Zero unless you want to pay 4 times as much on like e-Bay. So guess it will give time for others to work out the kinks. Any word when they will get the supplies of them up?

    1. I’m 99% sure there is some sketchy deals going on with the Zero. Firstly, a completely unannounced product *somehow* mysteriously sells out in what, not even 24 hours? Even with the speed of information on the internet, I still don’t believe that it was possible that all the magazines that it came with sold out so quick. 48 hours or even 72 hours I might believe, but not 24 hours.

      Also, we are meant to believe that they only made a very small number of boards even though they knew it would be popular. Trying to get more profit from the rarity of the Zero seems to be what they are going for.

      Like you said, the only places that sell it, sell it with other parts coming in at almost the price of a normal Pi.

      1. “sketchy deals” LoL, seriously?

        They do a small volume first to ensure that if there is an error in the design they do not have to replace a million duff devices. Adafruit often talk about this policy, it seems like a manufacturing best practice thing.

      2. Microcenter in the northeast USA have had fluctuating stock for over a month. I got one by luck the first week it was available for $5. They’re back in stock around NYC and Philadelphia.

      3. Minion: “Hey boss, rather than selling them for $10 each and still moving as many units as we can produce, why don’t we charge $5 per unit and come up with some sketchy means of making an extra couple of dollars off of the initial demand?”

        Boss: “Brilliant plan, minion! We’ll make much less money this way, but it’ll be sketchy! I love it!”

      4. This is silly. The internet means that a product can go from “not yet announced” to “announced, and now everyone wants one” in a matter of hours. Most of the “maker”/domestic IoT community that would want one are on twitter. There were reports of people driving round dozens of shops in search of one.

        But this happens every time a new _console_ is released. The Nintendo Wii was particularly bad for it. There’s no way of avoiding it other than the great expense and risk of building and stocking a huge number in advance.

        The internet has got people used to going from “I’ve never heard of it” to having it in a matter of minutes or days. People refuse to wait for TV series to be released. With nonphysical goods at least everyone can have one. With a physical item you have to wait for the production line.

    2. Pimoroni have been saying next year for a couple weeks. They had over 50,000 subscriptions to the ‘tell me when it is in stock’ emails!!! So I expect like when the original it is going to take a few months before we all calm down and stock levels will build up. When that happens (giving others a chance to buy theirs) I will be getting a hand full of them to complement my stock of micro controllers. :)

  2. this is a bit of a newbie question probably for another place but:

    I’m fairly experienced in a modern Linux environment: Is taking the reigns of a RasPi an easy transition? I would like to start small in programming but I’ve only done shell scripting and simple stuff like that.

    1. Yes, the best part about a Raspberry Pi is the community. There’s always people willing to help you and plenty of tutorials out there.

      For the most part – you have people starting with a Pi that haven’t used Linux before, like me for instance.

  3. I am a Briton who has lived in Wisconsin USA for 7+ years. A few weeks ago my wife suggested a Magazine subscription for Christmas so I ordered the MagPi magazine. Yesterday a Envelope arrived from the UK containing December’s edition along with a Zero and a cable. I have already 2 Pi B’s and a Pi 2.

  4. I downloaded a copy of Jesse and burned it and it came up no problem. I didn’t use any GUI but was able to get wifi running and do everything over wifi (I had to borrow a keyboard and monitor from others to get wifi up); joys of laptops :) and having a dozen non-USB keyboards and non-HDMI monitors

  5. FYI:

    https://www.raspberrypi.org/blog/raspbian-jessie-is-here/

    “Where can I get it?

    This is a major version upgrade – due to the large number of changes to the underlying operating system, we strongly recommend using Jessie from a clean image, so you’ll need to download a new Jessie image from the downloads page on our site. (Some people have had problems extracting the zip files, as the large size of the image file causes zip to use a different format internally. They can be successfully unzipped with 7-Zip on Windows and The Unarchiver on Mac – both are free applications.)

    Starting with a clean image is the recommended way to move to Jessie. If you really need to update a Wheezy image, we have tried an unsupported upgrade path which is documented on the forums here (https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121880). This has been shown to work on a vanilla Wheezy image, but we can’t predict what effect it may have on any packages or data that you have installed, so this is very much at your own risk. Feel free to add your experiences and improvements to the upgrade process to the forum so others can benefit.”

    1. The Pi needs that certain SoC made by Broadcom. Without it, it’s not a Pi. So the question is, can you buy that SoC on the open market? Can you get it cheap enough to be able to sell the result cheaper than the Pi? Will it be fully compatible (Remember the Firmware for the GPU)?

      I think the answer to at least one question is ‘No’ and that’s the reason why there are no cheap clones.

    2. Hardkernel made a raspberry pi zero like board about a year ago called the Odroid-w. They used the same Broadcom SOC until Broadcom found out and stopped selling them any more socs :(

  6. Are you aware that WEP is completely worthless these days? You just as well could have turned off encryption, which would have removed a lot of hassle from your installation process.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.