HTML5: Best viewed in Mozilla Firefox.

This page will be moved to a new location: DCIUX

Header image


Simple Raspberry Pi PLC.

How to configure Raspberry Pi.

How to configure raspberry Pi.

Last modified: De Coninck Ivo

You need the following parts.
- Raspberry Pi Version 2.
- Micro USB Power Cable (+700mA). A micro USB cable or phone charger.
- Network cable/connection to the Internet.
- SDcard with Wheezy. We'll be installing the Raspbian "wheezy" Debian Linux distribution for Raspberry Pi.

First run.

Last modified:

We'll be using the Debian Raspbian "wheezy" Linux distribution.
The default username and password:
Username: pi
Password: raspberry
Make sure the SD card is inserted and the Pi is connected to the network.
Now connect the power.
Open a terminal window from a Ubuntu PC (ctrl-alt-t).

First displays the status of the currently active interfaces.
xxx@aspireI7:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:26:22:56:df:ea
inet addr: Bcast: Mask:
inet6 addr: fe80::226:22ff:fe56:dfea/64 Scope:Link
RX packets:48397 errors:0 dropped:0 overruns:0 frame:0
TX packets:40626 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:49765386 (49.7 MB) TX bytes:6254215 (6.2 MB)

Discover IP address of all devices on LAN network:
xxx@aspireI7:~$ sudo nmap -PR -sP
Starting Nmap 5.21 ( ) at 2014-02-18 15:39 CET
Nmap scan report for
Host is up (0.00038s latency).
MAC Address: 98:FC:11:9C:FB:23 (Unknown)
Nmap scan report for
Host is up (0.00049s latency).
MAC Address: 3C:4A:92:17:FF:72 (Unknown)
Nmap scan report for
Host is up.
Nmap scan report for docsite (
Host is up (0.00081s latency).
MAC Address: B8:27:EB:A1:D7:AE (Unknown)
Nmap done: 256 IP addresses (4 hosts up) scanned in 4.49 seconds

Address unknown to me, think this is the Raspberry Pi.
Using SSH to Connect to Raspberry Pi (standard user: pi):
sudo ssh pi@

Fig1. - First login from ubuntu desktop.


Updating and Upgrading.

Last modified:

The software on this Raspberry Pi has not been fully configured, run 'sudo raspi-config'.
pi@raspberrypi ~ $
Start 'sudo raspi-config'
pi@raspberrypi ~ $ sudo raspi-config
Click the option: Expanding the File System.

Fig2. - Raspberry Pi Configuration Tool.

Updating and Upgrading Debian Raspbian "wheezy".
Make sure you have an internet connection and run the following command. It may take a few minutes.
pi@raspberrypi ~ $ sudo apt-get update
Followed by:
pi@raspberrypi ~ $ sudo apt-get upgrade


Configure Network Settings on Raspberry Pi Hardware.

Last modified:

Set new hostname (your own choice):
pi@raspberrypi ~ $ sudo hostname mypi

Check new hostname:
pi@raspberrypi ~ $ hostname

Giving the Raspberry Pi a Static IP Address.
Example: (easy to remember).

Change text in /etc/network/interfaces
iface lo inet loopback
iface eth0 inet dhcp
iface lo inet loopback
iface eth0 inet static
Type in the Ubuntu terminal window:
pi@raspberrypi ~ $ sudo nano /etc/network/interfaces

This will bring up the network interface configuration file in the nano text editor.
sudo allows a permitted user to execute a command as the superuser or another user.
You see the following text:
auto lo

iface lo inet loopback
iface eth0 inet dhcp

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

Change this to IP details you got from ifconfig:

Fig3. - Nano text editor and /etc/network/interfaces.

Use Ctrl X to exit. Hit Y when prompted to save.
Now check your modifications!
Else you can not login to the Raspberry Pi from the Ubuntu machine via an ssh connection.
pi@raspberrypi ~ $ cat /etc/network/interfaces
Fig3. - View /etc/netwerk/interfaces.

Now reboot the Raspberry Pi.

Fig4. - Raspberry Pi terminal first reboot.

SSH connection to Ubuntu terminal is lost.
Connect again to the RPi via ssh:
ivo@aspireI7:~$ ssh pi@

Fig5. - Raspberry Pi second login.

Now your Raspberry Pi will always have the same IP address.

< Previous - - - Next >


Leave a Message.