Saturday, October 4, 2014

Thursday, May 22, 2014

Calibration Data Part 2

Accidentally deleted the other post, when I tried to update the formatting.  Here's another go, this time with a 7 day old sensor, transitioning to a 0 day old sensor :).  Interesting here to see how the Intercept doesn't change.  Slope was 906 before recalibration, SAME intercept.  This sensor has had other intercept values, most recently 27626.

                                                                                                                -rc (02 2D)--
01 16 02 01 87 06 00 00 03 00 00 00 05 02 2D 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA 57
----date---- -- date ---  --slope=767  ----------  
FD C9 1F  0A 94 92 1F 0A  4B 4B 4B 4B 4B FB 87 40  
Intercept=30000--------
00 00 00 00 00 4C DD 40   00 00 00 00 00 00 F0 3F  03 06 00 00 00 00 00 00 00 00 00 02


-- Date---  --gluc--    --counts-   --date ----
D4 C9 1F 0A 88 00 00 00 E0 0C 02 00 67 C9 1F 0A 00
DE C9 1F 0A 88 00 00 00 E0 0C 02 00 67 C9 1F 0A 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BD B4

With two more calibration data points, slope is at 820, intercept continues to be unchanged.


Wednesday, May 21, 2014

BLE and other new devices

RFDUINO
I got on a kick a while back to use the RFDuino.  The size was appealing and I imagined it could do some things it can't.  For BLE devices, there are two roles, Central and Peripheral.  Watches are peripherals, as is the RFDuino, an iPhone is a Central.   So, after much head scratching, I've realized I can't connect an RFDuino directly to a watch.  Kind of a show stopper.  Other issues with the RFDuino, which may or may not be imagined:
1.  If you use the one and only serial port for something, you can't use the USB for debugging output.  Typical problem with single Uart microcontrollers, but this is why I like the Teensy and Mega ADK.  It's hard hacking when you're running into constraints.  In this case, you run out of options for debug output, and are down to blinking led's.
2.  The programmer is cumbersome, and you need to unplug the board from the circuit to re-program.
3.  When you google this product, mostly what you get are items related to the kickstarter.  Lots of people bought these, then went back to their caves and vanished.  There are few write ups on actual projects out there.

WIXEL
Another strange bird.  Will make you appreciate what the Arduino empire does well.  Constant "service" calls required to keep Serial output open, otherwise "stuff" just shuts down.  Want a simple delay statement, forget it, you'll lose your serial out.  Also, I've noticed that uploading new code, doesn't always happen, although it says it did.  The compiler for this thing is slow.  And then there's the lack of memory.  But, we're all using this for a very good reason, so deal with it...


Wednesday, May 7, 2014

1 year anniversary

Thought I'd summarize where I'm at now.  About a year has passed since I first wrote some C# to automate keystrokes and get glucose readings from the Dexcom Studio Software.

Now I use this:



I'm getting 22 hours on a charge.  This will keep me through racing season this year.  It's reliable, and I'm now using it every day.  I've gotten the watch to hold a charge for about 4 days.  There's a magic "sniff" setting that makes all the difference.

Now I'm working towards a keychain sized receiver that will use BLE to send packets to the watch.  All the pieces are there, I just need the time to put it all together.

That's hard now that the weather is decent again.

Wednesday, April 30, 2014

Evaluating the Rfduino

Got the rfduino in the mail this week. Unfortunately, I got the smt version.
Here's a couple of hours out of my Sunday.

Thursday, April 24, 2014

Matching up Meter Records to Packet Sniffer


Finally matched up some of the packet data to a sensor record on the Dexcom.  Assuming this is the raw counts from the sensor.  Probably should be using all 4 bytes here, not just 3.

88 mg/dl
BD 52 FD 09 54 1B FD 09 C0 93 01 00 70 84 01 00 C8 00 05 93  :From sensor data record
3C 99 E2 1E                                                                                      :From packet sniffer
00111100100110 01111000100001 1110                                        :Convert packet to binary
00111100100110 Reverse->01100100111100 ->193C                    :Reverse the first 14 bits
                                                                                                            And back to Hex

96 mg/dl
15 55 FD 09 AC 1D FD 09 90 99 01 00 70 9C 01 00 C5 00 C2 38  :From sensor data record
packet 99 99 E3 9E                                                                             :From packet sniffer
10011001100110 01111000111001 1110                                          :Convert packet to binary
10011001100110 Reverse->01100110011001=1999

95 mg/dl
41 56 FD 09 D8 1E FD 09 20 9C 01 00 00 9B 01 00 C3 00 29 04  :From sensor data record
packet 43 99 0D 9E                                                                           :From packet sniffer
01000011100110 01000011011001 1110                                        :Convert packet to binary
01000011100110 Reverse->01100111000010 =19C2


95 mg/dl
99 58 FD 09 30 21 FD 09 30 A3 01 00 C0 9A 01 00 BA 00 EE 50  :From sensor data record
packet CC 59 35 9E   :95                                                                   :From packet sniffer
11001100010110 01001101011001 1110                                         :Convert packet to binary
11001100010110 Reverse->01101000110011 = 1A33


120 mg/dl
F9 61 FD 09 90 2A FD 09 80 E2 01 00 E0 D1 01 00 BA 00 DB D0  :From sensor data record
Packet 14 79 78 BE D8                                                                        :From packet sniffer
00010100011110 01011110001011 1110                                           :Convert packet to binary
00010100011110 Reverse-> 01111000101000 =1E28


The sensor data records look like this:
--date------------  --date------------    ----counts---------     --second set ?---                
FD 3F FD 09 94 08 FD 09  20 90 02 00  00 96 02 00 C0 00 14 00 
29 41 FD 09 C0 09 FD 09  C0 85 02 00  80 8D 02 00 C0 00 8D 43 
55 42 FD 09 EC 0A FD 09  60 7F 02 00  E0 88 02 00 B7 00 31 00 
81 43 FD 09 18 0C FD 09  00 7B 02 00  20 84 02 00 AD 00 67 55 
AD 44 FD 09 44 0D FD 09  00 67 02 00  A0 7C 02 00 C4 00 3C D3 
D9 45 FD 09 70 0E FD 09  A0 45 02 00  40 6F 02 00 CA 00 E3 58 
05 47 FD 09 9C 0F FD 09  60 26 02 00  80 59 02 00 B2 00 D7 99 
31 48 FD 09 C8 10 FD 09  60 FE 01 00  80 3A 02 00 B4 00 52 53 
5D 49 FD 09 F4 11 FD 09  90 C1 01 00  80 12 02 00 B6 01 94 6F 
BD 52 FD 09 54 1B FD 09  C0 93 01 00  70 84 01 00 C8 00 05 93 
15 55 FD 09 AC 1D FD 09  90 99 01 00  70 9C 01 00 C5 00 C2 38 
41 56 FD 09 D8 1E FD 09  20 9C 01 00  00 9B 01 00 C3 00 29 04 
99 58 FD 09 30 21 FD 09  30 A3 01 00  C0 9A 01 00 BA 00 EE 50 

Tuesday, April 22, 2014

There is a Pattern

Houston we have a pattern


AF 89 AA 4E : 76   1010111110001 001 1010101001001 110
28 49 55 4E : 77   0010100001001 001 0101010101001 110
A9 49 DE CE : 80   1010100101001 001 1101111011001 110
8D 49 AF 4E : 81   1000110101001 001 1010111101001 110
E3 49 BC 4E : 82   1110001101001 001 1011110001001 110
10 C9 37 CE : 83   0001000011001 001 0011011111001 110
CE C9 E2 2E : 86   1100111011001 001 1110001000101 110
67 29 4E 6E : 97   0110011100101 001 0100111001101 110
9B A9 66 EE :103   1001101110101 001 0110011011101 110
C3 A9 AD 6E :103   1100001110101 001 1010110101101 110
28 69 AF AE :105   0010100001101 001 1010111110101 110
5A 69 0D 6E :107   0101101001101 001 0000110101101 110
9B 69 F8 1E :110   1001101101101 001 1111100000011 110
7B 69 74 6E :110   0111101101101 001 0111010001101 110
69 E9 A9 1E :115   0110100111101 001 1010100100011 110
93 99 E7 EE :117   1001001110011 001 1110011111101 110
F9 19 97 1E :122   1111100100011 001 1001011100011 110
FF D9 1E 5E :135   1111111111011 001 0001111001011 110
C0 39 BD 3E :151   1100000000111 001 1011110100111 110
B3 B9 EE 7E :163   1011001110111 001 1110111001111 110
F6 B9 0E 7E :163   1111011010111 001 0000111001111 110

Pulling out the BOLD portion, flipping it around:
1111011010111 reverse bits->1110101101111 7535   :163
1001101110101 reverse bits->1010111011001 5593   :103
1100001110101 reverse bits->1010111000011 5571   :103
1010111110001 little endian->1000111110101 4597   :76

The other stuff should be background...
The other set of data looks very similiar to the data in bold.
I'll reformat this tonight when I have access to a real browser.