Commit 00b7aa32 authored by julric's avatar julric

no need

parent bd68e67b
AirPi
========
A Raspberry Pi weather station and air quality monitor.
This is the code for the project located at http://airpi.es
Changes to the original code
-----------------------------
* run as a cron-job
* added mysql-support
* added rrd-support
CRON support
-------------
It is important to set the absolute path in airpy_cron.py:
os.chdir("/path/to/airpi_cron.py/")
To run the script every 2 minutes, you have to add the following
line to your crontab a root:
crontab -e
* * * * * python /path/to/airpi_cron.py >> /path/to/airpi.log 2>&1
MySQL support
--------------
You need to set your MySQL-settings in outputs/sql.py:
conn = MySQLdb.connect(host= "127.0.0.1", user="airpi", passwd="airpi", db="airpi")
Additionally you have to add the following lines to your outputs.cfg:
[MySQL]
filename=sql
enabled=on
Your database should look like
CREATE TABLE `obs` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`Station` char(8) COLLATE utf8_bin DEFAULT NULL,
`Datetime` datetime DEFAULT NULL,
`Temperature` float DEFAULT NULL,
`Pressure` float DEFAULT NULL,
`Relative_Humidity` float DEFAULT NULL,
`Light_Level` float DEFAULT NULL,
`Nitrogen_Dioxide` float DEFAULT NULL,
`Carbon_Monoxide` float DEFAULT NULL,
`Volume` float DEFAULT NULL,
`Wind_Direction` float DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_bin
RRD support
------------
If you built your AirPi as suggested on http://airpi.es , no customization on outputs/rrd.py is needed.
The only thing you have to do, is adding the rrd output to your outputs.cfg:
[RRD]
filename=rrd
enabled=on
rrd_file=rrd/data_airpi.rrd
The parameter rrd_file points to your rrd, generated with the following commands:
rrdtool create /srv/airpi/data_airpi.rrd --step=120 \
DS:tempbmp:GAUGE:180:-273:5000 \
DS:tempdht:GAUGE:180:-273:5000 \
DS:press:GAUGE:180:U:U \
DS:humi:GAUGE:180:U:U \
DS:light:GAUGE:180:U:U \
DS:no2:GAUGE:180:U:U \
DS:co:GAUGE:180:U:U \
DS:vol:GAUGE:18:U:U \
RRA:AVERAGE:0.5:1:3200 \
RRA:AVERAGE:0.5:6:3200 \
RRA:AVERAGE:0.5:36:3200 \
RRA:AVERAGE:0.5:144:3200 \
RRA:AVERAGE:0.5:1008:3200 \
RRA:AVERAGE:0.5:4320:3200 \
RRA:AVERAGE:0.5:52560:3200 \
RRA:AVERAGE:0.5:525600:3200 \
RRA:MIN:0.5:1:3200 \
RRA:MIN:0.5:6:3200 \
RRA:MIN:0.5:36:3200 \
RRA:MIN:0.5:144:3200 \
RRA:MIN:0.5:1008:3200 \
RRA:MIN:0.5:4320:3200 \
RRA:MIN:0.5:52560:3200 \
RRA:MIN:0.5:525600:3200 \
RRA:MAX:0.5:1:3200 \
RRA:MAX:0.5:6:3200 \
RRA:MAX:0.5:36:3200 \
RRA:MAX:0.5:144:3200 \
RRA:MAX:0.5:1008:3200 \
RRA:MAX:0.5:4320:3200 \
RRA:MAX:0.5:52560:3200 \
RRA:MAX:0.5:525600:3200
For more information about rrdtool and rrds look at http://oss.oetiker.ch/rrdtool/index.en.html
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment