1

I managed to get my RaspberryPi & DHT 2302 sensor working I have my readings added to a file every 10 min I want to display them now as a graph on my website

What will be an option?

Assumptions: Graph can be generated using Pi Graph can be generated on my external server (if the file will be pushed)

Requirements: Graph can be selected as: last hour, day, week, month, all Show average, minimum, maximum

Adam
  • 73
  • 2
  • 6

2 Answers2

2

You'll probably end up using Munin. It allows for single node or multi-node monitoring of various metrics. It looks a bit daunting to get it set up (it really isn't) because of the command-line configurations. The most difficult part of it is getting permissions correct.

In any case, following is the Munin plug-in that I wrote (to run on the RPi) to monitor temperature:

 #!/bin/sh

 case $1 in
   config)
    cat <<'EOM'
 graph_title RPi Temperature
 graph_category Temperature
 graph_vlabel temp
 temp.label C
 EOM
    exit 0;;
 esac

 echo -n "temp.value "
 /opt/vc/bin/vcgencmd measure_temp|cut -d'=' -f2|cut -d\' -f1

That's all there is to it. All but the last line is Munin-config related. The last is the command line to pull in the temperature.

One slight change to your requirements, I believe that Munin gathers metrics every 5 minutes.

joatd
  • 121
  • 2
  • Easy enough to change the sample time for Munin. There will be a cron job on the server. Eg /etc/crond.d/munin. Just change the */5 * * * * ... to */10 * * * * ... – John La Rooy Sep 01 '13 at 22:14
0

Yesterday a user submitted an example of checking RPi temperature from the browser with Plotly (full disclosure: I work there).

You can fork the code here: https://github.com/jensb89/PiTemp.

Here's how the graph looks: https://plot.ly/~jensb89/12/.

Once you've generated your graph, you can embed it as an iframe with this snippet:

<iframe id="igraph" src="https://plot.ly/~abhishek.mitra.963/1/400/250/" width="400" height="250" seamless="seamless" scrolling="no"></iframe>

You'll want to swap in your URL in the code. Let me know if you have any issues or I can help with anything. Here's how it looks:

enter image description here.