Thursday, May 16, 2013

What's Next

This is giving me lots of ideas.  Big issue at the moment is the amount of horsepower I'm using to do this.  Can I reduce the foot print?  I originally wanted to do this with a micro controller, and that's still the ultimate goal.

Can I move all the software to a Raspberry Pi?  Only if I can get Dexcom Studio to run under Wine.  This would get things down to a manageable size, everything can live in a backpack or my gym bag.  Obviously, going out to dinner, I would just put the Dexcom in my pocket.

The Dexcom requires a windows driver and has proprietary code.  I should be able to "tell" the Dexcom to dump an XML file without using the studio.  Can I write a linux compatible driver, or again, use Wine.  This would definitely be capable of running on a Pi, then.  I have a working obsolete Dexcom 7 that is about to undergo some serious hacking.

And finally, the TI Chronos watch.  This is a product well on its way to obsolescence.  It only has a range of about 10 feet, which doesn't meet my gym requirement.  It's also fairly ugly.  Development looks like a nightmare, and not all features are accessible.  I have development environments configured in Linux for Open Chronos and Open Chronos NG.  I think neither of these supports the BlueRobin module though.
At a minimum, I'd like to get the glucose reading underneath the time, currently it occupies its own screen.

The MetaWatch looks like a better candidate.  This is TI's replacement for the Chronos.
Although, of all the Smart watches, the Sony looks best at the moment.  Glucose readings could be easily displayed on the Watch using a twitter feed.  Communicating with any of these watches looks like it would require a Smart Phone acting as a hotspot for the software that's reading from the Dex.  Then some mechanism to send the glucose reading as a text message, through the smart phone, to the watch.  

Looks like smart phone development is probably in my future...

Wednesday, May 15, 2013

Getting the glucose number from the Dexcom


It's hard to see in the photo, but the watch is showing the same value as the Dexcom.  

Now to get the current glucose reading from the Dex.  There's a software package, Dexcom Studio that comes with the Dex for downloading data from the gadget.  Interestingly, it's all written in C#.  Poking around in a $500 medical device's undocumented code, though, is something I'm not going to post...

Need another, "easier" way to get these numbers...  Playing around with the Dexcom studio software shows that it will download all of the watches data to an XML file, bingo!  A little C# code, and liberal use of the "sendkeys" command, and I can open and close the studio, and dump an XML file every few minutes.



Now, I can easily parse the file and get the Glucose value.  Using the process from my last posting, I can get the number onto my watch.  Success!

Sunday, May 12, 2013

Creating a Glucose Monitor Watch

One of the greatest improvements in Diabetes care in the last 20 years is the Continuous Glucose Monitor(CGM).  Dexcom makes arguably the best of these gadgets.  Currently, the monitor is an iPod Nano like gizmo that fits nicely in the pocket.  Still, it doesn't pass as a cellphone.  Additionally it's expensive.  There's no way around spending the money(or your insurance companies money), but destroying it by accident is best avoided.
All this technology, why can't I have my glucose reading in a watch.  One point that the industry appears blind to, is the people that have to use these things, would really like it if they could be better hidden.

So, how to get the numbers off of the Dexcom and send them to a "smart" watch ?  Additional bonus, the Dexcom can be safely stored somewhere near by and better protected from destruction when I'm on a dirt bike ride.  Also the form factor of the watch, allows me to keep track of the numbers when I'm kickboxing, since the monitor won't survive a hit.  Also, the smart watches are about half the price of a Dexcom unit, so they can be sacrificial.  The one I'm starting with is 1/10th the price.

Texas Instruments has an interesting product, the eZ340-Chronos, that's been out for a while.  I purchased one from Sparkfun.  The goal for the watch is to be able to send a number to it.  After a lot of time on Google, it became clear that the intent of the watch is to send limited information, not receive it.  The only receive mechanism that appears it would work, ie. display a glucose reading , real time, is the BlueRobin  heart rate monitor component.  The BlueRobin component isn't part of the watch that's really meant for developer customization.  A demo app for the Chronos, "Control Center", includes a sample program that sends "fake" heart rate values to the watch, exactly what I want.


I wasn't able to find source code for this product, and what code/documentation I could find for the BlueRobin  module, just confused me.  So, I loaded a Serial Port Monitor software package, and watched the packets being sent to the watch as I ran the demo.  What I found was:
Sending Hex "FF 02 03", starts BlueRobin .
Sending Hex "FF 05 04 XX" sends a number to the watch.  Where XX is the Hex representation of the integer I want to send.

Success, I can send a number to the watch, now to get the number!