The How Zone

Refrigerating the Web

Hello Fridge this is OSX


This is a quicky project so nothing fancy for laying out components. Coat hanger, random scrap wire, plus a couple of micro-switches and an AC relay picked up at Radio Shack.

fridgerig

The ethernet cable snakes through a heater vent and down into the computer room. Siteplayer can either get its IP address via DHCP (the router assigns it) or you program it with a fixed IP. I fixed it at 192.168.1.100.

And that's all it took to put our fridge on the internet, or at least on the internal network. Fire up a browser and visiting http://192.168.1.100/ shows the current status of the fridge. Cool beans.

The next step is to harvest and store this data on a regular basis. I was really hoping for UDP, since my program could then wait for the fridge to tell it when something changes. No luck. Instead my perl program has to poll the fridge's web page once a second, which is pretty simple: it uses LWP to grab the siteplayer web page, parses the variables and sees if any have changed state since the last request. If they have then the type, state, and a time stamp is concatenated onto a text file. The script was started Sunday and has been running on my OS X machine since.

You can read the output file and sort of make some sense out of it, but it doesn't really give you a firm grasp of what is happening in relation to time and the relationships between all of the events. For that you need a nice graph.

 «Code & Schematics  Page 3 of 6 Graph Fun»