May 29

Getting Started: Install your OS

In this post I will explain how to set up your Raspberry PI and get running using the recommended OS .

Items Required:

  1. Raspberry Pi
  2. Video or HDMI connector
  3. Network cable/wifi adaptor
  4. Monitor/TV
  5. 5V Power supply with Micro-USB B connector.
  6. Keyboard (Mouse if using GUI)
  7. SD Card – (Best to check for compatibility on http://elinux.org/RPi_SD_cards )
  8. Laptop or PC (To create initial image)

Firstly you will need to download the latest OS (At time of writing Raspbian Wheezy)  They can be found at http://www.raspberrypi.org/downloads

Once downloaded unzip to a “.img” file. This image can be burnt to a SD Card.

If you are using windows – http://sourceforge.net/projects/win32diskimager/  is a good tool to easily copy the image to SD Card. Download and run the win32diskimager software, select the drive letter (1) for your SD card IMPORTANT!!! you MUST get this correct as you may damage/corrupt other devices or data on your PC. Once correctly selected choose the “.img” file you previously unpacked and write (2) the file to the SD Card.

RPIE-DiskImager

You should now have a base install ready to start with the Raspberry PI.

It is worth reducing static risk and checking power is off – before touching the Raspberry PI (Or any electronic equipment)

<image>

Carefully connect the SD Card, Network cable or wifi adaptor, keyboard/mouse and video cable. Turn on the monitor and connect the power to the Raspberry PI.

<VIDEO>

after the boot up process has finished you can log in using the defaults –

Username: pi Password: raspberry

Firstly I would suggest setting the root (administrator) password –

sudo passwd root

This will prompt for new password (twice to confirm)

Logout using:

exit

Then log back in as the administrator. (root)

As everyone has the same default password – I would strongly recommend you change the default “pi” password using the same method:

sudo passwd pi

 

Once your internet connection is established –

The next step is to update the package repositories and update:

sudo apt-get update

Then

sudo apt-get upgrade

After downloading various packages and updates your PI will be ready for use.

to open a graphical desktop type:

startx

to further configure the Raspberry PI you can type

raspi-config

This gives you further options:

info                Information about this tool
expand_rootfs       Expand root partition to fill SD card
overscan            Change overscan
configure_keyboard  Set keyboard layout
change_pass         Change password for 'pi' user
change_locale       Set locale
change_timezone     Set timezone
memory_split        Change memory split
ssh                 Enable or disable ssh server
boot_behaviour      Start desktop on boot?
update              Try to upgrade raspi-config

one useful option here is to “expand_rootfs” This will expand the base image on the SD card to fill the entire available space.

 

 

 

May 28

Configure the LAN Network on your Raspberry PI

So you’ve powered on your PI and booted from the SD card. If you do not have any internet/network connectivity this may help…

you can check your network devices are installed and have a driver configured by typing the IP command:

ip link show

This will show all network interfaces currently connected to your PI. LO is the local host for internal IP traffic. eth0 is the on board RJ45 connector. wlan0 (if connected) is the USB wireless dongle. Your output should be similar to this:

root@raspberrypi:/# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT
 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
 link/ether b8:47:eb:33:24:53 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT qlen 1000
 link/ether 80:1f:49:ff:38 brd ff:ff:ff:ff:ff:ff
root@raspberrypi:/#

As long as eth0 appears on the list your on board network adapter is ready to be configured:

  1.  log into your Raspberry PI using the root account.
  2. At the prompt type:
cd /etc/network

then to edit your network interfaces type:

nano interfaces

check your network interface is configured correctly:

If you are using DHCP from your router: (The address is issued by your router- normally the default)

auto lo

iface lo inet loopback

iface eth0 inet dhcp

If you are going to fix the IP address you need something like:

auto eth0
    iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        gateway 192.168.0.254

You will need to modify the above IP addresses to match your current router configuration.

When you have finished configuring your interface you can exit out of “nano” (the text editor) by pressing CTRL+X  It will prompt to save changes.

Much more detail can be found on: http://wiki.debian.org/NetworkConfiguration

To restart the interface you type:

sudo /etc/init.d/networking restart

you can individually bring down interfaces using

ifdown eth0

and re-instate them with

ifup eth0

Once your network interface is up and running you can test it by issuing a ping command to your router:

ping 192.168.0.1

And to check you can get out to the internet a ping to a popular site:

ping www.google.com