Energy Monitor – part 2

So, now I hopefully(!) have my cable which will give me access to the UART RX of the CC128 energy monitor. Time to try it out and begin processing some data with it!

Firstly, I go to the XMOS website and get the UART code and play around with it to create the UART code I want (RX only at the moment), compile it and give it a run.

But it’s never that simple! All I get are null characters. Odd I think – so I recheck the wiring, recheck the code. All seems to be ok.

So I strip down the code to a really simple function- one that just receives a character and prints it out (see the Super Simple UART receive function source file)

I still get null characters – maybe I got the wrong pins? Check again… nope, seems fine. So I decide its time to void the warranty (follow these CC128 teardown instructions at your own risk!).

Turns out there is a bit of solder between a via into the ground plane and the UART TX pin on the RJ45 connector (pin 8). After removing this I connected the XC-3 back up to the device and wah lah- it gives me the first character (a ‘<‘) of the XML data string.

Now to get the whole string out – so off I go to re-implement the more complex UART code.

After some battling I got it running!

UART Data RX workingThe output looks like the following is in line with the CC128 XML documentation.

Next time… parse the XML and output to somewhere a little more useful!

This entry was posted in Energy Monitoring, Projects and tagged , , , , , , . Bookmark the permalink.

5 Responses to Energy Monitor – part 2

  1. Steve says:

    My standalone receiver doesn’t appear to have any easy to access outputs – not even found a JTAG or anything. My USB receiver is weird – just a pair of HID devices, one of which gets written to (same packet every time) and the other replies with what i can only assume is what’s buffered up in the radio receiver. Incidentally, the radio in the USB receiver is from an Oregon Scientific weather station… o_O.

    Once I’ve had a chance to read the data I’ll hopefully be able to figure out what it is.

    Replaying the USB command in Linux hasn’t worked yet either. I wish it was as simple as RS232 and XML!

    • silly-scientist says:

      Hmm, sounds nastily more complex than mine… it might be worth me seeing if I can put it on the USB analyser at work and see if we can get a dump of what’s going on – hopefully that might be a bit more enlightening!

  2. Steve says:

    Could be interesting.

    I had a theory based on something I read on another site though, and I think I’m onto something.

    I took the data I snooped off the USB and put it into excel. I then assumed (hey, nothing like a crazy assumption) that the values were sampled radio data, thresholding the values at the average of the data, giving me a bunch of 1s and 0s.

    I know that the ID of my transmitter at the moment (it changes if I reset it) is 596 and that they say there are “>4000 IDs per channel”, so I assumed 12-bit ID, then created a sliding 12-bit window and created decimal values across the data. Then I searched for the ID – boom, it’s there, repeatedly, and the bits surrouding it rarely change either – suggesting there’s other constant data too – it’s a pattern beyond randomness, I’m fairly sure.

    Now how about THAT for some detective work!

    • silly-scientist says:

      Ha! Awesome. That sounds pretty nasty work though… I wonder why Owl made it so hard? But pretty classic code cracking stuff! Would be interested to see if you get it all deciphered and then integrate it into Google Power Meter (see my post on that…)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.