External Links:

Commandline Logging of data: the plotting

If you want to plot something under linux from the commandline, gnuplot is almost always a good and safe choice.
So we want to plot the table from the sqlite database into a nice graph. We want todo this in a nice way, so no intermediate files.

The graph is scaled between min temp and max temp, would be nicer between 0 and 50.

Some nice axes titles

So lets fix them in reverse order:

set grid

The axes label:

set xlabel "Time (HH:MM:SS)
set ylabel "Temperature (Celcius)"

The scaling:

set yrange [0:50]

The time offset (for me it is 2 hours):

plot "< sqlite3 ./temperature.sql 'select * from temperature where sensor=0'" using ($1+60*60*2):3 with lines title "Room"

And if everything was right, you should see something like:

Full Script:

set term post eps
set output 'temperature.eps'
set datafile separator "|"
set xdata time
set timefmt "%s"
set format x "%H:%M:%S"
set yrange [0:40]
set xlabel "Time (HH:MM:SS)
set ylabel "Temperature (Celcius)"
set grid
plot "< sqlite3 ./temperature.sql 'select * from temperature where sensor=0'" using ($1+3600):3 with lines title "room"