TFA Climate Reader

Purpose

Reading data from climate logger TFA 30.3015 and outputting it in CSV format.

Design goals of tfa-reader:

License: GNU GPL v2

History

v0.2
Fixed parsing of data values (thanks, Peter)
v0.1
Initial release

Getting the program

Source Tarball

Download from Sourceforge

Source repository

Use Mercurial to pull from Sourceforge:

hg clone http://tfa-reader.hg.sourceforge.net:8000/hgroot/tfa-reader/tfa-reader

Compiling

TFA Climate Reader uses cmake to manage the builds. You also need to have libpopt.

cd tfa-reader
cmake .
make

Running

Example usage is:

./tfa-climate-reader /dev/ttyS0 > mydata.csv

For testing and debugging purposes, you can write the data that is read from the logger into a file:

./tfa-climate-reader /dev/ttyS0 --savebinary=myDumpFile

You can then use that file as input, to avoid reading the climate logger for every test:

./tfa-climate-reader myDumpFile --binary

Using the output

Plotting with TimeDataPlotter

TimeDataPlotter was specifically written to plot data like the one produced by tfa-reader!

tfa-climate-reader /dev/ttyS0 | timedataplotter

For a setup with one external sensor, showing just the temperature (columns 1 and 3):

tfa-climate-reader /dev/ttyS0 | timedataplotter --leftAxis=1,3

Plotting with GnuPlot

A program tfa-gnuplot-adapter is included that converts the csv values into a datafile and GnuPlot commands

Typcial usage:

tfa-climate-reader /dev/ttyS0 | tfa-gnuplot-adapter --pause=30 | gnuplot

This will plot the graph and show it for 30 seconds. After 30 seconds, gnuplot will close.

To avoid the closing, you can pipe the commands into a file and then invoke gnuplot for that file:

tfa-climate-reader /dev/ttyS0 | tfa-gnuplot-adapter > gnuplot.commands && gnuplot gnuplot.commands -

This will write the commands into gnuplot.commands and invoke gnuplot with it. After the commands are executed, gnuplot will wait for further commands on stdin.

Converting to SQL

A program tfa-sql-adapter is included that converts the csv values into SQL statements. This can be piped into a database.

Typcial usage:

tfa-climate-reader /dev/ttyS0 | tfa-sql-adapter --table=MyTableName | mysql --user=myUserName --password=mySqlPassword --database=climate

Creating a suitable table:

tfa-sql-adapter --create --table=MyTableName | mysql --user=myUserName --password=mySqlPassword --database=climate

Disussions

Can be held at the forum at SourceForge.