Raspberry Pi Weather Dashboard

Tutorial Credit

Reddit: /u/MildAndFire
Twitter user: @EliteSirus

Sources:
Github Source Code: https://github.com/userexec/Pi-Kitchen-Dashboard

Imgur Gallery (hardware): http://imgur.com/a/3Kopj

Reddit: https://www.reddit.com/r/raspberry_pi/comments/4k41w3/raspberry_pi_weather_dashboard_tutorial_credit/

Step 1: Software Installation


Items needed

  • Raspberry Pi
  • Monitor
  • Adapter to hook said Raspberry Pi to said monitor
  • Internet connection

Buy Items via Amazon

Hangman Heavy-Duty Mirror and Picture Hanger-Aluminum (HP-10) (Tools & Home Improvement)


List Price: $11.29 USD
New From: $9.00 USD In Stock
Used from: Out of Stock

Dell Professional P190S 19-inch Flat Panel Monitor (Electronics)


New From: $199.00 USD In Stock
Used from: Too low to display In Stock

Fullink High Speed HDMI to DVI Adapter Cable (3 feet) (Electronics)


List Price: Price Not Listed
New From: 0 Out of Stock
Used from: Out of Stock

Instructions

Clone this repository with

If your Pi does not currently have git, you will need to install it first with

Fulfilling requirements

This project is not distributed with its dependencies; however, Bower will automatically pull them in.

Update your system

Install Node Package Manager (required for Bower)

Raspberry Pi A/B/B+

Raspberry Pi 2 Model B

Install Bower

cd into the directory of the cloned project and install dependencies

Setting your location

Open js/weather.js and find the following section at the top:

// Your Yahoo WOEID code
// Find your WOEID code at http://zourbuth.com/tools/woeid/
var woeid = 23416998;

// Your temperature unit measurement
// This bit is simple, ‘c’ for Celcius, and ‘f’ for Fahrenheit
var unit = ‘c’;

// Yahoo! query interval (milliseconds)
// Default is every 15 minutes. Be reasonable. Don’t query Yahoo every 500ms.
var waitBetweenWeatherQueriesMS = 900000;
Change these variables to match your location, unit measurement, and desired update interval, and your part of the coding is done!

 

Configuring your Pi

You will need a Raspberry Pi (although you could use anything else) with Raspbian (again, or anything else) and an internet connection. To complete the dashboard, your Pi will need disallow screen sleep and automatically start kiosk mode.

Disallowing screen sleep

Unless screen sleep is prevented, the dashboard screen will go black after a few minutes and require a mouse movement or keypress to wake up. Scheduled times for the display to turn off are covered in a later section.

Add the following lines to the [SeatDefaults] section:

Installing Unclutter

Unclutter causes the mouse cursor to disappear when the mouse isn’t being moved. This prevents the dash from having a cursor over the middle unless you plug in a mouse and move it elsewhere.

Installing Midori

Midori is used for its compatibility with multiple RPi generations and reasonably solid rendering. Other browsers may be used if preferred using much the same strategy.

Auto-starting Unclutter and Midori

Create a new directory at ~/.config/autostart if it does not exist

Add the following lines and save. Customize the file path to where this project’s index.html lives on your Pi.

Create a new .desktop file

Your Pi should now atomatically start kiosk mode and show the dashboard full screen once your desktop loads.

If your time or date are incorrect, use sudo raspi-config to set your locale and timezone.

Scheduling screen sleep

If you don’t want your display to run 24/7, you can use cron jobs to fire a pair of included bash scripts: screenOff.sh and screenOn.sh. Please ensure you’ve completed the Disallowing screen sleep step above in order to keep the display always on during the times it’s scheduled to be on.

Make Scripts Executable – cd into your Pi-Kitchen-Dashboard directory and set both scripts to executable

 

Run crontab -e and add cronjobs to the end using the provided scripts. If you’re not comfortable writing cronjobs manually, you can use a crontab generator. The following lines, for example, shut off the display at 11:00PM each night and turn it back on at 6:00AM. Be sure to edit the file paths if necessary.

Changing the skin

Skins are kept, conveniently, in the skins folder. To switch skins, edit Pi-Kitchen-Dashboard/index.html and insert the folder name of the skin you wish to use where the comments direct.

Creating skins

Creating your own skin or a new skin for distribution is easy and only requires knowledge of HTML and CSS. Just copy the default folder under skins, rename it, and begin editing. Comments in the default skin will guide you through the process, but it basically boils down to 99% using your imagination and 1% placing a few IDs and classes so that time and weather data can be auto-populated.

Credit

Weather icons by Lukas Bischoff and Erik Flowers https://github.com/erikflowers/weather-icons. Icons licensed under SIL OFL 1.1.
Time formatting by Moment.js
Weather data retrieved using Yahoo! Weather API.
Default skin responsiveness by RYJASM.
Project is under MIT license.

Step 2: Hardware Installation


Weekend Pi Project

2 Responses

  1. Fernando Santos says:

    I’ve tried this with an 7” LCD 800×480. It’s working but it’s disformed. Any idea where I can apply a new style?

  2. tinki says:

    can an eink screen be used here?

Leave a Reply

Your email address will not be published. Required fields are marked *