Saturday, May 14, 2016

Smartstrap Debugging



It's getting near to a year on the transmitter, so I needed to get my battery levels to the watch, where I can keep an eye on it.  The current plan is to add a battery to an old "thick" transmitter that I have saved.  This will give me a backup, while I try to change the batteries in my current "thin" transmitter.  There are some excellent tutorials out there, so expect to hear something about that over the next few months.  Currently the battery is at 0xD6.

Meanwhile, I needed to get the battery levels to the watch.  This didn't go smoothly, and I was frustrated by the lack of debugging information since I'm bound directly to the watch, so cloud pebble can't help me.  A while back I looked into the smartstrap functionality, but for day to day use, the amount of hardware would be bulky, and the connector looked problematic, and the parts are extremely small.  I went as far as having shapeways print the connector for me, but it didn't come out right.  Anyway, I realized this would be perfect for debugging.  So, above, you see a Teensy 3.1, a WT12 bluetooth module and a Wixel.  Took 2 days to get all this working, but I now have battery levels, and a way to see what's going on in the watch.

I also want to get the Pebble pairing code onto the Wixel, which would allow me to re-pair or add another watch to the module I carry, without hooking jumpers to everything and wiring up a Teensy when I need it.

The Pebble round is working great after some of the initial horrors.  Earlier, the Pebble update process was problematic, one update blew away my pairing to the WT12.  Also, the watch is stable now.  No guarantees, but I'm not seeing app restarts any longer, and I've got the calibration persisting.  It still appears possible to lose it, at least on my Pebble Time, possibly when bad code causes the app to crash outright.  Life on the bleeding edge, I can deal.

Another interesting feature, at least with the Round, the WT12 is paired using bluetooth, but the BLE channel is still accessible.  One day, I noticed by accident that the Pebble was still able to show me the Weather and Sunrise/Sunset day summary.  I should be able to pair the BLE Mini with the watch and maybe push glucose values to it.  Would allow me to store readings someplace (if I felt the need...), I add a custom alert device to really wake me up at night, the vibration on the Round doesn't wake me up as quickly as I'd like.  My other thought is changing the Pebble app to require a double tap to stop alerts.  I'll probably add this first, then do the hardware thing some rainy day.

Finally, thought I'd include a picture of the current device.  Similar to the part mockup in an earlier post.
This time, I used a small amount of hot glue to put the parts onto a piece of paper, then wired everything point to point.  This avoids the added thickness of a PCB.  If I do it again, I'll use smaller wires.  Also the "dead bugged" WT12 doesn't appear to interfere with the Wixel, which was a happy surprise.



Update:  Be careful when updating the Round with new code.  If it doesn't show you a status bar indicating an app is being loaded, it's not actually loading it.  Cloud Pebble will report the installation as successful.  From the Pebble app, you may see your application in the unsupported apps's category.  Remove it, then redeploy.