Giter VIP home page Giter VIP logo

raspberryns's Introduction

raspberryNS

An information screen using the NS API designed as a small Raspberry Pi web app.

Imgur Imgur

Developed by vdveen. This local web app will fetch departure information from any NS station in the Netherlands and display it realtime in the browser.

Features:

  • Responsive web app compatible with all screen resolutions. Designed for the 320x480 Adafruit 3,5" TFT screen.
  • Displays up to ten train departures from any train station in the Netherlands
  • Updates every minute, with a loading bar indicating the next refresh
  • Displays departure time, departure platform, major calling stations and train type
  • Displays delays, changed platforms and non-NS operators flexibly
  • Can highlight trains that go to a specific destination
  • Can 'skip over' trains that depart in the next X amount of minutes
  • Official NS colors used

Installation guide:

The app runs on NodeJS and two NPM packages. Some Raspberry Pi's might need node-semver as a dependancy for NodeJS.

$ npm install

It also requires an API key. This can be obtained from https://www.ns.nl/ews-aanvraagformulier/.

Copy the .env-sample file to .env en edit all configuration:

  • Add your username and API key after the var username and var password. Make sure they are between quotation marks.
  • [Optionally] Change the station that you want information to be displayed from.
  • [Optionally] Change the 'timedelta' variable. Setting this to 5 will make the information screen skip over all trains departing in the next 5 minutes.
  • [Optionally] Change the highlighted station. A departing train is highlighted if its destination or route text contains the combination of letters defined here.

How to run: basically, run this file in the terminal using node. CD to the correct folder:

cd ~/[yourpath]/webapp

Then, run the ns.js file in Node: npm start

Then, open any web browser and go to 127.0.0.1:3000. Alternatively, you can run the command chromium-browser --kiosk --new-window to open the web app fullscreen.

If you want to have the server run when starting your Raspberry Pi, you can append a line of code to your rc.local file.

raspberryns's People

Contributors

vdveen avatar

Stargazers

Youri Roggeveen avatar Peter avatar  avatar Bastiaan avatar krettis avatar Mauricio Vargas avatar Le avatar Reid Cooper avatar David K avatar Matthew Salcido avatar

Watchers

Yop Spanjers avatar  avatar

raspberryns's Issues

can i create a pull request?

I've made some chances (mostly fixes) on your code and wanted to share a pull request. It seems that this repo doesn't have write access. Could you open it up so I can push a branch?

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.