Git Product home page Git Product logo

pezholio / bicycle-barometer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richardjpope/bicycle-barometer

0.0 2.0 0.0 184 KB

The bicycle barometer takes data about the weather, the status of tube lines and stations and displays a value on a dial.

Home Page: blog.oftcc.net/post/39219681688/the-bicycle-barometer-takes-data-about-the

License: GNU Affero General Public License v3.0

Io 31.64% Python 68.36% CSS 0.01% JavaScript 0.01%

bicycle-barometer's Introduction

Introduction

The bicycle barometer takes data about the weather, the status of tube lines and stations and displays a value on a dial. More info and a video here.

Note: this code is a very scrappy minimum viable product, but I'm releasing it early as there has been lots of interest. There is a long todo list on the github issue tracker for this repo, feel free to fork and get involved.

The instructions here are for a Nanode, hopefully someone will get it working for an Arduino + ethernet shield and submit a pull request.

The code currently only works for UK weather and the London Tube system, Hopefully people will add wider coverage of transit systems and countries.

The bicycle barometer consists of two parts:

  1. A web app that does the hard work of looking up the weather and tube status, and reduces them down to a single number
  2. The device (a Nanode microprocessor plus servo), which looks up the number from the web app and moves a servo.

What you will need

Setting up the web component

If you like you can skip this part and use the instance of the web app deployed at http://bicyclebarometer.oftcc.net (although it is hard coded to a particular tube line)

Register for the Met Office DataPoint API

  1. Register
  2. Make a note of the API key

Setting up a local development copy

  1. Install and setup virtualenv:

     $ easy_install virtualenv
     $ virtualenv .
     $ source bin/activate
    
  2. Install requirements:

     $ pip install -r requirements.txt
    
  3. Add the met office api key:

     $ export METOFFICE_DATAPOINT_KEY=ExAmPlEkEy
    
  4. Run the app:

     $ python web/app.py
    

Deploying to heroku

  1. Create an account on heroku.com and install the toolbelt https://toolbelt.heroku.com/

  2. Create a new heroku instance

     $ heroku create
    
  3. Deploy:

     $ git push heroku master
    
  4. Add the met office api key

     $ heroku config:add METOFFICE_DATAPOINT_KEY=ExAmPlEkEy
    

Programming the nanode

  1. Install the Arduino IDE app
  2. Follow these instructions to get your Nanode up and running.
  3. Find out the mac address of your nanode and make a note of it. You need to run a script to do this.
  4. Open the sketch device/nanode/bicyclebarometer.io in the Arduino IDE app
  5. Edit the mac address
  6. Edit the following line to point at the web app: char website[] PROGMEM = "http://bicyclebarometer.oftcc.net";
  7. Attach the servo to pin 9 and on the Arduino
  8. Upload the sketch to your Nanode

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.