Pages: [1]   Go Down
Author Topic: Graphing the values obtained from SHT15 on to a web server..Plz help  (Read 888 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys

Has anyone worked on a project in which you have graphed the results.
what are the steps. how do I store the results and graph it on a web server.
Please help

Thanks heaps
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2523
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1) Install RRDTool

2) Create an RRD database to store your data. This example stores two values, temperature and humidity, keeping a data point every 5 minutes (-s 300). These values will be stored every five minutes for a week (one week is 2016 five-minute steps) and every hour for three months (720 hours in three months). That creates a puny 44 kilobyte file so obviously the time spans can be much larger.

Code:
rrdtool create mylog.rrd -s 300 \
  DS:Temperature:GAUGE:300:-20:120 \
  DS:Humidity:GAUGE:300:0:100 \
  RRA:AVERAGE:.9:1:2016 \
  RRA:AVERAGE:.9:12:720

3) Now to update the database run this script every minute (i.e. cron job):

Code:
#!/usr/bin/perl
use LWP::Simple

my $page = get("http://192.168.2.137/") || die "Can't read from server!";
$page =~ /Temperature:([\d\.]+)/;
my $temp = $1;
$page =~ /humidity([\d\.]+)/;
my $humidity = $1;

`rrdtool update mylog.rrd -t Temperature:Humidity N:$temp:$humidity`

4) Finally, to display the data, I prefer to use RRGrapher.cgi. There's a "CONFIGURATION SECTION" that will need to have the directory containing your RRD file configured but that's about it. Just execute the script via your web server and it should be pretty straightforward what you need to do.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks heaps Chagrin smiley
I will try that!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey Chagrin

I am working with Windows XP. I am struggling with perl script.I did download active perl and trying executing the script, for some reason it is not working for me..please help
Logged

Pages: [1]   Go Up
Jump to: