Saturday, June 9, 2012

The first few things I did to my Raspberry Pi...

I got my Raspberry Pi ("RPi") on Tuesday, 29-May-2012.  Being a Ubuntu user, my first choice of Linux distro for the RPi was naturally the Debian Squeeze build dated 19-Apr-2012. I downloaded the image from URL http://www.raspberrypi.org/downloads

Using an old Toshiba 8GB SD card (class 4), I burned the image using the dd command from my Ubuntu laptop. You can check from the RPi's Wiki page at URL http://elinux.org/RPi_Easy_SD_Card_Setup for how to best burn the image for your setup.  For me, I simply typed:

sudo umount /dev/sdx
sudo dd bs=1M if=debian6-19-04-2012.img of=/dev/sdx

Note: /dev/sdx should be the device designated by your Linux installation and varies from computer to computer.

Using the gparted utility, I expanded the 2GB partition the Debian image was built upon to the maximum available space of my SD card (in my case, it was expanded to a 7.5GB partition).

I then inserted the SD card into the RPi, followed by the HDMI, USB keyboard/mouse, and NIC cables and then proceeded to plug in power into the board.  Once the RPi booted up, I logged in into the image using the default credentials (pi / raspberry) and immediately did the following:

sudo su
apt-get update
apt-get -y upgrade

This updated all the packages in the build to the latest components ensuring any bugs found since the build was made will be addressed and updated in my setup.

Finding the console screen rather too small, I decided to change the screen resolution from 1920x1080 to 1280x720.  I read the following Wiki at URL http://elinux.org/RPi_config.txt and created a config.txt file in the /boot directory. I then typed in the following into the file.

hdmi_mode=4


Restarted the RPi and screen was so much easier to read.

Wanting to update the RPi's kernel and firmware can be done with the rpi-update utility found at URL https://github.com/Hexxeh/rpi-update.  The easiest way to install rpi-update is to type in the following (as root):

wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && chmod +x /usr/bin/rpi-update

You will also have to install the following libraries before the rpi-update command will work properly.  The libraries can be install by typing:

sudo apt-get install ca-certificates git-core

I then ran the tool by issuing the command:

sudo rpi-update

This took quite a while (about 20 minutes) and the rpi-update tool mentions "a few minutes".  I believe rpi-update was busy downloading from an external site (no indication of this when running the tool).

However, during the update, I got an error message saying:

/opt/vc/sbin/vcfiled: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory

If you ignore this error message and restart the RPi, it will not boot-up from your SD card and proceed to "hang" the RPi.  To fix this problem, you will need to type in the following command:

sudo ldconfig

and re-run the rpi-update tool with the command:

sudo rpi-update

This time, there should not be anymore error messages and it would be safe to restart the RPi with the command:

sudo shutdown -r now

If you want to get the audio working on your RPi (it's disabled by default), you will need to install the ALSA utilities by typing:

sudo apt-get install alsa-utils

You will also need to get the kernel to load up the sound library kernel module, this can be done by editing the /etc/modules file.  You will can edit the file using vi by issuing the command:

sudo vi /etc/modules

At the bottom of the file, add in the following:

snd_bcm2835

You then save the file and quit vi.  If you are not familiar with vi, you can also use nano and simply replace the command above from vi to nano.

I also wanted to set a password for the root account (yes, there are security concerns doing this but I did it anyway) and accomplished this by typing the following:

sudo su
passwd root

The pi account also uses a known default password (raspberry), you can change it by typing in:

sudo su
passwd pi

WARNING: The section below is not necessary to do on your RPi but is something that I did to my RPi board.  You may void your warranty by doing the below.  Do not do the following if you are not familiar with tweaking or over-clocking the RPi and I will not be liable for anything bad that happens to you or your RPi.

Even with the latest updates from Debian, I noticed the RPi was rather slow for a 700MHz beast (even after considering the fact that the 2D library has not gotten any hardware acceleration and was all done by the CPU).  I read the following Wiki at URL http://elinux.org/RPi_config.txt and updated my config.txt file in the /boot directory.

The config.txt file contained the following lines:

hdmi_mode=4
arm_freq=900
gpu_freq=350
sdram_freq=500

This configures the RPi CPU to run at 900MHz, the GPU at 350MHz and sets the SDRAM FSB to 500MHz.

Booted up the RPi again and the RPi was noticeably faster!

Hope this helps! Feel free to comment and offer alternate solutions.

Wednesday, February 29, 2012

Just ordered my Raspberry Pi Model B

Just ordered my Raspberry Pi Model B from Farnell via their Malaysian website at:

URL http://my.element14.com/raspberry-pi/raspbrry-chipset/chipset-raspberry-pi-model-b/dp/2081185

Been told that the first 10,000 units have been sold out and it'll take 3 to 5 weeks for my order to reach my doorstep.  If you are like me and can't wait to try the unit, you can always download the Debian SD card image first while waiting.  You can get the image from the official site at (may be down until at the moment as the site is being swamped by enthusiast interested in ordering the board):

URL http://www.raspberrypi.org/downloads

Or you can try from Farnell's own website at:

URL http://downloads.element14.com/debian6-17-02-2012.zip