djaffry / oeffis-paper

Raspberry Pi based real time Vienna public transport and citybikes monitor using a triple color E-ink display. Get public transport information instantly, like being at a real station!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Öffis Paper

Raspberry Pi based real time Vienna public transport monitor using a triple color E-ink display
Get public transport information instantly, like being at a real station!

Öffis → austrian slang for public transport

Öffis Paper Standing

more pictures in the pics folder

⚠️ Unfortunately, my 7.5inch E-Ink display broke. So I cannot update this project anymore. Feel free to fork this project and tinker by yourself!

Features

  • Displays ÖBB and Wiener Linien public transport times, Citybike Wien station capacities and weather at a glance
  • Intuitive UI, see time, stations with their lines and weather on a 7.5 inch E-ink screen
  • Config file for easier configuring without changing code
  • Citybike Wien API for CitybikeWien station data, written in Python3
  • juliuste's oebb for getting the ETA of the upcoming ÖBB trains as a countdown in minutes
  • Wiener Linien API for getting the ETA of upcoming busses, trams or metros as a countdown in minutes, written in Python3
  • yr.no API for weather data, written in Python3

Hardware used

  • 640x384, 7.5inch E-Ink display HAT Model B (Red, Black, White) for Raspberry Pi → waveshare.com, amazon.com, amazon.at
  • Raspberry Pi Zero W with soldered headers or any Raspberry Pi 2 and up (tested with zero W and PI 3B+) → Raspberry Pi Website, conrad.at, or search at amazon.at.
  • Class 10 Micro SD Card with at least 8GB (16GB recommended) for the Raspberry Pi.
  • A typical 5V micro USB phone charger to charge the Raspberry Pi

Öffis Paper Wiring

Getting Started

1. Hardware Setup

  • Setup the Raspberry Pi. You can find a manual on how to and official images for Raspbian (recommended) at the Raspberry Pi Download Page.
    • If you wish to not use Raspbian, you have to do parts of the oeffis-paper setup later by yourself. These parts will be prompted to you.
    • If you choose the Raspbian image, the scripts/setup.sh script will later install all required dependencies, fonts and assets for you.
  • Assemble the Waveshare E-Ink Display and HAT as written in the waveshare manual and connect it to the Raspberry Pi. Since the HAT can be plugged directly onto the GPIO headers, this process should not be to difficult. Don't forget to activate the Pi's SPI!
  • Optionally print some case for the oeffis-paper hardware or use a picture frame. This is what I used: IKEA Ribba

2. Clone the repository:

Install git (sudo apt install git) and run the following code:

git clone https://github.com/djaffry/oeffis-paper.git ~/oeffis-paper

3. Configure config.json

An example config.json can be found in the root directory. Descriptions to the different key-value pairs can be found in the respective classes or here:

  • display (json) - display relevant configurations

    • renderOffset (int, optional) - corrects displayed time and minutes until arrival by this offset in minutes, counters display hysteresis
    • updateInterval (int) - the display will try to update every updateInterval seconds. due to delay, sometimes this is not possible
    • title (string) - title displayed in the upper left corner of display
  • stations (json) - station relevant configurations

    • avgWaitingTime (int) - time which is acceptable to wait for transport at a station
    • walkingTime (array[json]) - how long it takes to walk to a station
      • station (string) - station name to walk to
      • time (int) - how long it takes to walk to that station in minutes
  • api (json) - api relevant configurations

    • citybikewien (json, optional) - citybikewien configurations

      • updateInterval(int) - minimum of how long until the next API call should be made in seconds
      • stations (array[json]) - jsons with station ids and values
        • id (int) - id of station (see Citybike Wien Data)
        • rename (str, optional) - use this value instead of the api's station name
    • oebb (json, optional) - ÖBB configurations

      • updateInterval(int) - minimum of how long until the next API call should be made in seconds
      • connections (array[json]) - jsons of connections
      • rename (array[json], optional) - to rename stations
        • old (string) - old name to be replaced, so it can be merged by name with other stations
        • new (string) - new name to be renamed into
    • wrlinien (json, optional) - Wiener Linien configurations

      • updateInterval (int) - minimum of how long until the next API call should be made in seconds
      • key (string) - Wiener Linien API key (see Wiener Linien Data)
      • rbls (array[int]) - Array of rbls (Wiener Linien station ids, see below)
    • yrno (json, optional) - yr.no configurations

      • updateInterval (int) - minimum of how long until the next API call should be made in seconds
      • city (string) - name of the city (see YR.NO Data)
      • province (string) - name of the province (see YR.NO Data)
      • country (string) - name of the country (see YR.NO Data)

Citybike Wien Data (optional)

The Citybike Wien station names and id's can be extracted from CitybikeWien Liste. The id can be found left to the station's name. Example Station Rathausplatz: 110 RATHAUSPLATZ therefore "id": 110.

ÖBB Data

To get the necessary ÖBB Station IDs use djaffry/oebb-stations.

Wiener Linien Data

Important: You will need a Wiener Linien API Key to access the Wiener Linien API. They are free and you can apply for one using this form.

To get the RBL to your station, you have to look them up in the csv files at data.gv.at. By looking up your HALTESTELLEN_ID in csv-haltestellen and the LINIEN_id in csv-linien you can defer the right row for the RBL_NUMMER (rbl) in csv-steige.

Or have a look here: https://till.mabe.at/rbl/

YR.NO Data

To find the right city, province and country name, just search for your location at yr.no, go to the respective site of the city. Then use the parts after place in the URL for the values as country/province/city.

Example: Bischofshofen, AT https://www.yr.no/place/Austria/Salzburg/Bischofshofen/ Results in:

{
  ...
  "country": "Austria",
  "province": "Salzburg",
  "city": "Bischofshofen"
}

4. Install dependencies

A setup.sh script can be found in the scripts directory. Running it will resolve all dependencies. setup.sh will also fix the waveshare libraries imports and some arithmetic errors in the waveshare library using patches which can be found in the patches subdirectory. You can run ./setup.sh anytime again to update dependencies, fonts and assets.

cd ~/oeffis-paper/scripts
./setup.sh

5. How to run and stop

Further two scripts can be found in scripts:

  • Use ./start.sh to run in background. This process does not get killed when closing the ssh connection used to start the process.
  • Use ./kill.sh to kill the current background process.

About

Raspberry Pi based real time Vienna public transport and citybikes monitor using a triple color E-ink display. Get public transport information instantly, like being at a real station!

License:MIT License


Languages

Language:Python 83.8%Language:Shell 15.8%Language:JavaScript 0.5%