Setting up my Raspberry Pi

This guide shows the basic steps i performed to get my Raspberry Pi model B running. The steps are applicable to every distribution i use; and are kind of basic for me to perform.

 

First thing to do is to make sure full SD card is used. If you are not using Raspbian Wheezy you have to perform the following steps;

 

Power on the RPi, login & become root.

fdisk /dev/mmcblk0
  p (note starting sector of /dev/mmcblk0p2)
  d
  2
  n
  p
  2
  (enter starting sector of /dev/mmcblk0p2) [enter]
  -1 [enter]
  W
shutdown -r now

 

Reboot your RPi & login.

sudo resize2fs /dev/mmcblk0p2

 

If you are using Raspbian Wheezy the raspi-config tool is run after the first boot; you have to make sure the following tweaks are done;

  • Expand the root filesystem to fill the SD card
  • Configure the keyboard layout (Set it to “US” for double quotes to work)
  • Set the password for the ‘pi’ user (optional)
  • Configure the locale
  • Configure the timezone
  • Change the CPU/GPU memory split
  • Enable SSH
  • Change the hostname

After the above steps; we can setup the WiFi adapter, in my case the Asus N10 Network Adapter. First step is to check to see if the Asus wifi module is found;

lsusb

 

Should give back something like

Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]

 

Edit interfaces file

sudo cp /etc/network/interfaces /etc/network/interfaces.bak
sudo nano /etc/network/interfaces

 

Make sure following lines are there

allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Save it using Ctrl+X

 

Append SSID & PSK

sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.bak
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

 

Make sure following lines are there

network={
    ssid="<your SSID>"
    scan_ssid=0
    psk="<your PSK>"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
}

Save it using Ctrl+X

 

Reboot your RPi, login & become root.

 

Verify WiFi connection

ping www.google.com

 

Enable Dutch NTP servers (http://www.pool.ntp.org/zone/nl)

sudo nano /etc/ntp.conf

 

Change servers to following:

server 0.nl.pool.ntp.org
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.nl.pool.ntp.org

 

Verify new date/time

sudo service ntp restart

 

If incorrect, make sure TimeZone is set properly

sudo cp /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

 

Ntpdate will run when an ethernet interface is brought up, and set the time from an ntp server

sudo apt-get install ntpdate

 

Update distro

sudo apt-get update
sudo apt-get dist-upgrade

 

6. Make sure the RPi stays in sync with latest security updates

sudo apt-get install unattended-upgrades

 

add to /etc/apt/apt.conf.d/10periodic the following:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

Now your system keeps itself up-to-date automatically.

 

Update RPi

sudo apt-get install ca-certificates git-core
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
sudo ldconfig
sudo reboot

 

Done.

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply