Skip to content

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

Notifications You must be signed in to change notification settings

AdrienChenu/home-server-rpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages