Google Chromecast-like picture frame displaying data from different sensors and APIs.
Tested on Raspberry Pi 2 Model B, but it should run on any hardware with the Broadcom BCM 2835 chip for GPIO communication.
Clone this repository on your Pi:
git clone https://github.com/DerAtrox/PiFrame.git
Make run.sh
executable:
chmod +x ./run.sh
Copy /config/default-config.js
to /config/config.js
.
Property | Default | Description |
---|---|---|
port | 3000 | Port used by the web server |
sensor.dht.gpio | 4 | GPIO pin used by the DHT sensor |
sensor.dht.type | 11 | Wether you use a DHT11 (put in 11 ) or a DHT22/AM2302 (put in 22 |
api.nasa.key | empty | Your NASA API key (get one here) (unused) |
api.unsplash | empty | Your Unsplash API key (get one here) (Free demo app: 50 requests per hour) |
api.openweathermap.key | empty | Your OpenWeatherMap API key (get one here) |
api.openweathermap.cityid | empty | City ID of the city you want to display (City ID list) |
Run run.sh
to start and daemonize PiFrame with PM2.
./run.sh
After that you can use PM2 to start, stop, restart or monitor PiFrame.
Now you can just open your browser and navigate to your Pi with the port you chose, for example http://raspberry:3000/
.
To update PiFrame, just run the start script (run.sh
) again.
Note: Running the start script will reset everything in the directory, except Node.js modules and configuration files, to the last commit in this repository#master.
PiFrame comes with two views, one fancy view you can reach with /
and one debugging view just showing some information, which you can reach with /simple
.
More views or themes are planned in the future.
PiFrame uses a API to refresh the information shown on your screen every few seconds. You can use these API endpoints for other projects if you want.
At the moment, there are the following API GET endpoints:
/api/general
/api/sensors
/api/weather
/api/background
This project is made possible by these awesome libraries, frameworks, fonts and APIs, go check them out!
-
Node.js - Node.js JavaScript runtime
-
PM2 - Node.js Production Process Manager with a built-in Load Balancer
-
Axios - Promise based HTTP client for the browser and node.js
-
Express - Fast, unopinionated, minimalist web framework for node
-
Moment.js - Parse, validate, manipulate, and display dates in javascript
-
bcm2835 library - C library for Broadcom BCM 2835 as used in Raspberry Pi
-
node-dht-sensor - Node.js Humidity and Temperature sensor addon
-
Bootstrap - The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web
-
jQuery - jQuery JavaScript Library
-
Font Awesome - The iconic SVG, font, and CSS toolkit
-
Google Fonts - Making the web more beautiful, fast, and open through great typography
-
OpenWeatherMap - Free weather data
-
Unsplash - Beautiful, free photos
-
NASA APIs - Awesome pictures of our universe