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

  • how looks like your line in file you append? Give a sample line. MRTG could do this. – gurcanozturk Sep 2 '13 at 21:26

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:


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

 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.

| improve this answer | |
  • 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 1 '13 at 22:14

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.