This is the Readme file for QkTemp.
The QualityKits VK011 is a digital thermometer that attaches to and is powered by a serial port. You can attach up to four Dallas DS18S20 sensors to it, to read temperature in four places at once.
See it at http://www.qkits.com/serv/qkits/diy/pages/VK011.asp
This program is run from /etc/inittab, listens to the serial port specified on the command line, and records the temperatures to an RRD file for easy graphing.
- Dependencies
-
RRDtools needs to be installed; I used 1.0.49.
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.49.tar.gz (Make sure to install the 'perl-shared' part.)
I use 'xv' to display my images, but you can use anything (see the showgraph program, last line).
- Installation
-
tar xzvf qktemp-1.0.tar.gz
- Configuring
-
Edit the first line of dotemp to indicate where you want the RRD database to live.
- Running
-
Add a line like this to /etc/inittab:
dt:2345:respawn:/usr/depot/qktemp-1.0/dotemp /dev/ttyS1
Type 'kill -1 1' to get it to start. You can also run it from the command line to see if any errors are present:
dotemp /dev/ttyS1
To see the graph, run 'showgraph'. It assumes it's running in the same directory as an rrd file called temperature.rrd. A later release may make this a command line option, but it's ok for now. The graph can show data for an hour, a day, a week, or a year; see the first line of showgraph for that setting.
- Troubleshooting
-
Inittab runs things as root, so reading the data from the serial port should not encounter any permissions problems.
Trying to read from the wrong port will cause the program to die every 3 seconds and be restarted, until init gives up. Then it will wait for five minutes and repeat the process. This will cause lots of messages to show up in your syslog. Normally you want lots of messages to show up in syslog if something is broken.
- Security
-
I don't think there are any security problems with this code, but your mileage may vary (YMMV). The data from the port is checked carefully, and only sane numbers are entered into the database.
There are no hacker-accessible parts (no network code, no /tmp directory usage, running it without root access won't do anything, it's not setuid).
- Author
- My name is Charles Howes <qktemp@pkts.ca> This program is GPL.
