Installing RaPiRo Web Control

Revision as of 13:46, 26 February 2015 by Hbk619 (talk | contribs) (Instructions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Back to RPi Guides.

RaPiRo Web Control for Raspberry Pi

RaPiRo robot

What does it do?

The RaPiRo robot is useless without means to controll it, this guide helps you to understand how it works and how to controll it with a webbrowser of your choise even wireless from a cellphone connected to the LAN via wifi.

What do you need?

  • A Rapiro robot
  • A Raspberry Pi, model B.
  • A boot SD card for the Raspberry Pi.
  • A network connection (WiFi if this is going to be usefull).
  • Special software on the Raspberry Pi that is free and gpl

What skill level is required?

This project does not require any coding or compilation even though some clue it good. Very basic Linux and networking knowledge would be useful, to set up the WiFi on the raspberry pi prior to this guide.

You need to...

  • Install software
  • Enter basic Linux commands
  • Use standard software tools to edit the settings on the Raspberry Pi
  • Connect computers using WiFi in a local LAN

How does it work?

This Guide helps you set up the internal Raspberry Pi in the RaPiRo robot to controll the robot via a Webserver hosted in it.

Overview of this project

You need to

  • Install Apache2 server software with friends for Serial and Python communication on the Raspberry Pi
  • Install the web server files that actually orders the RaPiRo what to do.
  • Connect to the RaPiRo over a network from your computer / cellphone to the Raspberry Pi in the head of the RaPiRo.


1. In order to use the Raspberry Pi’s serial port, we need to disable getty (the program that displays login screen) by find this line in file /etc/inittab

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
And comment it out by adding # in front of it
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

2. To prevents the Raspberry Pi from sending out data to the serial ports when it boots, go to file /boot/cmdline.txt and find the line and remove it

console=ttyAMA0,115200 kgdboc=ttyAMA0,115200

3. Reboot the Raspberry Pi using this command:

$ sudo reboot

4. Now, Install minicom

$ sudo apt-get install minicom
test it by issuing the following command:
$ echo "#PR255G000B000T050#PR255G000B255T050" | sudo minicom -b 57600 -o -D /dev/ttyAMA0
This should change colors of the eyes only.

5. Using Python programming language, you can make Raspberry Pi do many fascinating stuff with the RaPiRo when you are connected. Install Py-Serial first:

$ sudo apt-get install python-serial
$ sudo chmod 666 /dev/ttyAMA0

Now test it by saving this file as
import serial
import time
ser = serial.Serial('/dev/ttyAMA0', 57600, timeout=1)


Then run it form terminal issuing this command:
$ python
This should raise the left hand and strike it down again.

6. Install Apache2

$ sudo apt-get install apache2 libapache2-mod-python
$ sudo usermod -aG dialout www-data
Download the files that is needed for the webserver to handle the RaPiRo and copy them to the apropriate directories.
The python cgi script goes to /usr/lib/cgi-bin/:
$ wget
$ sudo chmod 755 /usr/lib/cgi-bin/
You should rename that file to but then you also have to change the reference in the code (line 103) to instead of as well.
The CSS syle sheet goes to /var/www/:
$ wget
The files for the icons should be extracted to the /var/www/ folder
$ wget
Then access the homepage from the webbrowser of your choise using the ip-address of the internal Raspberry Pi WiFi adapter.
depending on if you renamed the file or not.
depending on your apache setup you may need to use:


If you would like to make your RaPiRo robot totally mobile and not depending on your local LAN access point you can use the Raspberry Pi as a router and access the robot from your cellphone by connecting to that accesspoint, in that way you only need the RaPiRo and a wifi connected webbrowser to use it anywhere. Instructions how to do that you can read here

To learn about the RaPiRo protocoll and how it works in a more deep level, here are some useful links:

As a beta for CAM Stream I want to make a fast note: First install the Raspberry Pi Camera Web Server:

Then use the files in this archive to change some of the behaviour in the previously installed RaPiRo controll.

If you don't want it to shine read from the camera led in the head of the rapiro edit the /boot/config.txt and add: