I like Raspberry Pi

Hello World,

This post is about the Raspberry Pi.  I recently received mine from RS Components, and have been learning how to set it up.

This post has been revised a number of times. With each time I setup a new Raspberry Pi, I learn more!

Unbox!

First take your RPi out of the package.  Be careful when doing this, because the shipping box can be used as a cheap case.

Prepare your SD card.

I would buy as big and fast of card as you can afford.  I purchased a 4Gb card, but ran out of room before I loaded everything I wanted.  I now have a 32Gb SDHC card from SanDisk that appears to be working well. It is important to get a fast card, look for a circle with a “10” on the front. You can find cards with a “4” or even a “1” that are cheaper. You will not be as happy with these.

Figure out which Linux distribution you want to use.  I am using Debian and it is very easy.  It worked out of the box. At the time of this writing I used

2015-02-16-raspbian-wheezy.zip

Follow the instructions to copy the distribution to your card. On OS X, you can verify the download by using the command:

openssl sha1 [<em>full path to file</em>]

Once you have created your SD card, pop it in, power up the Pi and see what happens!  (You’ll need to go ahead and connect it to a monitor and keyboard).  You should see the pi booting up.  By default it goes into the raspi-config utility.  You can use this to expand your filesystem.  If you have a card that is greater than 4 GB, you will want to do this before anything else.

Keyboard, video and mouse.

I have used a wireless Logitec keyboard mouse combination. I’ve also used a simple wired Logitech K120 USB keyboard.  With both, Debian detected the keyboard and mouse with no problems.  I’ve used a flatscreen TV with HDMI and an old CRT TV with video only input.  The CRT is okay, but it cuts off the edges of the screen, so you can’t see what is in the first column of text.  Its possible to use, but difficult.  The flatscreen with HDMI was much easier to use.

If you do not have a UK keyboard, then run the command

raspi-config 

to change your keyboard configuration.

Expand the file system

When the pi first boots, it boots into the raspi-config menu. You can use this to expand the filesystem to use your entire SD card. This only takes a few seconds to do, so you probably want to do this before you do much else.

Set your password

I would recommend changing the default pi user password.

Network

Configure your network interface You can either hardware the RPi to your router, or setup WiFi.  Here is my /etc/network/interfaces:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR_SSID_HERE"
wpa-psk "YOUR_PSK_HERE"

Reboot and you should have a working WiFi connection.

$ sudo reboot

At this point, I also like to change the hostname:

$ sudo hostname your_new_hostname

Update and Upgrade

$ sudo apt-get update
$ sudo apt-get upgrade    

SSH

Set up SSH If you are like me, you probably want to access the RPi from another computer.

Here is a video that shows how to set up SSH on Raspberry Pi with Debian.

NAS

Set up NAS I found it was easier to download some stuff using my Macbook rather than the Raspberry Pi command line (i.e. wget).  So, I needed an easy way to get things onto my Pi.  For that

I followed these instructions to setup Network Accessible Storage on the Pi.

Get Stuff!

You can use apt-get to install software on your RPi.  I first ran

sudo apt-get update

After that, I installed the following:

sudo apt-get install vim
sudo apt-get install git
sudo apt-get install subversion
sudo apt-get install ruby

My plan is to use the RPi as a webserver, so I also

installed Node.js using these instructions. I also tried installing mongodb using the instructions here.  However, on the RPi, I would get an error:

root@raspberrypi:/home/pi# git clone https://github.com/skrabban/mongo-nonx86
Cloning into mongo-nonx86...
remote: Counting objects: 111077, done.
remote: Compressing objects: 100% (28293/28293), done.
fatal: Out of memory, malloc failed (tried to allocate 168493056 bytes)
fatal: index-pack failed

Instead I used wget to download the zip file.

Step 8,

Have fun! This has been a short introduction on how to set up a Raspberry Pi.