Friday, January 15, 2010

Putting your watts on the web (Part 2) for CC128 users!

Just a quick update on the CurrentCost interfacing to the NSLU2. I posted earlier, thanks to manutitou over at pachube.com, he's figured out how to force the NSLU2 serial port to the higher default baud rate of 57600 that is needed for the CC128 CurrentCost.

He tells me that this is working for him: (take a look at his feed)

stty -F /dev/ttyUSB0 speed 57600 raw cs8
57600
stty < /dev/ttyUSB0
speed 57600 baud; line = 0; min = 1; time = 0; -brkint -icrnl -imaxbel -opost -isig -icanon

Nice one. Update your scripts if you used mine, or your own version accordingly and enjoy.

5 comments:

Unknown said...

Another command line which can be usefull to test your connection with the CC128 is
picocom -b 57600 /dev/ttyUSB0

Unknown said...

(update) actually got an issue with the connection as the slugs gets some overflow and eventually hang up... need to understand this problem now

mart said...

i've seen this also after a number of days, i think the serial port is overflowing. we need to whip up a little c prog to do the reads i think , will look into it.

Unknown said...

wondering if the overflows are not related to the history data being sent every hour (cf http://www.currentcost.com/cc128/xml.htm)
Strangely enough my pachube data become frozen at every hours... keep in mind my (yours) script is configure in crontab to be trigger every minutes...
just a though that i will investigate

Nick said...

Interested to know if there was any follow up to this. Am hitting the same issue with the head command hanging when called by cron, in a random but definite fashion.

Thanks