Coder Social home page Coder Social logo

stevemuller04 / stau.lu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 245 KB

stau.lu is a program for the Kniwwelino that visualises the traffic situation for the highways around Luxembourg-City.

License: MIT License

JavaScript 19.46% C 4.63% C++ 75.92%
kniwwelino traffic-information luxembourg-city luxembourg traffic-jam traffic-situation

stau.lu's Introduction

stau.lu

stau.lu is a program for the Kniwwelino that visualises the traffic situation for the highways around Luxembourg-City.

Example visualisation of traffic

Use

After the program has been flashed to the Kniwwelino, the latter only needs to be powered. Whenever it boots up, it tries to connect to the previously set up WiFi network. If it fails, the RGB LED will flash in blue, and a WiFi access point called "stau.lu" is set up. The user needs to connect to the latter with his mobile phone or laptop, and configure WiFi.

If WiFi connection succeeds, the Kniwwelino automatically retrieves the latest traffic information from a server (this may take a few seconds). After a while, the traffic situation for the first highway section will be displayed (see below).

Button A can be used to cycle through the following 7 sections of the highway around Luxembourg-City:

  • Belgium ↔ Croix de Cessange (highway A6)
  • Esch ↔ Croix de Cessange (highway A4)
  • Croix de Cessange ↔ Croix de Gasperich (highway A6)
  • France ↔ Croix de Gasperich (highway A3)
  • Croix de Gasperich ↔ Kirchberg (highway A1)
  • Kirchberg ↔ Germany (highway A1)
  • Mersch ↔ Kirchberg (highway A7)

Button B toggles the direction. For instance, when "Belgium ↔ Croix de Cessange" is displayed, button B can be used to toggle between the traffic information for "Belgium → Croix de Cessange" and "Croix de Cessange → Belgium".

The RGB LED is used to display the traffic status. It can be one of the following 4 colours:

  • Green: fluent traffic, or no information
  • Yellow: some traffic jam (delay ≥ 3 min)
  • Orange: traffic jam (delay ≥ 7 min)
  • Red: severe traffic jam (delay ≥ 15 min)

Installation

Before you can use stau.lu, you will need:

To install stau.lu onto a Kniwwelino, do the following:

  • Download or clone this repository to your computer.
  • Open the ./handheld/handheld.ino file with the Arduino IDE.
  • Make sure to the Kniwwelino is connected to your computer. Make sure the correct port is selected in the Arduino IDE menu "Tools > Port".
  • Click "Upload" to compile and flash the program to your Kniwwelino. This may take several minutes.

The stau.lu agent

In addition to the stau.lu program for the Kniwwelino, this project contains the source code of the stau.lu agent. The agent is responsible for retrieving the traffic information from Google Maps, and pushing it to a server where the Kniwwelino can easily retrieve the information.

A stau.lu agent is already running that regularly pushes the latest traffic information to the default Kniwwelino server at broker.kniwwelino.lu:1883. Average users do not need to set up an agent on their own, unless they want to become independent from the latter server. Note that you will need a (free) API key to access the Google Maps API.

The agent is written in Javascript, and can be run using the latest version of NodeJS. To install the agent, do the following:

  • Request a (free) API key for the Google Maps Distance Matrix API at https://developers.google.com/maps/documentation/distance-matrix/.
  • Download or clone this repository.
  • Open the ./agent/ folder and run npm install to install all dependencies.
  • Open ./agent/default.json and specify the API key in googlemapsapi → key. You can also change the server connection configuration here.
  • Run npm start or node app to launch the agent.

The agent will run only once. If you want to continuously push traffic information to a server, consider using a cron job or similar. Caution! The Google Maps API limits the number of requests (at the time of writing: 2,500 requests per day), so make sure that the agent is not run too often.

License

This project is licensed under the MIT license. That means you are free to use and modify this project as you like, as long as you mention the original author(s).

stau.lu's People

Contributors

stevemuller04 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.