Giter Site home page Giter Site logo

darkpi's Introduction

DarkPi

An ambient weather display for Raspberry Pi Zero W, Pimoroni Blinkt, and Dark Sky API

I thought this would be a useful way to gauge whether the kids needed to bring a jumper or coat to school each day. It uses the Dark Sky api to pull down the forecasts for the next 8 hours, and display some vaguely appropriate colours. The lights are dimmer at night.

Requirements

Powered by Dark Sky

Installation

Install the Blinkt libraries: https://github.com/pimoroni/blinkt sudo pip install python-forecastio

Put the darkypi.py script somewhere

Set the environment variables (I put them in ~/.bash_profile)

DARKSKY_API="somethingsomething"; export DARKSKY_API
LAT="50.7"; export LAT
LON="-10.5"; export LON

Run

python darkpi.py

Scheduling

We want the display to update every hour, and when we power on the device.

I wrote a little shell script called run.sh to hold the environment variables because cron is... awkward

DARKSKY_API="something"; export DARKSKY_API
LAT="50.5"; export LAT
LON="-8.5"; export LON

python ~/darkpi/darkpi.py

Run crontab -e and add these entries to the crontab

0 * * * * /darkpi/run.sh
@reboot   /darkpi/run.sh

Examples

Partly cloudy

Output

Rainy now

Clear and partly cloudy

darkpi's People

Contributors

ideasasylum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

raspberrycoulis

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.