Coder Social home page Coder Social logo

web-pins's Introduction

web-pins

This is a simple interface for reading and controlling the GPIO pins on the Raspberry Pi

There are a few steps needed.

Installation

Install LAMP

sudo su

apt-get update && apt-get upgrade

apt-get install apache2 php5 mysql-client mysql-server tomcat6 vsftpd

cd /var/www

Install GPIO Python library

wget http://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.1.0.tar.gz

tar zxf RPi.GPIO-0.1.0.tar.gz

cd RPi.GPIO-0.1.0

sudo python setup.py install

While in the www directory clone the web-pins folder

git clone https://github.com/TheGreenToaster/web-pins.git

In order to allow the PHP to use the Python scripts the PHP user needs to be added to the sudoers file.

To enter the sudoers file use the command

sudo visudo

Next add the fallowing line to the end of the file and save it

www-data ALL=(ALL) NOPASSWD: ALL

Usage

In order to read the 0 pin the url is.

raspberrypiaddress/pi-read.php?pin=0

Simply replace the "0" with and number 0-7 to read that pin.

In order to set the value of pin 0 to high the url is.

raspberrypiaddress/pi-write.php?io=1&pin=0

To set value to low change

io=1

to

io=0

The "raspberrypiaddress"should be changed to the IP address of your pi.

web-pins's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.