Page 1 of 1
Serial processing code? Patchube?
Posted: Sat Sep 24, 2011 10:16 pm
by peterloron
Hi. Unless you know of some existing code for processing the serial messages, I'm going to be writing a script to take the serial output and pump the data into Patchube. I'll also probably modularize it to write out to CSV or MySQL or somesuch.
I'm going to be deploying this GC kit as a permanent environment monitor, and want to log the data...
Any thoughts / desires?
Thanks.
-Pete
Re: Serial processing code? Patchube?
Posted: Mon Sep 26, 2011 10:37 am
by mightyohm
Yes, please do!
What data format does Pachube want? This has been on my list of "stuff to figure out" but I since releasing the kit I haven't had time. If there is anything I can do in the firmware to make it easier to interface the kit with Pachube then I'm all for including it in the next rev.
Re: Serial processing code? Patchube?
Posted: Wed Sep 28, 2011 6:56 pm
by peterloron
It's a pretty simple XML format. Here's the API quickstart:
http://api.pachube.com/quickstart/
I'm hoping to take a stab at this next week, but I may wind up buried like this week...
As far as changing the firmware, I don't know of anything specific to change. The various modes (slow, fast, etc) will complicate things, but it's not insurmountable. You already have the values delimited in the output so it shouldn't be a problem to reliably parse them from the serial stream.
-Pete
Re: Serial processing code? Patchube?
Posted: Sat Oct 15, 2011 11:56 am
by mightyohm
I tried to make the serial data easy to parse, but I didn't know who or what would be parsing it, so I had to take a guess. Let me know if there is anything i could have done better.
Re: Serial processing code? Patchube?
Posted: Sat Oct 15, 2011 12:14 pm
by peterloron
Nothing for now.
I've got a simple class written that pulls the data from the serial port and logs it to a CSV file. The next bit that is still being worked on is to take that second by second data and roll it up for pushing to Pachube on a longer interval...every 5 minutes or whatever. I just haven't had time to finish it off.
I'll post the code up to github once it is working and has enough documentation for others to make use of it.
Re: Serial processing code? Patchube?
Posted: Sat Oct 15, 2011 12:43 pm
by mightyohm
Yes, the interval is important. I think the NetRAD shield by Freaklabs posts data about once a minute.
Are you writing python or ?? What operating system?
Very excited to see your code.

Re: Serial processing code? Patchube?
Posted: Sat Oct 15, 2011 12:57 pm
by peterloron
Yes, it's Python. I'm writing it on OS X, but will test it on Ubuntu and Windows 7 as well. Should be no problem to use it across operating systems.
Re: Serial processing code? Patchube?
Posted: Mon Oct 24, 2011 6:34 am
by peterloron
Ok, I had a bit of time last night and got a basic lashup working. You can see the data on Pachube here:
https://pachube.com/feeds/29101
The code still needs some work to be suitable for public viewing.

Re: Serial processing code? Patchube?
Posted: Mon Oct 24, 2011 10:32 pm
by mightyohm
Awesome!
