Setting Up A Raspberry Pi

Lately I’ve been doing some projects with the Raspberry Pi. The Raspberry Pi is a small computer on a single circuit board using an SD card as it’s hard drive. I decided to share some of the things I’ve done with mine starting in this post with how I set up the operating system.

Note that there are different ways to install an OS on the Raspberry Pi as well as different OSes. I chose to install Raspbian, a variant of Debian Linux. In all cases an SD card is needed as that’s the storage mechanism.

First we’ll set up the SD card:

  1. Format a new SD card (minimum 4GB in size) as FAT. I used the Mac OS X DiskUtility (Erase” with “MS-DOS” format). Windows users can use the SD Association’s Formatting Tool. Be sure to set the “FORMAT SIZE ADJUSTMENT” option in the “Options” menu to “ON”.
  2. Download the latest version of NOOBS.
  3. Unzip the contents of the .zip file.
  4. Copy the contents of the .zip file to the root of the SD card. (This can be done using the dd command on a Mac or Wind32 Disk Imager on Windows.)

Now that our SD card is set up we’re ready to move over to the Pi.

  1. Eject the SD card from the Mac or PC and insert it into the Raspberry Pi.
  2. Set the Raspberry Pi up with an HDMI monitor, keyboard and mouse.
  3. Power up the Raspberry Pi.
  4. Once the Raspberry Pi has completed booting you will be in the NOOBS interface. Click the Raspbian checkbox and click the ‘Install’ button.
  5. When the confirmation pops up click the ‘Yes’ button. (This confirmation is warning you that any existing data on the SD card will be overwritten.)

Raspbian will now install. The progress bar at the bottom of the install dialog will let you know how far along the install process is. It may take a while.

When the install completes a dialog will appear letting you know your OS is installed. Click OK. The Pi will now re-boot, complete some housecleaning for the OS to run and launch the GUI for Raspbian.

Now it’s time to set up our WiFi adapter. This can be done either from the GUI or the command line. We’ll do this via the GUI since we’re already there.

  1. Click the Network icon in the taskbar and select your wireless network from the list that appears.
  2. Type your WiFi password into the dialog that appears and click the ‘OK’ button

Now we will set a few preferences:

  1. From the Menu select Preferences->Raspberry Pi Configuration.
  2. In the System tab change the ‘Boot’ preference from ‘To Desktop’ to ‘To CLI’. This will make the Pi boot to the command line without loading the GUI. (The GUI can always be loaded from the command line by typing ‘startx’.)
  3. Go to the ‘Localisation’ tab.
  4. Click the ‘Set Locale’ button, select your Language and Country and click the ‘OK’ button. A message will appear saying ‘Setting Locale’. Once this completes you can continue.
  5. Click the ‘Set Timezone’ button.
  6. Select your Area and Location then click the ‘OK’ button.
  7. A message will appear saying ‘Setting Timezone’. Once this completes you can continue.
  8. Click the ‘OK’ button in the ‘Raspberry Pi Configuration’ dialog.
  9. In the ‘Reboot needed’ dialog click the ‘Yes’ button to reboot. Upon rebooting you should be at the command line.

If things went correctly you should now have WiFi access. Type the following:
sudo ping
If you get a response then you have an internet connection. Hit CTRL-C to end the ping.

You should also have SSH functionality. To see if this is working do the following:

  1. From the command line type the following command and hit enter:
    This will show your current network configuration. Find your wireless connection (it will probably be wlan0) and find the ‘inet addr:’ setting (it’s probably the first setting on the second line).
  2. Now go to a terminal window on another computer (Terminal on Mac, Putty on Windows) and SSH to the IP address found in step 1 using the username pi and password raspberry.
    If you’re connected then you have ssh access to your Pi.

Now you’re ready for whatever else you want to do with your pi.

Tags: , ,

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.


No comments yet.

Leave a comment