Giter Site home page Giter Site logo

horace310 / raspi-weather Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ofalvai/raspi-weather

0.0 0.0 0.0 888 KB

Raspberry Pi + DHT22 sensor + web frontend = nice graphs

License: Other

JavaScript 91.29% Python 0.95% CSS 1.12% HTML 6.65%

raspi-weather's Introduction

Raspberry Pi weather station

DHT22 temperature/humidity sensor logger and browser dashboard for the Raspberry Pi. Based on Adafruit's DHT22 Python library.

Screenshot

Features

  • Measure and store temperature and humidity periodically (via cron and sqlite)
  • Responsive web dashboard
  • Display current temperature and humidity
  • Display logged temperature and humidity graphs
  • Current outside weather via Forecast.io

Installation

sudo apt-get install sqlite3
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
git clone [email protected]:ofalvai/raspi-weather.git
cd raspi-weather
npm install

Install Adafruit's DHT22 Python library according to their instructions.

Edit your sudo crontab with sudo crontab -e (yes, it needs to run as root to access GPIO, use at your own risk), and add this line:

*/30 * * * * /usr/bin/python /home/pi/raspi-weather/sensor_scripts/logger.py

...assuming you want to take measurements every 30 minutes, and cloned into /home/pi.

Connect your DHT22 sensor to the Pi and set the pin variable in sensor_scripts/current.py and sensor_scripts/logger.py to the pin number you use.

You can test both scripts by running sudo sensor_scripts/current.py and sudo sensor_scripts/logger.py. The latter will create the sqlite database file in the project root and log the first measurement.

You can further tweak the frontend settings in public/javascripts/app.js, like:

  • temperature unit
  • Forecast.io API key and location for outside weather info
  • chart options

Usage

Start the server (it needs to run as root for the same reason as the cronjob: to aceess GPIO):

sudo nohup node app.js &

...or you can install forever to keep it always running and then sudo forever start app.js

The server runs on port 3000, so visit for example http://192.168.0.100:3000

Future ideas

  • Select custom date ranges to display on the graphs
  • Average graphs
  • Dynamic favicon (like Google Calendar)

Feel free to fork and send me pull requests :)

raspi-weather's People

Contributors

ofalvai avatar

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.