b0ng0
Posts: 3
Joined: Sun Nov 11, 2012 9:37 am

Uploading/Graphing Data

Sun Nov 11, 2012 9:52 am

Hi guys, just got my RPi up and running recently and am using it as a temperature logger. Currently I have a python script that writes out the temperature data, time and date to a file line by line.

However, I'd really like to be able to monitor this when I'm not at home. Is there any way to graph and upload it (either at regular intervals or in real time)?

I'm a bit of a python noob so please be gentle :oops:

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Uploading/Graphing Data

Sun Nov 11, 2012 2:06 pm

http://raspi.tv/2012/using-temperature- ... and-lm335z

http://raspi.tv/2012/adafruit-pi-cobbler-review

The above two blogs detail some of my experiences with temperature sensors and logging. I hacked the code from the Adafruit site to do the online logging.
http://learn.adafruit.com/send-raspberr ... lash-tmp36

And this is what it looks like...
Image
Alex Eames RasPi.TV, RasP.iO

b0ng0
Posts: 3
Joined: Sun Nov 11, 2012 9:37 am

Re: Uploading/Graphing Data

Sun Nov 11, 2012 3:26 pm

Thanks, will take a look at this later when I'm back at my desktop.

b0ng0
Posts: 3
Joined: Sun Nov 11, 2012 9:37 am

Re: Uploading/Graphing Data

Mon Nov 12, 2012 9:15 am

That worked perfectly, thank you!

Only one small issue now; upon installing python-pip as per the instructions, Python now defaults to v2.7 instead of 3.3. Any way to change the default version??

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Uploading/Graphing Data

Mon Nov 12, 2012 10:00 am

b0ng0 wrote:That worked perfectly, thank you!

Only one small issue now; upon installing python-pip as per the instructions, Python now defaults to v2.7 instead of 3.3. Any way to change the default version??
I use Python 2.7 so that's never troubled me. I'm sure there's a way of doing it though. You can specify it in the shebang line at the top of your scripts.

Code: Select all

#!/usr/bin/env python2.7
I suppose you just change 2.7 to the version you want :)
Alex Eames RasPi.TV, RasP.iO

Return to “Python”