Monday, March 25, 2013

Setup

So I've had the pi for about a week now.  I purchased it from Amazon and had it delivered (Prime) at the vanguard of a 4-day blitz of nubbins, dongles, adapters, bit buckets, and encasements.  Here it is!  In all its pint-sized glory...


[Pictured:

  • IOGEAR 4-port USB 2.0 hub (passive power)
    •       Logitech QuickCam (pictured at bottom)
    •       SanDisk 16GB thumb drive
    •       Wireless dongle for ancient Logitech mouse (not pictured)
  • Old Kindle micro-usb power supply (5V)
  • 32GB (class 4... Zzzzz) SanDisk SD card
  • EdiMax WiFi dongle (hiding underneath hub connector)  
Keyboard and monitor not currently attached - in "SSH-only" mode.




[So that's the monitor (next to my MacBook) on the kitchen table.  Up to this point I've been about 50/50 between tiling terminal windows in the built-in X-win environment and SSH'ing in from either the MacBook or the iPad mini (with SSH client and bluetooth keyboard - great for tweaking on things from bed at 2am or during meetings)]




I went with the latest "wheezy" Raspbian distribution (hard float, recommended distro) for a few reasons:


  1. Being new to the platform and wanting to play with lots of different peripherals, suspect that "vanilla" setup will be easiest and best-supported online for troubleshooting
  2. Where possible, want to enable the broadest-possible audience to follow/replicate/improve upon my results
  3. Don't have any compelling reason (yet) to do anything else (well, hard float issues aside.  More on that later...)
The first couple of days I basically spent getting the thing up and running and getting the various pieces of hardware to show up / mount / fulfill each one its unique and special purpose.  

Below is a rough record of what I did to get stuff up and running.  Before trying to use my bumbling as a template for your own endeavors, I'd recommend giving a look to the basic setup guide.

Step 1: Image the SD Card

The first step was of course imaging the flash disk (for a couple of bucks extra you can order a pre-loaded card on Amazon or from one of these guys... no judgment!).  I first tried RPI-SD Card Builder, but for reasons that I could not ascertain and without any sort of useful hints or error messages it kept crapping out on my MacBook after roughly 15 minutes of chugging.  

I didn't try all that hard to troubleshoot - instead tried out the Pi Filler app, which worked on the first try (YMMV).

[As an aside - Pi Filler's IvanX also has a "finder" app to locate your pi on the network without having to plug in a keyboard and other helpful features.  I'd like to see really helpful tools like this get rolled into the standard distribution - more on this later.  Okay now.  Just a teaser.  I've set up a shell script on my Mac shell to do broadcast ping (response to which on Raspbian is disabled by default / out of the box, natch) and then I try them one at a time with SSH until I get a hit, but am working to make this happen automagically. ]

Thanks, helpful free tool providers of the interwebs!  I hope to follow in your sterling footsteps and provide something of value to the community as well.

Step 2: .....

Step 3: Profit!

After imaging the disk, it was pretty much just a matter of plugging in the usb hub, the HDMI-to-DVI cable to attach the monitor (just borrowing the Dell flatscreen from the home desktop), a usb keyboard (also borrowed from home desktop), and a kindle 5-V micro usb charger (we have what must be dozens of these and the like in every drawer in the house accumulated over the past decade).  That's it!

The system boots into the one-time setup screen.

[I highly recommend doing what I didn't do and following the instructions to update raspi-config before using.  The reason I didn't was pure laziness... I didn't want to drag pi+wires+monitor halfway across the house and re-set up in range of a wired ethernet connection.  In point of fact, I have never used the ethernet jack on my pi - it's been wireless from day 1.  It hasn't cost me anything... but really - doing it the right way may spare you some headaches downstream.]

 Here's what I touched:
  1. Turned off the "desktop on boot" option (personal preference, but I always prefer to start in a shell and startx only when I think it will be helpful or necessary, thank you very much - and this goes double for a little guy like the pi).
  2. SSH on (you didn't get a marvelously-portable Raspberry Pi just to have it shackled to keyboards and monitors and the like all the time, right?)
  3. Set timezone
  4. Changed my password
[OMINOUS PAUSE...]

From there it cheerfully booted up in seconds with a perky scroll of crisp, hi-res Linux-y-looking startup commands under the approving gaze of a plump little raspberry overlord (I call him Baron von Raspby).  While this experience may not carry with it the high-polish commercial sheen of the anthropo/mythical ritual unboxing of the latest Apple iThing, it still got my little hobbyist's heart aflutter watching it boot up for the first time...   

Step 3 Revisited: A Cautionary Tale

Fun fact: did you know that our friends across the pond have their very own keyboard layout?  And that the pi comes with this layout (in my experience, 100% of the time) out of the box?  It's called the "GB" keyboard layout, which I understand to be shorthand for Good Bangers (and mash).  While the folks in "Great Britain" speak the King's English, for those of us in the colonies, know this: when you depress the space bar and go "off alpha" - you're in a twisted shadow-world of through-the-looking-glass proportions.  

So with a quick web search I found the appropriate system file to edit (can't remember offhand but I'll post it later) and changed "GB" to "US" so I could get things like my pipe [|] and hashes [#] and whatnot back to their rightful places on the keyboard.  Problem solved.  

So, on reboot of course, I found myself locked out of the pi.  I'm a little slow sometimes, so it took me a few minutes to realize that my password, which (I don't think I'm compromising my pi's security too much to say this on the internet) contains one or more particular non-alphanumeric characters, was not what I thought it was when I originally entered it with the GB keyboard layout.  So I had to go back and look at the GB keyboard layout on Google Images to find out which characters the characters I thought I was typing I was actually typing when I set my password.

So, the punchline is: if you are in the US, just go with the default password (or at least stick to alphanumeric) until you change the keyboard setup.  After you change the keyboard to 'US', go nuts with your 

pi@raspberrypi ~ $ passwd

Summary

So, as long as you don't shoot yourself in the foot like I did (minor detour), the setup is largely painless and for the most part foolproof if you follow the yellow brick road.  I'll post more on the setup of the peripherals (WiFi, webcam, thumb drive, etc.) later on.

(Photo by Silver Screen Collection/Getty Images)

No comments:

Post a Comment