Thursday, June 20, 2013

Initial Setup

For this post, I am assuming that you have a device to read and write from the SD card. I happen to have an onboard multi card reader in my Windows7 desktop. If you do not, you might need to buy a USB peripheral, or ask someone for help to make it happen.

The steps to get the Raspberry Pi running are:

1. Format the SD card (at least 4GB)
2. Write an operating system image to the card (I chose RaspBMC)
3. Boot the Raspberry Pi to test the loading of the OS
4. Start to install other hardware and software to your liking
5. Enjoy...

1. Format the SD card
I am on windows 7, so I used SDFormatter to format my card. If you do not already have a card that you can use, you can check the list to see what you should get.

2. Write an OS to the card
There are many articles out there on the googlewebs that compare and contrast the different OS options available to be run on the Raspberry Pi. Openelec, Raspbian with XMBC, RaspBMC and others. I am setting up my little machine to run in a van to replace a DVD player, so I went with RaspBMC.

Note that there are instructions on the Raspberry Pi site that point you to a new setup installer. I did not go this way, mostly because I was having power issues at the time and thought they were related to the OS setup. They were not, but by the time I figured that out, I had already installed RaspBMC. Caveat Emptor.

To write to the card, you need to:
Download an OS image. Choose the network image.
Download a tool to format the card and go ahead and format it.
Download a tool to write to the card and write the image to it.

At this point, you should have your SD card set up for an inital boot of the Raspberry Pi into RaspBMC.

3. Boot the Raspberry Pi
It was at this point that I had lots of issues arise. I booted the machine by plugging it in - there is no "on" switch anywhere. I was using the original NOOBs installer, but had also plugged in a wifi chip and a wireless keyboard. On top of that, I had a power supply that powered the lights, but pooped out when the other items came online.

Make sure that when you boot for the first time, you are hardwired to your network. The OS will attempt to download updates via the network connection. Do not try to do this with your wifi card as it needs to be configured before it can work - and SSH'ing into the Raspberry Pi will not work if it is not on the network.

Note: If your Raspberry Pi boots RaspBMC correctly you should get a nice logo screen soon after the power comes on. If not, you might see a "rainbow" test pattern, followed by some scrolling text, then a loss of signal. Then you would see the same thing again and again, in a loop. This was my power issue. Swapping out the power cable solved that issue for me - though lots of people point to a bad write of the OS, reformatting the SD card etc. Try the power first. I used a normal USB cable connected to an iPhone wall wart. Worked like a charm.

4. Start to Install other hardware and software to your liking
Once I had a stable boot sequence, I started to plug in more of the peripherals. I have a USB EDIMax Wifi card, and a FAVI mini keyboard. Both take up a single USB slot on the Raspberry Pi. I started with the mini keyboard. This seemed to work right out of the box. Since I had my power sorted, I was able to plug in the USB, restart the machine and everything worked.

Wifi was somewhat trickier. With the wired connection still in place, I SSH'd into the Raspberry Pi and installed the driver for the card. I used the following commands:

$ sudo bash
$ apt-get update && apt-get install firmware-realtek

To get the software for the card down to the Raspberry Pi. The first command opens a new bash session with root priveleges (or maybe its just admin priveleges, remember I am not a linux guy). Once you are working in a session that has those credentials, you can do the install.

After I installed the driver, I used the RaspBMC UI to pull down the Network Manager add-on program. Once network manager was down, I shut down the machine, swapped the cable for the wifi nic and restarted. I had to use the onboard keyboard to set up the wifi profile, but everything worked well at that point and I was on the network.

Time to load the machine with videos for the van.