I've updated the Linux based software I am using to be a little more user friendly, and flexible at the same time.
The attached file contains my butchered thermo.c, to compile it on your linux system is pretty simple, gcc -o thermo thermo.c, you should now have a
thermo file which is executible. Unzip the other file, inside which is the relay controller, and follow the instructions in there to get it up and running, rename the executible to
relay and put it in the same directory as your thermo file.
You should be able to test the
relay file straight away, the same for
thermo if you have the temp logger connected to COM2.
The
thermo program has some defaults preprogrammed in for my own convenience, it defaults to COM2(/dev/ttyS1), upper temp trigger of 19DegC, lower trigger 16DegC. ie, if temps go above 19DegC, relay 0 will turn on, this should be connected to your fridge. Same for the heater on relay 1.
thermo can take some command line options,
thermo serial hightemp lowtemp
eg,
thermo /dev/ttyS0 11 7 would use the temp logger on COM1, trigger the fridge above 11DegC and the heater below 7DegC
I normally start a "screen" session and run
thermo in that, which enables me to log on to my linux box remotely and check how things are running, also means that the program doesn't stop if my terminal gets shut down etc.
BTW, all this was done on a SuSe 9.2 box, it should run on any other linux box, but I am not sure about other BSD/Unix flavours. The source is all included, so feel free to meddle with it, and tidy up my code too while you are at it..
Thanks
Ben
View attachment Thermostat.zip