Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

1,730 views

Published on

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

Published in: Self Improvement

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

  1. 1. Setup Raspberry Pi with Raspbian Get your Pi up and running Vicknesh Suppramaniam
  2. 2. 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.
  3. 3. 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.
  4. 4. 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
  5. 5. 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!!!
  6. 6. 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
  7. 7. 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
  8. 8. Configuring the Pi  Headless configuration  sudo raspi-config  Press enter.
  9. 9. 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.
  10. 10. Configuring the Pi  Internationalisation Options  Change Locale  Make sure en_US.UTF-8 is selected.  Choose en_US.UTF-8 as default locale.
  11. 11. Configuring the Pi  Internationalisation Options  Change Timezone  Asia->Kuala Lumpur
  12. 12. 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.
  13. 13. 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.
  14. 14. 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
  15. 15. 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" }
  16. 16. 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”.
  17. 17. Uploading files to Raspberry Pi
  18. 18. Uploading files to Raspberry Pi
  19. 19. You now have a working Raspberry Pi for your enjoyment. Have some cake 
  20. 20. Thank you for attending!!! Vicknesh Suppramaniam Contact : vicknesh@any6.asia

×