Git Product home page Git Product logo

popi's Introduction

PoPi

433mhz Raspberry Pi Python Light Webinterface. Needs linux. Development under Linux Mint Debian Edition.

Installation

Install WiringPi:

https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/

Install python-dev and python-setuptools:

sudo apt-get install python-dev python-setuptools

Install libev-dev:

sudo apt-get install libev-dev

Install python requirements:

sudo pip install -r requirements.txt

Install WiringPi-Python

sudo git clone https://github.com/WiringPi/WiringPi-Python.git
cd WiringPi-Python
sudo python setup.py install

Export Pin 17 for non root usage on boot:

sudo nano /etc/rc.local
Before line "exit 0". Replace "user" with your user. In my case "pi"
sudo -u user /usr/local/bin/gpio export 17 out

Restart your Pi:

sudo reboot

Nginx as proxy between external and the web server. It also servers the static file:

apt-get install nginx

If you are using nginx only for PoPi:

rm /etc/nginx/sites-enabled/default
nano /etc/nginx/sites-enabled/default

and paste:

server {
    listen 80;
    server_name localhost;

    root /path/to/PoPi;

    access_log /path/to/PoPi/logs/access.log;
    error_log /path/to/PoPi/logs/error.log;

    location / {
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        if (!-f $request_filename) {
            proxy_pass http://127.0.0.1:8000;
            break;
        }
    }
}

Reload nginx:

sudo service nginx reload

Serve with gunicorn:

gunicorn popi:app

Check out:

http://yourip

popi's People

Contributors

subay avatar

Watchers

 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.