Friday, September 27, 2013

Software Improvements

I've had a while to field test this.  Lost one watch water skiing.  Some issues that have been bothering me:
  1. Since the RasPI doesn't have an internal clock, and the MetaWatch resets each time you re-charge it (ridiculous), I have to spend a few minutes with the RasPI networked to get the time correct.  Not ideal, this needs to be as close to "grab and go" as I can get it.
  2. Bluetooth issues.  This thing uses "bleeding edge" bluetooth.  I create a new bluetooth connection to the watch every time there's a new value to send.  Intermittently, I start getting "bluetooth.btcommon.BluetoothError: (113, 'No route to host')" errors.  Sometimes the device recovers, or I just reboot the PI and things go back to normal.  

The Time Issue:
Finally figured out how to get the current time from the Dex.  I do this on startup and set the RaspPI system time to the current time reported by the Dexcom.  This keeps everything in sync, and gives me a functional watch to boot.  One of many "interesting" issues here, C# on Debian doesn't do dates.  Huge bug.  Luckily, I can pass "Seconds since the epoch" to the Unix date function and it does it for me.

I've been using "/etc/init.d/bluetooth restart" after every call to the watch.  Randomly, the bluetooth device time's out, and stays unreachable.  Determined today that calling "hciconfig hci0 reset" fixes that issue.  So now I'm using hciconfig after every call instead of restart.


  1. this blog is great, i guess where ever there is technology, there will be hackers. If you have time could you come up with a tutorial to bypass the two hour start up and possibly a solution for mac osx users!

  2. Very interesting! Would still very much like to connect, to talk more about possibly writing a blog post on your work and adventures for DiabetesMine! You can find me at mike {at} diabetesmine {dot} com. Thanks!

  3. Dan, did you ever figure out how to get the Dexcom Studio running in Wine? I've tried several ways with no luck. I found it needed DotNet4 to even install, but it throws an exception when I try to run it. Any advice would be appreciated. My wife is Type 1, and would like to use the Dexcom software, but this is an Microsoft-free house, and I'd hate to have to build/dedicate a machine for installing Windows for just one piece of software.

    1. For my purposes wine isn't remotely possible on a Pi, wrong architecture. You might want to look into a Virtual Machine.