Pi Kitchen Dashboard
Because thrift store monitors still need things to do.
This project turns your monitor and Raspberry Pi into a simple, skinnable time and weather dashboard for your kitchen. Want it in your living room? Too bad.
- Items Needed
- Changing the skin
- Creating skins
- Raspberry Pi
- Adapter to hook said Raspberry Pi to said monitor
- Internet connection
Clone this repository with
git clone https://github.com/userexec/Pi-Kitchen-Dashboard.git.
If your Pi does not currently have git, you will need to install it first with
sudo apt-get install git.
This project is not distributed with its dependencies; however, Bower will automatically pull them in.
sudo apt-get update && sudo apt-get upgrade- Update your system
- Install Node Package Manager (required for Bower)
Raspberry Pi A/B/B+
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz tar -xvf node-v4.0.0-linux-armv6l.tar.gz cd node-v4.0.0-linux-armv6l sudo cp -R * /usr/local/
Raspberry Pi 2 Model B
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz tar -xvf node-v4.0.0-linux-armv7l.tar.gz cd node-v4.0.0-linux-armv7l sudo cp -R * /usr/local/
sudo npm install -g bower- Install Bower
cd ~/Pi-Kitchen-Dashboard- cd into the directory of the cloned project
bower install- Install the project's dependencies
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!
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.
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.
sudo nano /etc/lightdm/lightdm.conf
Add the following lines to the [SeatDefaults] section:
xserver-command=X -s 0 -dpms
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.
sudo apt-get install unclutter
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.
sudo apt-get install midori
Create a new directory at
~/.config/autostartif it does not exist
cd ~/.config/autostart- cd into this directory
nano unclutterAuto.desktop- Create a new .desktop file
Add the following lines and save. Customize the file path to where this project's index.html lives on your Pi.
[Desktop Entry] Type=Application Exec=unclutter -idle 0.1
nano midoriAuto.desktop- Create a new .desktop file
[Desktop Entry] Type=Application Exec=midori -e Fullscreen -a file:///home/pi/Pi-Kitchen-Dashboard/index.html
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.
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.
cdinto your Pi-Kitchen-Dashboard directory and set both scripts to executable
chmod +x screenOff.sh chmod +x screenOn.sh
crontab -eand 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.
0 23 * * * /home/pi/Pi-Kitchen-Dashboard/screenOff.sh 0 6 * * * /home/pi/Pi-Kitchen-Dashboard/screenOn.sh
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 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.
Time formatting by Moment.js
Weather data retrieved using Yahoo! Weather API.
Default skin responsiveness by RYJASM.
Project is under MIT license.