Saturday, September 26, 2009
Monday, September 21, 2009
Quite a few folks are activley monitoring using this hardware solution, but I think this solution gets the 'quick and dirty' award, as very little else is needed, the data is collected and posted using a little shell script, with no need for perl, ruby or other such stuff.
- We got the older CurrentCost Classic as the serial data comes out a little slower (9600baud) than the newer, shiny CC128 model, which suited hooking it up to stuff that cant swallow the data rate of the newer model.
- Get the CurrentCost USB cable as well, it has a USB/Serial converter built in , which you'll need unless you already have a separate one (CurrentCost serial port is 5v RS232, so hooking it up to a serial port directly will get you nothing or magic smoke 8-( )
- Unsling your NSLU2 so you can telnet/SSH into it and run stuff. (see links above)
- Hook your CurrentCost to the spare USB port on the NSLU2 (it should also work on a hub btw, but the device below may be different to mine.)
- run dmesg and look for the device ID of the serial port that is detected - ours was /dev/ttyUSB0
- Try this filthy script out - you'll need to edit it, to replace: YOUR_PACHUBE_API_KEY with your actual Key from your pachube account, and also your YOUR_FEED_ID in this file to get it to work. - I just have two integer values, one for watts, one for temp on this feed.
- Two little scripts are provided get-watts , and get-temp which should just echo the data from the CurrentCost to the console, as well as update-pachube which does the biz to the pachube service.
Footnotes: You may need to do some ipkg install magic on the NSLU2, you need grep, sed, cut and curl I forget which ones are in the slugos already.
The NSLU2 is a great platform for this type of stuff, the power consumption is less than 3w according to our killawatt, with processing power to spare, for ..... more stuff in the near future 8-)
UPDATE: An abusive co-worker who is attempting to follow my vague and inaccurate posting has reminded me that there are two missing steps in this post:
- You need to install some extra packages on your slug, I *think* these are:
- picocom - 1.4-1 - A minimal dumb-terminal emulation program. (you will want this to see what is happening on the com port from the current cost)
- libcurl - 7.19.5-1 (you need curl for the pachube posting)
- coreutils - 7.4-1 -(I think coreuils has cut in it, among other utilities)
(e.g # ipkg install picocom; ipkg install libcurl; ipkg install coreutils)
- You need to install the PL2303 kernel module so the USB-To-Serial cable is recognised. (following http://www.nslu2-linux.org/wiki/Peripherals/USB2Serial worked for my official currentcost cable) - after doing this check with dmesg for the name of the serial port to point to for your data.
Further abusive comments welcome from anyone, if this is still not correct 8-/ - my apologies.
Friday, September 11, 2009
I spent hours searching for a solution on the net, fiddling with Netsh, MTU sizes, switches and NIC drivers, until I spotted this blog entry. Turn off the Large Send Offload setting on the NIC. POW Fixed. Thanks to Daniel Petri. No reboot required.