Friday, April 18, 2014

Remote Control of Raspberry Pi's led

HTTP Server

The first part of the project is to configure an Http server. I follow this guide https://wiki.archlinux.org/index.php/LAMP.

I get a simple free dns server at http://dyndns.it/ and I configure ddclient to update my public IP (see http://ingignux.blogspot.it/2013/05/raspberry-pi-nas.html).

Electric Part

The electric part is very simple (I have the rev1 of the Raspberry Pi):

  • Ground (Pin 6)
  • 1st led: GPIO 17 (Pin 11, WiringPi 0)
  • 2nd led: GPIO 18 (Pin 12, Wiring Pi 1)
  • 3rd led: GPIO 21 (Pin 13, Wiring Pi 2)
This is the connections:


Control Part

In order to control the led remotely I need an HTML page that allows me through a simple browser to switch on and switch off my leds. The page is made with Bootstrap and Bootstrap Switch.

  • rasp.html: this file send to Raspberry the command to switch on and switch off the leds through a GET request to a php file;
  • control.php: this file catch the GET request and send to Raspberry the shell command through the WiringPi library.

This is the output of the html file.

Obviously there is a lot of bugs a security fall but for my home experiment is sufficient and in this way I can control my Raspberry in any place of the World!!!

Here there is a short video of my project.