# DHT22 logging tool
#
# 17 August 2018, by FUJIWARA Teruyoshi <tf@dsl.gr.jp>
#

1. Hardware Requirement
* Raspberry PI
* DHT22 sensor connected to RPi. You might need some electoronic work.

2. Software Requirement
* Python 2.7 and later and a few external libralies
  - pytz (available via pip)
  - Adafruit_Python_DHT: https://github.com/adafruit/Adafruit_Python_DHT
* gnuplot
* Temperature, Humidity, Time data produced by DHT22 (or other temperature-humidity sensors)
* Mutt (a mail client); you need to setup Mutt and a MTA like ssmtp on your RPi.

3. Setup

a. Edit pathes in the scripts
This package assumes you extract the archive at /home/pi/work and you don't need to change anything in that case. Otherwise you need to modify file paths in the two following scripts.
 - script_cron.sh (Bourne shell script)
 - temp_humid.plt (gnuplot script)

b. setup crontab
Add the following line onto your crontab. With this setting, your RPi sends you a daily summary of the log every night.

---------------------------------------------------
2 1 * * * /home/pi/work/DHT22/logger/script_cron.sh
---------------------------------------------------

4. Run the logger

> /home/pi/work/DHT22/logger
> ./dht22_logger.py | tee --append logs/temp.txt

You might wants to run the script in the background or a screen session.

Enjoy your RPi with fun!
