Part1: Environment Setup  <-- You are here

Part2: Monitering Temperature with Xtrinsic Sensor

Part3: Capture sensor data to database ..

Part4: Remote datalogger


Before we start we need to update the OS on Riotboard to get all up-to-date libraries.

The official Riotboard BSP has an Ubuntu 11.10 and needs to be updated.


Run the below command to check Ubuntu distro details:

# cat /etc/lsb-release





DISTRIB_DESCRIPTION="Linaro 11.10 (development branch)"


We need to update the ubuntu debian packages resource details.

We will use apt-get later to install packages from these sources.


copy/paste the below in terminal.

cat <<EOF >> /etc/apt/sources.list

deb oneiric main restricted universe multiverse

deb oneiric-updates main restricted universe multiverse

deb oneiric-security main restricted universe multiverse



the above will setup the sources that point to ubuntu 11.10  repository.



Next Install aptitude to proceed with upgrade:

sudo apt-get install aptitude


Performing an update on existing packages

sudo aptitude update

Setting the correct time

sudo ntpdate -s


again checking for the updated ubuntu details:

# cat /etc/lsb-release







The oneiric has been updated to a newer linaro release.


Once the BSP is updated we can proceed with install new packages.


We will start the  setup by installing web server , database and web development tool.


We consider below softwares:

Apache    :  A http web server that can fetch and display webpage in browser.

MySQL    :  An Open Source database management system through  which we can store and retrieve data using SQL queries.

PHP         :  A programming language we use to develop webpages.


I will install the packages one-by-one with explanation for better understanding.


Installing apache:

sudo apt-get install apache2

this will install apache2.

the config files are located at /etc/apache2/apache2.conf and httpd.conf.

the root web directory is /var/www.

detecting ip address of Riotboard .

ifconfig eth0 | grep 'inet addr:' | cut -d ':' -f2 | cut -d' ' -f1


To test your installation, navigate to below link in your web browser.




Verify Apache Server on Riot:

Incase you are editing any apache config files.

  1. shutdown the server : /etc/init.d/apache2 stop
  2. edit config files.
  3. restart apache:   /etc/init.d/apache2 restart

Installing MySQL:

sudo apt-get install mysql-server mysql-client

This will install mysql server and  a client.

during installation it will ask for root pasword for mysql server,  this is to secure  privileges for root user.

we will do more setting later when we will setup databases later.



Installing PHP:

installing the php libraries and the php module for apache2

sudo apt-get install php5 php5-mysql libapache2-mod-php5 php5-cli



Verifying the  php installation

through command line

# php -r 'echo "PHP is working\n";'

PHP is working



through browser

execute in terminal:

echo "<?php phpinfo(); ?>" > /var/www/test.php



open link in browser:


The above will provide you with a lot of information and the php version.


With this we completed our initial setup of the required softwares .
Next time we will integrate a temperature sensor with RIoTboard .