Giter Club home page Giter Club logo

home-server-rpi's Introduction

Raspberry Pi Home Server

A small home server running on raspberry pi that has API end points returning the status for London public transport and air quality.

The status can be saved in a local file or read by a karotzRabbit saying hello.

The information is taken from Transport for London (TFL) and the air pollution index (aqicn.org).

This is my very first published piece of code on Github, so feel free to comment / correct anything I might have done that does not follow the standard etiquette.

System structure

System structure

Usage example

You can get the current status on the London tube: TFL full status

Or current readings of air quality around London: Pollution index

You can also ask your karotz to tell you the current status. You can find a short video of what the bunny actually says here Rabbit saying hello

Getting started

Prerequisites

  • SSH access to the raspberry pi. See here.

  • The raspberrypi hostname. It is raspberrypi by default.

  • Git installed: sudo apt-get install git. Full git setup here.

  • Python 3 installed. To check the Python version: which python

  • pip installed: sudo apt-get install python3-pip

  • Flask installed: sudo pip3 install flask

  • Config Parser installed: sudo pip3 install configparser

Setup

From the raspberry pi SSH session:

  1. Download the source code folder: git clone https://github.com/AdrienChenu/home-server-rpi

  2. Update to config.ini:

    • Karotz IP address
    • Token for pollution data: Get it from this website if you do not have one.
    • Save Path: Path where to save the pollution data, e.g. /home/impactik/aciqn_pollution_data
    • Feed Sensor: The location id from aqicn.com e.g. 5724 for London, UK.
  3. Start the server nohup python3 flaskServer.py &

Available end points

Public Transport

  1. TFL status for all lines: http://raspberrypi:5000/tfl/status TFL full status

  2. Line status: http://raspberrypi:5000/tfl/<line> TFL Piccadilly line status

  3. Ask the karotz to tell the transport status: http://raspberrypi:5000/tfl/askRabbit/<line> TFL rabbit says full status

Possible values for <line>: Bakerloo, Central, Circle, District, Hammersmith and City, Jubilee, Metropolitan, Northern, Piccadilly, Victoria, Waterloo and City, Overground, TfL Rail, DLR, Trams.

Pollution Index

  1. Current pollution index: http://raspberrypi:5000/aqicn/pollutionIndex Pollution index

  2. Save available pollution data: http://raspberrypi:5000/aqicn/SavePollutionData Full pollution index

  3. Ask the karotz to tell the pollution index: http://raspberrypi:5000/aqicn/askRabbit/pollutionIndex Full pollution index

home-server-rpi's People

Contributors

adrienchenu avatar

Stargazers

 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.