a Temperature Indicator
more to come soon...
Well, I wanted to make a little thingy to put into my
Wharf. And there it was. A brand new temperature indicator.
- Version 0.01
- First release.
- Version 0.02
- Some minor changes.
Astemp is a temperature indicator to put into your Wharf. It's
designed to use with AfterStep, but it's possible
to use it alone.
Let's connect a temperature indicator to all Linux boxes all over
the world to see what temperature the users have when they are
hacking away on their Linux ;-)
To measure the temperature on your own computer you also need
some other applications, a thermistor and a game port:
Download: astemp-0.02.tar.gz.
The kernel module reads data from the game port and gives the
temperature on four devices, /dev/tw0, /dev/tw1, ...
The temperature given on this devices is ten times the original
temperature. This is because we want to use integers
to represent the value, and we have a 0.1°C resolution.
To install this driver you'll have to type:
# insmod tempwatch.o
This module is made against kernel 2.0.30 and may contain bugs...
I don't think it will coexist with the joystick device because
they use the same hardware address. Maybe I'll have to make a
workaround here.
The devices use major 42 and minor 0-3. This is development
numbers and should probably not be used worldwide. But I haven't
got any numbers to use to this device so I use this for now.
Maybe they get their own number when/if it can coexsist with the
joystick device...
Download: tempwatch-0.02.tar.gz.
The temperature daemon reads data from the kernel module, corrects
span and offset, and sends the data to all clients trying to
connect to the port (standard 1200). If you want to get the
temperature from the probe attached to port 0, you just send the
value 0 to the daemon and it will return the correct temperature
for this probe (multiplied with ten because of the integers), a
255 bytes long info string, and four integers telling the
geographical position.
If you use a non-default¹ temperature probe you have justify
span and zero for that probe. It's not as difficult as it seems,
it just takes some time :-) Here is a short drawing describing
the values:
<---------------- Span ----------------->
|---|---|---|---|---|---|---|---|---|---| Temperature
-50.0 0.0 50.0
\--- Zero
The span value is used to tell the distance from bottom to top
temperature. The zero value is used to justify the zero point.
¹ non-default means another probe than I use.
Download: tempd-0.02.tar.gz.
You'll need a ~200kOhm thermistor and a game port.
p2 p1 +5V
| | | 15 pins D-SUB.
o o o o o o o o <- pin 1
o o o o o o o Thermistors:
| | +5V ---NNN--- p1
p4 p3 +5V ---NNN--- p2
Connect probe one to +5V and p1 (inside), and probe
two to +5V and p2 (outside). Then you put the plug
into the game port, insmod tempwatch.o and run tempd.
Voila, and you have you're own temperature measurer to
distribute the temperature world over.
Currently I don't know anyone else running tempd.
(because no one knows about it yet, I suppose :-)
But when they show up I'll put them up here if they want...
| Host | Port |
Where | Probes |
Admin |
| gadid.tihlde.hist.no | 1200 |
Trondheim, Norway | 2 |
Stig Bjørlykke |
The plan is long and I haven't written everything down yet. But
some of my ideas are:
- send a short string containing some user defined info about
the probe together with the temperature.
- a temperature log for the last day, week, month and year.
- a dedicated expansion cart to put into the computer
(probably just a simple A/D converter).
- max and min temperature last period (day, week, ...).
- take over the world...
Well, I don't know anything about bugs, and my programs may be
full of them. Please let me know if you find any.
Stig Bjorlykke
Last modified: Mon Nov 10 20:07:51 CET 1997