raspberry jam 1 - setup raspberry pi with raspbian -vick nesh

20
Setup Raspberry Pi with Raspbian Get your Pi up and running Vicknesh Suppramaniam

Upload: te4p

Post on 02-Dec-2014

387 views

Category:

Self Improvement


3 download

DESCRIPTION

For the Hands On section held at the first Raspberry Jam Penang in Penang Science Cluster/Cafe

TRANSCRIPT

Page 1: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Setup Raspberry Pi with

Raspbian Get your Pi up and running

Vicknesh Suppramaniam

Page 2: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Requirements

Hardware

Raspberry Pi Model B or B+.

5V 1A power adapter.

Micro USB cable for power.

Ethernet cable.

MicroSD card adapter.

SD Card reader.

Page 3: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Requirements

Software

Raspbian image

Download from Raspberry Pi website

Direct download URL

http://downloads.raspberrypi.org/raspbian_latest

Windows

Win32Diskimager

Putty

Network Scanner

Nmap

SoftPerfect Network Scanner.

Linux

Most tools already installed.

Install nmap separately.

Page 4: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Let’s get started

Writing the image to an SD card.

Windows

Launch Wind32Diskimager with Administrator privileges.

Right click -> Run as Administrator

Choose the file 2014-06-20-wheezy-raspbian.img

Make sure the SD card drive is selected.

Click write. 1 2

3

Page 5: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Let’s get started

Writing the image to an SD card.

Linux

Identify where the SD card is attached

tail –f /var/log/syslog

tail –f /var/log/messages

fdisk –l

Result will be something like /dev/sdX

Make sure you get the right one, otherwise you can destroy your entire partition.

Begin writing (do the following as root)

dd if=/path/to/raspbian/2014-06-20-wheezy-raspbian.img of=/dev/sdX bs=4M

Make sure /dev/sdX is where the SD card is attached.

To monitor the progress, you can do the following as root

ps ax | grep dd – get the PID of dd

watch –n5 kill –USR1 <pid of dd>

Wait!!!

Page 6: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Plug the Pi into the network.

Turn on the power for the Pi.

Wait a minute or so.

Windows

Launch SoftPerfect Network Scanner.

Enter your Network Range.

Press Ctrl+Enter to begin scan.

Linux

Nmap –sP <network range>

Nmap –sP 192.168.1.0/24

If no scanner available, wait another minute and try

arp -a

Identify the IP address of the Raspberry Pi based on the MAC address.

Raspberry Pi MAC address starts with B8:27:EB

Page 7: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Headless configuration

Putty

Enter the IP address of the Pi. Default port is 22.

Linux

ssh pi@<ip address>

Default username – pi

Default password – raspberry

Page 8: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Headless configuration

sudo raspi-config

Press enter.

Page 9: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Expand the filesystem.

Makes Raspbian use all the space on the SD card. Needs reboot.

Change user password

Change the default password. Don’t forget it.

Enable Boot to Desktop/Scratch

Choose which environment Raspbian boots to. Default is console.

Page 10: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Internationalisation Options

Change Locale

Make sure en_US.UTF-8 is selected.

Choose en_US.UTF-8 as default locale.

Page 11: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Internationalisation Options

Change Timezone

Asia->Kuala Lumpur

Page 12: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Configuring the Pi

Enable Camera

Choose this if you are going to use the Raspberry Pi camera or the Raspberry Pi NoIR camera.

Overclock

Choose modest. No overvolting required.

Advanced Options

SSH enabled by default now.

Change hostname to something else.

Change memory split.

I choose 32 for server ONLY without GUI.

Update

Update this tool to the latest version.

Page 13: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Post configuration

sudo apt-get update ; sudo apt-get safe-upgrade –y

Update Raspbian to apply any patches or security updates.

Reboot after doing this.

sudo rpi-update

Downloads the latest firmware.

Reboot after doing this.

sudo apt-get install avahi-daemon

Allows you to access your Raspberry Pi using hostname.local instead of remembering the IP.

Useable on all Linux, OSX and Windows machine with Bonjour service.

Page 14: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Advanced Configuration – Setting static IP Servers need static IP.

How?

sudo nano /etc/network/interfaces

Ctrl+X to quit and save. Enter “y” and press ENTER.

sudo nano /etc/resolv.conf

Ctrl+X to quit and save. Enter “y” and press ENTER.

Reboot.

iface eth0 inet static address <ip address here> netmask <netmask here> gateway <gateway IP address here>

nameserver 4.2.2.3 nameserver 128.199.248.105

Page 15: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Advanced Configuration – Configuring Wireless from CLI

Plug your wi-fi dongle to the Raspberry Pi.

Make sure it is detected and recognized.

sudo iwconfig

Make sure there is a wlanX interface listed.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Ctrl+X to quit and save. Enter “y” and press ENTER.

Reboot.

network={ ssid=“YOUR_SSID" psk=“YOUR_PASSWORD" }

Page 16: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Uploading files to Raspberry Pi

Download and install WinSCP

http://portableapps.com/apps/internet/winscp_portable

Launch WinSCP and enter the following information

IP address of the Raspberry Pi.

Port number of SSH (default 22).

Username – pi

Password – raspberry (default)

Click “Login”.

Page 17: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Uploading files to Raspberry Pi

Page 18: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Uploading files to Raspberry Pi

Page 19: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

You now have a working Raspberry Pi for your enjoyment.

Have some cake

Page 20: Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh

Thank you for attending!!!

Vicknesh Suppramaniam

Contact : [email protected]