Raspberry Pi


Right, here goes some comments and stuff so far.....

Please note that these are really just rough notes, made mostly for me but happy to share.

First Time Use

One tip that I missed is that when you first use your Raspberry Pi it is strongly recommended that you issue "sudo halt" when you have finished to turn it off rather than just pulling the power out. This is because on the first boot you will set some options, so a clean shutdown is best.

The default login credentials are as follows:
Username: pi
Password: raspberry
It is always recommended that you change default passwords to something else.

After logging in the command startx will load the GUI.

Date and Time

Do plug a network cable in with internet access as the Pi uses this to get the current date/time. The decision to leave a clock off was down to cost, hence it is assumed that if there is no network you will set the date/time manually.

Sound over HDMI

We found that sound did not work. This was when we connected the Raspberry Pi up to our Sony television. So, to fix that we did this:
  • boot up your RaspberryPi
  • login
  • type this: sudo nano /boot/config.txt
  • find the line with "hdmi_drive" in it and uncomment it, so you have "hdmi_drive=2"
  • exit nano and save your changes: Ctrl+X, Y, Enter
  • type this: sudo reboot
  • after the reboot type: startx
  • sound should now be working

Oh and yes, this did work!

Which Pi have I?

Firstly it is important to note that there are now two major Raspberry Pi models, there is Model A and Model B. Most people own a Model B, as this has an ethernet connection. The Model A has no ethernet connection and is not in full production yet. So from here on, I am talking about the Model B.

There are two revisions of the Raspberry Pi, so far. The quick and simple way to tell is by looking at the board. If it has holes for screws to mount the board then it is a Revision 2 board, no holes means Revision 1.

However the technical way to which revision you have is to perform the following command from a terminal session: cat /proc/cpuinfo
If the "Hardware Revision Code" is 3 or lower you have a Revisions 1 board, 4 to 6 then you have a Revision 2 board, if it is 13 or 14 then you have a Revision 2 board with 512Mb of RAM. If you see any other numbers then please let me know and I can update this page.

There is also a second difference, early boards have 256Mb of memory, latter boards have 512Mb. Again visual inspection allows you to tell the difference. Find the large Samsung chip roughly in the middle of the board, this is the memory chip, the Broadcom processor is actually underneath! Under the word Samsung will be some letters and numbers, 2G means it is 256Mb and 4G means 512Mb. It is to do with Gbits, if you must know.

Changing your Password

One thing you probably want to do is change the password on your RaspberryPi as everyone has the same password for the pi user. So, execute the following steps:

  • Start your RaspberryPi
  • Login as the pi user
  • Type the following: passwd
  • Enter the current password (default is raspberry)
  • Enter your new password
  • Enter the new password again
The change should be made now.
If you prefer you can change your password with the Raspberry Pi config utility. At a terminal prompt enter the following: sudo raspi-config

Media Codecs

In order to keep costs down there are a number of things the Raspberry Pi does not have, an RTC being one of them. However this is easy to work round, just use NTP on startup, assuming you have an internet connection of course. Anyway, something else that could have been added but was not was a license for some media file codecs. The good news is that these are available, for purchase, from the Raspberry Pi shop, should you want them. A good article on this with some handy links is The Digital Lifestyle - Decoder Options for Raspberry Pi.

Updating Your Raspberry Pi

You need to execute the following:

sudo apt-get update
sudo apt-get upgrade

The second command will take some time to execute, so allow an hour or so. I find it better to think it will take longer than it does.

You can combine the two commands into one single line, allowing you to leave it all running for a while, the single line is this:
sudo apt-get update && sudo apt-get upgrade

However, for a full blown new version of Raspbian you will need to do a little more, as follows:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install raspberrypi-ui-mods

These instructions are from a release in December 2014. I noticed that after this there were some packages that could be removed, so just for completeness this can be done as follows:
sudo apt-get autoremove

Configuring your Raspberry Pi

First off it is recommended you complete the section on "Updating Your Raspberry Pi" first. Then execute the config utility as follows: sudo raspi-config Scroll down and select "update", once this is done use "Finish", if it wants to reboot then do so. Launch the config utility again and off you go!
It is also worth looking at /boot/config.txt which holds various settings. This file can be used for setting the memory split on recent builds.
There is documentation available on raspi-config here. Oh and "free -h" will display current memory usage, this will actually tell you what your memory split is, assuming you can do maths!

Trouble booting your new Pi

If you have a new Raspberry Pi, or even an old one, then make sure you have the latest version of Raspbian, the Pi's Operating System. You can download the latest version from http://www.raspberrypi.org/downloads. If you want some further information on this issue then please read http://www.raspberrypi.org/archives/3534.

BBC iPlayer

Well, if you fancy running this on your RaspberryPi then take a look at Get_iplayer Raspberry Pi Update » RasPi.TV for details.

If you can't get this working then note that you need a lot of free space to download and then process for viewing an hour long programme in HD, so try a short 10 minute children's programme first as a test. If you do run out of space you will get an error message about processing the MP4 file and then omxplayer will just not work and it does not display a helpful message either! You will either need external storage or an SD card bigger than 4GB. Another point to note is that you need to start the GUI with startx and then run a terminal session, executing omxplayer from there. Oh and you do not need to purchase the MPEG-2 codec license for this to work.

Formatting a USB drive

If you want to format a USB drive to work on your RaspberryPi, PC and Mac then follow the instructions at Formatting and Mounting a USB Drive from a Terminal Window | The Pi Hut for how to do it.