Help Logging Temperature and Humidity Ethernet

Hi all,

I would like some help / advice on how to log temperature and humidity from my Arduino using the Ethernet shield. Currently I have it setup that it shows the values of the temperature and humidity using serial. I have implemented an onboard webserver to take these values and just display them in a webpage.

I am stuck on how I can log these values in a text file or table or database, whichever is easier. It is important that a time date stamp is also included. I am aware of using mySQL and possibly RRDT to do it however I don't know what steps I should do. If looking at my code helps please ask. Thanks in advance!

I am working on a program to do just this actually http://bld-live.dk/?id=23&m=5

Currently it is only writing to a CSV file, but later I will also put mysql support in, so it can put the data into a table there.

Hi bld,

Thanks for the reply, I've come across your website before whilst using Google for some information. Tbh, I don't actually understand any of what you are attempting to do as it appears rather complicated :-[ A bit too complicated for my likings actually.

It is actually easy enough.

The program I am making contacts my arduino over the wishield (should be about same procedure for an ethernet shield), and stores that data into a file.

It is then starting MRTG with a matching configuration to create charts, but that is optional.

Basicly what i got, is just this

"(PDH-CSV 4.0) (Romance Standard Time)(-60)","ANALOG_0","ANALOG_1","ANALOG_2","ANALOG_3","ANALOG_4","ANALOG_5"
"25-04-2010 14:30:00","335","347","338","395","382","22.52"
"25-04-2010 14:35:00","340","356","345","407","319","22.79"
"25-04-2010 14:39:59","353","384","378","441","314","22.70"
"25-04-2010 14:45:00","337","356","344","409","305","22.70"
"25-04-2010 14:50:00","337","358","347","413","299","22.79"
"25-04-2010 14:54:59","351","386","379","447","302","22.79"
"25-04-2010 15:00:00","338","362","350","418","307","22.79"
"25-04-2010 15:05:00","341","371","363","434","312","22.79"
"25-04-2010 15:10:02","355","395","384","450","286","22.70"
"25-04-2010 15:15:02","333","361","349","420","285","22.88"
"25-04-2010 15:20:02","337","370","359","434","291","22.96"
"25-04-2010 15:25:03","302","340","330","404","712","20.85"
"25-04-2010 15:30:03","345","394","386","446","712","20.68"

... alot more lines ...

"26-04-2010 20:00:00","331","359","352","390","710","18.05"
"26-04-2010 20:05:00","300","321","319","372","709","18.05"
"26-04-2010 20:10:01","336","369","362","404","708","17.97"
"26-04-2010 20:15:00","335","370","367","409","606","17.88"
"26-04-2010 20:20:01","293","310","301","354","674","17.79"
"26-04-2010 20:25:00","294","310","302","356","709","17.79"

Where the first line defines the order of the following values.

Would it be possible for me to have a look at your code? It would be interesting if I could get it working with the Ethernet shield. I'm still open to other suggestions btw.

The Arduino program can be found here http://bld-live.dk/?id=19&m=7

but you actually just need to make it spit out data|data|data and so on...

ex. 297|303|283|317|0|17.00

Wow thanks for the quick reply! Well currently I do have the Arduino spitting out data. Like I said, it's really the gap between the Arduino and the database that I am stuck on. I don't know how to "listen" to the Arduino IP and take the data that comes out of it into a database.

Cant help you with that, yet... Might be able to in a week or so, but I got no plan for when I am going to put MySQL support in.

Update:
Or actually... this made me curious about mysql, and going to move that up in the list... Haven't used C# and MySQL much together before, so I can't promise any deadline for it :wink:

You can make simple applications to download web pages. I made a program using justbasic that cycles thru some national weather service pages and extracts the time and trmperature from them. If the data supplied to the client is very simple in nature, you might be able to use a simple batch file setup.

Just an update on my own post. I figured something out. I was able to find some php scripts and edit them for my own use. Basically what I've done is, the Arduino outputs values (%d) to the ethernet port. The php script then takes those values and adds a time date stamp to the start of it and saves all the values into a string in a textfile. The values are ":" delimited, which is important as the next php script scans for those values and creates a png graph out of it. I have a very crude database but at least it's a start ;D