tag:blogger.com,1999:blog-20901211412667184322024-02-19T09:06:46.238-08:00CGMS WatchUnknownnoreply@blogger.comBlogger62125tag:blogger.com,1999:blog-2090121141266718432.post-92136656804102920662022-07-18T13:31:00.004-07:002022-07-18T13:33:19.429-07:00Finally on the G6<p>Not really a celebration, but anyway.</p><p>Finally ran out of my G4 sensors, and it was also transmitter battery replacement time. I found that the transmitters were lasting shorter amounts of time with the last few replacements. </p><p>It took all of a week before I had to hack together a solution so I could get back my predictive bg readings and push the data to my Garmin. I couldn't see buying an iWatch, the battery life is terrible. Additionally, I'm underwhelmed by whatever app dexcom would be providing.</p><p>I've got this running on a Raspberry Pi that I always have around for Unix things. It was fairly easy. I'm using cron to call a python script every minute that connects to share and gets my glucose. </p><p>I then store the value in a mysql database, do my analytics and send a notification to my Garmin if necessary. I wasn't looking forward to writing another iPhone app, so I found an app called Pushover that handles this perfectly.</p><p>I miss my 2 hour snooze function, but I'll live.</p><p>The one downside to this, is it won't work when I'm mountain biking in parts of Vermont. I have to rely on just the phone app when I'm out of network.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-10887192224455134422021-09-22T12:21:00.000-07:002021-09-22T12:21:15.459-07:00Slowly moving to the G6<p> Finally Picked up a few G6's. Still on the G4 until next year, but I had a chance to get an ESP32 to talk to the thing. So, hopefully, when I finally have to downgrade, I can at least keep the functionality I want.</p><p>New device, ESP32 TinyPico, total size 1 3/4 square and about the thickness of a cell phone, perfect. Battery life was around 17 hours, it's a power hog. Nice feature is the pico has onboard lipo management ie. charging.</p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNzlgx3NyEFX8OrJChKcoVIoSKOlUdp7hiNLNi4_I-zRoWZwTe_G3nLUt3lBKwTU3YiJpzZlqROqWFbLu8tZOGYXPThYciKLDX4bQJ6mnYMzSaGj1y3I6Yy1MZidID7DPIeh-PstrckTU/s2048/IMG_0939.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNzlgx3NyEFX8OrJChKcoVIoSKOlUdp7hiNLNi4_I-zRoWZwTe_G3nLUt3lBKwTU3YiJpzZlqROqWFbLu8tZOGYXPThYciKLDX4bQJ6mnYMzSaGj1y3I6Yy1MZidID7DPIeh-PstrckTU/s320/IMG_0939.jpg" width="240" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbxjn7URkKZ_-nFd_z_ZvNxfewiiByJplnTizfXCpLoennYpfzgz4KXLDeE9mPW3aJa9umS-FD362stf7CHpNuqGf54eHARhUsQEJzfGL0KIxhh7RtjZzOO12vYjfYfy4YvqScsq_JW4E/s2048/IMG_0938.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbxjn7URkKZ_-nFd_z_ZvNxfewiiByJplnTizfXCpLoennYpfzgz4KXLDeE9mPW3aJa9umS-FD362stf7CHpNuqGf54eHARhUsQEJzfGL0KIxhh7RtjZzOO12vYjfYfy4YvqScsq_JW4E/s320/IMG_0938.jpg" width="240" /></a></div><br /><p></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-56139893318628198842021-02-16T12:16:00.003-08:002021-02-16T12:16:51.602-08:00New Gadgets<p> </p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-KlGjmkIlY9UFJV5qDNnJDejopCZ3fXiGU9xjmdkN83U8-Wyy5sEBiuXO64sZiAMSaBYPRzXWEJzdHNpFLLF5gNq1j6VCMHWE2gyAE_7whnkaN3g5hFFLWDBmuPeWvKrBTqvhjc9xuOM/s2048/IMG_0839.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1694" data-original-width="2048" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-KlGjmkIlY9UFJV5qDNnJDejopCZ3fXiGU9xjmdkN83U8-Wyy5sEBiuXO64sZiAMSaBYPRzXWEJzdHNpFLLF5gNq1j6VCMHWE2gyAE_7whnkaN3g5hFFLWDBmuPeWvKrBTqvhjc9xuOM/s320/IMG_0839.jpg" width="320" /></a></div><br /><p></p><p>Trying out the Bangle and the Puck. Both support BLE, so might be able to Pair with a G6.</p><p>We will soon find out. Bangle is really big, also need to see what the battery life is. The Puck could replace the custom device I carry around, it's slightly smaller, but I'd be burning up Cr2032's. I could live with 1 a week for the size improvement. In either case, these would replace a cellphone.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-13996029734013066252019-10-14T10:14:00.002-07:002019-11-06T06:24:24.063-08:00Adding the Amazfit Bip<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRwbRqlrQiQIo1bRkMpU6AP0-YnNWHVo2kmxrBOOJCuXf2fBk2vwLQlh8dLmmVOB2nxUJ-lnURtKMFSwzQgHYzj6_RTjkUATgjVdSl1vvVPx2z9_vwcpqOuxVzoFCXFHRBaZk84uN9xho/s1600/amaz_bip_msg.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="1600" data-original-width="1248" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRwbRqlrQiQIo1bRkMpU6AP0-YnNWHVo2kmxrBOOJCuXf2fBk2vwLQlh8dLmmVOB2nxUJ-lnURtKMFSwzQgHYzj6_RTjkUATgjVdSl1vvVPx2z9_vwcpqOuxVzoFCXFHRBaZk84uN9xho/s320/amaz_bip_msg.jpg" width="249" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLthWIBDeW-o5IaZ5W-L3kxsjMrY2LINdLL8AHXoJnyP0Evami7IMnIyVFExgZ_dYDqgW4bFyXsgUK5C0tGILG8MA-qoqwz_A-yNZsV83BVkEzlQV-SouoxGAQJJeJhC5n44FlUXLXeWs/s1600/amaz+bip.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1047" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLthWIBDeW-o5IaZ5W-L3kxsjMrY2LINdLL8AHXoJnyP0Evami7IMnIyVFExgZ_dYDqgW4bFyXsgUK5C0tGILG8MA-qoqwz_A-yNZsV83BVkEzlQV-SouoxGAQJJeJhC5n44FlUXLXeWs/s320/amaz+bip.jpg" width="209" /></a> </div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Here's the Amazfit Bip Watch. Example of the regular watch face and notifications. The notification is, estimate 100 mg/dl, 80 mg/dl in 12 minutes, falling.<br />
<br />
This continues to be a battle to stay ahead of product obsolescence. My Amazfit Band died after 10 months. It would no longer charge. The root problem was most likely that it was no longer waterproof. The thing basically fell apart in my hand while I was trying to attach the charger.<br />
<br />
Potentially tricky using the Amazfit products now. The new firmware requires a server generated key. So, you have to activate the watch with your phone, using the MI app. But don't let the app update your firmware, when it starts to do that, close the app. Then go to Arduino and do the pairing as you normally(how much of this is normal?) would. A shame, there's allot of interesting functionality on this watch, but I can't use it.<br />
<br />
On deck, I'm messing around with the Ticwatch, which is Wear OS, which used to be Android Wear. This isn't going well. Like my previous battle with Android Wear, I can't keep bluetooth up for more that 6 hours, at some point the watch decides it's inactive and shuts everything down. You can't restart bluetooth without rebooting the watch. On top of that, ambient mode changed, and the watch is only good for about 11 hours. It's also clunky and huge. The cool thing with this project is calibration can be performed on the watch. Almost back to the functionality I had on the Pebble Round... So close, yet so far.<br />
<br />
---10/15/2019 Update----<br />
Way to many features on this watch to not risk letting it update it's firmware. Did not remove my pairing, so good to go.<br />
<br />
---10/19/2019<br />
Continue to be amazed with this watch. Battery is going to last nearly 2 weeks. Using the GPS on runs, integrates with Strava. I'll probably ditch the Vivosmart in the near future, although I do like the Garmin software. Updated the fonts to Bold, can easily read it now. Don't think I'll be wasting anymore of my time on Wear OS/Android Wear. Why deal with a wearable that requires daily charging?Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-40368449115914717742019-09-30T07:20:00.002-07:002019-09-30T07:20:53.633-07:00Joys of iPhone UpdatesThe recent iPhone update really screwed with my iPhone app. Have to renew my Dev license and see what's up.<div>
<br /></div>
<div>
App works if I leave it open, and close the phone. </div>
<div>
Sometimes, it appears that is goes to sleep, no glucose readings are evaluated, until I open the phone, then it instantly reconnects and pulls in a value. Maybe I backgrounded the app in this case.</div>
<div>
<br /></div>
<div>
It's really bad at discovering the bluetooth device now. It will scan for about a minute and then shut down. I don't think it will connect at all from the background.</div>
<div>
<br /></div>
<div>
And all of this behavior varies. Best bet is to keep it wide open, with the screen on, if I need to use it.</div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2090121141266718432.post-14749545983039639422019-09-19T11:30:00.001-07:002019-09-30T07:23:04.807-07:00Wahoo Elemnt as a CGMSOr really, any BLE compatible HR Monitor.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho2urKU1jWQLucynMCzpjrnOaiqwgYMgOQ45fIr8-E6ZYVjUCTXex3pVA1VvZ0OfvvEW1odShHMfOdSzr7-scTya47bJZvaXNI7IA7vUop-5AOagXne9Mx3WDjIoAR63pjrrkXVtape78/s1600/wahoo_element_cgms.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1136" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho2urKU1jWQLucynMCzpjrnOaiqwgYMgOQ45fIr8-E6ZYVjUCTXex3pVA1VvZ0OfvvEW1odShHMfOdSzr7-scTya47bJZvaXNI7IA7vUop-5AOagXne9Mx3WDjIoAR63pjrrkXVtape78/s320/wahoo_element_cgms.jpg" width="227" /></a></div>
<br />
Was doing a mountain bike race this weekend, and was once again reminded of how I'd like glucose on a display I could easily see. The watches, fitness bands etc. don't show up very well in bright daylight.<br />
<br />
This is something I'd wanted to do with ANT+ years ago, but there wasn't any convenient dev board, and I'm not sure if I ever worked out how to appear as a HR Sensor.<br />
<br />
This is much easier to do with bluetooth. Since I'm using the Adafruit NRF Feather, it was easy to lift their sample code for the custom_hrm. And you see it above. I can now track my blood sugar from my handlebars, 169 in this case.<br />
<br />
9/30/2019 This is good up to 229, then it wraps around and/or doesn't reliably show a number.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-63121643031788546622019-01-23T14:57:00.001-08:002019-01-23T15:42:56.418-08:00Adding the Amazfit Cor<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoWpuiRfthFcUa_Daa-vP6DcCkNw4AdgCZIK5W-cwFFWpqOYwo2Do8rhQYcAt3KWfROLFkBWPh5gahzP0HYZ_7I62Viryu4Rp-9F1DS4IAbIVVUE955fwhpf4V0j6qFVKscG4Hyxu2P-g/s1600/amazfit_cor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="880" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoWpuiRfthFcUa_Daa-vP6DcCkNw4AdgCZIK5W-cwFFWpqOYwo2Do8rhQYcAt3KWfROLFkBWPh5gahzP0HYZ_7I62Viryu4Rp-9F1DS4IAbIVVUE955fwhpf4V0j6qFVKscG4Hyxu2P-g/s320/amazfit_cor.jpg" width="176" /></a></div>
<br />
So, I use reading glasses. The MI Band 2 is hard to see at times. In the middle of the night and while driving, the notification will go away before I can focus.<br />
<br />
According to Gadgetbridge, the Amazfit Cor uses the same "OS" as the MI, so I picked one up. I can definitely read the display. <br />
<br />
Added bonus, you can go to the notification screen and review the past 10 messages, which is nice since the MI just erases them after 2 seconds.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-2090121141266718432.post-26337578562842560162018-11-21T13:28:00.000-08:002019-01-14T07:02:09.034-08:00Standalone fitness band<div class="" style="clear: both; text-align: left;">
I now have a MI Band displaying Glucose without a paired iPhone. You just need the iPhone to push the calibration details to the device.<br />
<br />
Lots to do here:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>Get the CC2500 code working on the Feather (SPI protocol)</li>
<li>Get central to MI communication working. Adapt what people have done in Python, to work on the Arduino. See <a href="https://medium.com/machine-learning-world/how-i-hacked-xiaomi-miband-2-to-control-it-from-linux-a5bd2f36d3ad" target="_blank">https://medium.com/machine-learning-world/how-i-hacked-xiaomi-miband-2-to-control-it-from-linux-a5bd2f36d3ad</a> for a start.</li>
<li>Also code the peripheral side so the feather can communicate with an iPhone, pushing the isig and retrieving the slope/intercept.</li>
<li>Build the circuit</li>
<li>Print a container</li>
<li>Get a reasonable battery life</li>
</ol>
<div>
<br /></div>
<br />
<div class="" style="clear: both;">
First started with everything on a breadboard, Feather NRF52 and a CC2500 board on a breakout.</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEMWsoeCvp_wuwi7W5Lxt9UIPBAhJUl66kKBQhWlMjp88iOidIZ4YNmiRXzkmridV0_dG_opjDkZWvGrtHEGb2ZlaL4lvg3R_oQlJ7rdola2AfCmbL-k3T7zTQ5esIm6Qca5NLj3KOz9I/s1600/IMG_0315.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1501" data-original-width="1600" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEMWsoeCvp_wuwi7W5Lxt9UIPBAhJUl66kKBQhWlMjp88iOidIZ4YNmiRXzkmridV0_dG_opjDkZWvGrtHEGb2ZlaL4lvg3R_oQlJ7rdola2AfCmbL-k3T7zTQ5esIm6Qca5NLj3KOz9I/s320/IMG_0315.jpg" width="320" /></a></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Getting the CC2500 working wasn't too bad. Only some question as the where the Chip Select/Slave Select pin was on the feather. I recently found some mention that it was A8. My code has it on A3, since I couldn't find where it was mapped initially.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Central to MI took allot of time, knew that going in. To really understand what was going on, I had to get that working first in Python on a Raspberry PI. This guy had a great script: <a href="https://github.com/vshymanskyy/miband2-python-test" target="_blank">https://github.com/vshymanskyy/miband2-python-test</a> . </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hardest part of the conversion is doing the AES 128 ECB encryption for the key exchange with the MI. This reminded me of communicating with the Dexcom back at the start of this blog where you had to calculate a CRC. In either case, there are lots of methods available, and lots of public implementations that may or may not work. I probably tried 10... In the end <a href="https://github.com/rweather/arduinolibs" target="_blank">this</a> did the trick.</div>
<div class="separator" style="clear: both; text-align: left;">
Finally, very little out there for Central samples.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The peripheral side of things was tricky for me because of the way the iPhone caches BLE Characteristics. For a couple of days, I could enumerate my new characteristics from Linux, but the phone, and xCode and light blue wouldn't show anything. Turns out you need to restart your phone.</div>
Modified my iPhone app to work with the new device and finally display the dexcom transmitter battery level.<br />
<br />
With that, squeezed together a circuit:<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-TW-DfyWjfaEzNskm15rkZtCHwMQ-0QeUkdCKyuu1gXclMfiqVKnp6cowWtwOfymp1VLcV8NZHwdT5np3PH9etKyXmMg8VRN_lS8p483MjiMITa_xDPVgdTDC6O85vyxrY7y2ON-BYS8/s1600/IMG_0316.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1325" data-original-width="1600" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-TW-DfyWjfaEzNskm15rkZtCHwMQ-0QeUkdCKyuu1gXclMfiqVKnp6cowWtwOfymp1VLcV8NZHwdT5np3PH9etKyXmMg8VRN_lS8p483MjiMITa_xDPVgdTDC6O85vyxrY7y2ON-BYS8/s320/IMG_0316.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I may do a PCB in the future, I don't trust the wires. Also, would have been allot easier. The connections on the CC2500 are very small, not easy to solder to.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And printed another box, 2.25 x 1.6 x 0.4 (inches)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7gTFa1xRqbAwQ0RvlgvaQ06GB8YUzfmV2BtxKDOiwuvno2DAMD4EKxsDF5kMejk_Vq2_KnJo2uQSQivPIv4bIjll1-AHOopgFssHtKWiy4POwjimrIU1TD1fBohu6kz8nq1SST-zHJ3U/s1600/IMG_0317.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1384" data-original-width="1600" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7gTFa1xRqbAwQ0RvlgvaQ06GB8YUzfmV2BtxKDOiwuvno2DAMD4EKxsDF5kMejk_Vq2_KnJo2uQSQivPIv4bIjll1-AHOopgFssHtKWiy4POwjimrIU1TD1fBohu6kz8nq1SST-zHJ3U/s320/IMG_0317.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
First week, could only get 12 hours on a charge. That works out to 9 ma/hr. Broke out the current measuring apparatus and started watching things. My initial central only sketch was hitting 9ma on pairing then settling down to 3ma, but the full code base was fluctuating between 9ma and 13ma after the first CC2500 receive event and refusing to drop below 9ma. Hmm.</div>
<div class="separator" style="clear: both; text-align: left;">
Did some desperation googling, found a Nordic post on how some low level errors will prevent the Microcontroller from ever entering low power mode. A note here, you can run the NRF52 in debug mode and get some extra detail in the serial monitor. In this case, I noticed a few unhandled error messages, that don't crash the micro, but they prevent low power mode. An example of one, would be attempting to connect to a peripheral after you've already established a connection. The central examples that come with the feather are prone to this... Fixed these issues, battery life is now 3 ma/hr or lower. Codewise, doesn't appear that waitForEvent has any impact on battery, delay does.</div>
<div class="separator" style="clear: both; text-align: left;">
99% of the time, the device is at 2.5ma, the CC2500 uses 27ma for 2 seconds every 5 minutes, and communication with the MI costs 9ma for a few seconds every 5 minutes or much much less, since I don't send value every 5 minutes unless the current glucose level is a concern.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Nothing to be gained space wise, so no point going to a smaller battery, done.</div>
<br />
Display is a bit small, and the regular notifications are cleared very quickly. The real alerts vibrate until dismissed so you'll get to read those without issue. Like the VivoSmart, I'm not displaying glucose in the traditional manner. Example, if my blood sugar is in range, and not at risk of being high or low in the foreseeable future, nothing is sent to the band. If I'm really paranoid I can always check on the iPhone. Battery life on the MI is weeks. You can also still connect to MI Fit to get your step counts, although I don't let it pair.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
See my <a href="https://github.com/brownedon/feather_cgms" target="_blank">github</a> for the code. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<br />Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2090121141266718432.post-8768059516511624602018-10-23T12:58:00.000-07:002018-10-24T11:00:57.133-07:00BLE Dual Mode finally coming upStarted poking around at my many year old (and mostly useless) BLE Nano's. Turns out they're supposed to be able to support S130. After a few hours, gave up, and finally threw them out so I won't waste more time on them next year.<br />
<br />
A little more googling, turns out Adafruit has a feather that does S130 (actually S132 in this case).<br />
So...<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSWYMukQBEObLmXSq7RBmXvCh4hc8Rp6a2U8UBLN-sQHHRSbNJwJLqJUGatdvegnHrxK-B8zFKRLB19lq9DKdhznHpayEbFOSGKCZDZk6qcKqDLbDN602pKOqaEWvro_j_5U5iBruKTYI/s1600/IMG_0312.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1201" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSWYMukQBEObLmXSq7RBmXvCh4hc8Rp6a2U8UBLN-sQHHRSbNJwJLqJUGatdvegnHrxK-B8zFKRLB19lq9DKdhznHpayEbFOSGKCZDZk6qcKqDLbDN602pKOqaEWvro_j_5U5iBruKTYI/s320/IMG_0312.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Vyp0P9UFIPyNTI3s4gWeQpzRQft4Pv1vzxwyyIyWpuCcLVQnvBtge7bIqlS825d41z17gXuS0awsn8Josq5hdD0LcwBwsVkkdJLKGo7roLBvUHtfevpW1IICohHnOj4CH9N16l7L1sM/s1600/Untitled.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="705" data-original-width="559" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Vyp0P9UFIPyNTI3s4gWeQpzRQft4Pv1vzxwyyIyWpuCcLVQnvBtge7bIqlS825d41z17gXuS0awsn8Josq5hdD0LcwBwsVkkdJLKGo7roLBvUHtfevpW1IICohHnOj4CH9N16l7L1sM/s320/Untitled.jpg" width="253" /></a></div>
Add this doo dad:<br />
<br />
And I have a phone free CGMS, again.<br />
<br />
So, with the Mi Band I can get custom notifications to it from Xcode, you can also send a notification that will make it buzz until you acknowledge, very cool. Just have to convert all the Xcode for pairing etc. to Arduino land. More on that later, much later.<br />
<br />
Onto the hardware. The feather can serve as Central to the Mi Band (ie. masquerade as a phone) and as peripheral to the iPhone. It can be a casual relationship with the iPhone, where the phone is just a front end for calibrations, everything else lives on the feather, no phone, no problem.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2090121141266718432.post-82849583151006683622018-09-04T07:38:00.000-07:002019-06-11T05:46:20.042-07:00Battery Replacement<span id="goog_29348672"></span><span id="goog_29348673"></span>After many years, I've finally managed to replace the batteries in a G4 transmitter.<br />
Dying batteries is what compelled me to figure out the RF protocol years ago. At the time my transmitter died just after 6 months, so a replacement wasn't covered by insurance. There never was a warning from the device.<br />
<br />
Over the last few weeks I've watched the battery level run down to where it dipped from 212 to 210. Allegedly the point at which a Dexcom receiver will tell you to order another. Was still functioning at 212/210, but range seemed diminished and definitely noisier. I finally pulled it when it gave me a reading that was half of reality (something like 90 for a 175).<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3-NJgDVCc9wz2bMQYTxdKGf2q1Obx4g8RIC0H8EOdrw3wqTQN7ggXxZn2u0Vl_MW_UCSlZJ87DdaXJni5zZ77nKhl-QxHhcvCzBcJEG2lOjKc8h9fKC5rr1J48pRtksjADWejH5kU8wY/s1600/IMG_0284.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3-NJgDVCc9wz2bMQYTxdKGf2q1Obx4g8RIC0H8EOdrw3wqTQN7ggXxZn2u0Vl_MW_UCSlZJ87DdaXJni5zZ77nKhl-QxHhcvCzBcJEG2lOjKc8h9fKC5rr1J48pRtksjADWejH5kU8wY/s320/IMG_0284.jpg" width="240" /></a></div>
<br />
Finished result. Took allot to get here. Used Devcon 5 minute epoxy and an epoxy thickener that I had around from some past boat repair. The Devcon 2 barrel syringe works really well, I've tried other brands that just didn't mix well, and the epoxy never cured.<br />
<br />
I use a rasp and a really small router bit in a Dremel to get the batteries out. The batteries are spot welded on the top and bottom. I like to grind through the battery so I can get a screwdriver in it and lever it up a bit, then push a screwdriver in from the bottom and carefully push the tab away. Repeat for the top.<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhudAV0ahtpZ2PEOUwJhSDXH619GdPcygpAkSFehUCIy-pqW_QYWLBU334rzbYIRPqoBCThI4wgG7gyc18TwP_VwdO0KJKAEGpDFlLHk-2dvq8Brr2YhgarGLtJ8YK48CHL2PxNSoPCYhQ/s1600/IMG_0256.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhudAV0ahtpZ2PEOUwJhSDXH619GdPcygpAkSFehUCIy-pqW_QYWLBU334rzbYIRPqoBCThI4wgG7gyc18TwP_VwdO0KJKAEGpDFlLHk-2dvq8Brr2YhgarGLtJ8YK48CHL2PxNSoPCYhQ/s320/IMG_0256.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9U3C7aOGV1PFYJEim9ouV8ZC0MkIVb-MhI07bwAyLw1K2OaeGTbNdiY3Z7cAtLxbP2Deon7kgPJGVjlfXhMhqEJLZv04dnHlKrokXDDY8LLNMB5h0Phumb9k73MNHuv93m-vLwXIGam0/s1600/IMG_0260.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9U3C7aOGV1PFYJEim9ouV8ZC0MkIVb-MhI07bwAyLw1K2OaeGTbNdiY3Z7cAtLxbP2Deon7kgPJGVjlfXhMhqEJLZv04dnHlKrokXDDY8LLNMB5h0Phumb9k73MNHuv93m-vLwXIGam0/s320/IMG_0260.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
I followed the iFixit guide by Joern. The tricky part for me was getting sufficient contact between the top tabs and the battery. Super glue just doesn't work. I also tried something called "Wire Glue", carbon powder in a paint like substance, conductive. That also didn't do the trick. Only thing that works for me is soldering the top tabs to the battery. Use a faceshield, too much heat and the batteries explode, I ruined a few. I put a couple of drops of superglue around the bottom edges of the battery, then use my drill press to gently press and hold it in place for 5 minutes. I'm surprised it holds as well as it does, you don't need to wait 24 hours for full strength.<br />
<br />
To date, I've soldered the battery after gluing it. Might be better to solder it in place, pop it up, and then glue it. My solder job on this is horrible, but it makes the connection. I can do a beautiful job soldering CR2032's, but these tiny batteries, not so much. Sand the top of the battery, carefully sand the tab the best you can, maybe try tinning the battery top before soldering the tab on. Lastly, glue it.<br />
Also, hold the tab against the top of the battery while soldering, something thin and metal works, too much metal will work as a heat sink though.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
You can measure the voltage on the bottom of the transmitter using the two pins. You should see something around 0.270 mv. This will vary depending on what kind of voltmeter you have (cheap or legit...). Ideally, measure the voltage before you take the transmitter apart so you know what to shoot for. The iFixit guide was 0.09 mv. </div>
<br />
Initially I kept getting high 100's, indicating that only one battery was really connected. Soldering did the trick.<br />
<br />
The next issue is batteries. I ordered SR1120's, the battery dexcom uses. I had a pair of Maxell and I purchased a 5-pack of no brands off of Amazon. These were way too cheap, but I didn't realize why at the time. I promptly blew up the Maxell's trying to solder them, then moved onto the cheapies. These worked. But the battery level reported by the firmware was 198 (you want <strike>215 </strike>216). Surprisingly this worked fine, signal was a bit week, but it was accurate. Turns out, I bought Alkaline not Silver Oxide. Would have been lucky to get 3 months I think.<br />
<br />
Finally, I replaced the batteries a second time with Energizer 390/389 batteries and got the 216 level that you'd expect from a new transmitter. These are slightly larger, hopefully I'll get 15 months before I have to repeat this exercise.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Lastly, I used duck tape around the transmitter to make a "dam", then I poured the epoxy in.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOkm4kEIB_ZTDcCvLdGvWSohySlPVQd9mHCOVenJJHdVbRdCjmFvKcWfwZJZYxX50SDjeP7cTJg7c9WN-PVyyiUb_9t625qQJ1wKId43a68OCAzzS7Y3cXlahWsEQidaEroqDCqIZoH_4/s1600/IMG_0283.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOkm4kEIB_ZTDcCvLdGvWSohySlPVQd9mHCOVenJJHdVbRdCjmFvKcWfwZJZYxX50SDjeP7cTJg7c9WN-PVyyiUb_9t625qQJ1wKId43a68OCAzzS7Y3cXlahWsEQidaEroqDCqIZoH_4/s320/IMG_0283.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Once that set, it was easy to sand it down to something that looks very close to original.</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-2090121141266718432.post-29744963492044987492018-05-29T14:56:00.001-07:002018-05-29T15:17:15.472-07:00Another try with the VivoSmart<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcaTXK__foM0Zlrwrz-5Z7lptky_xiGl4tCYk411waST-ajBWdfdjEtBNVRNxfQUUAWX29oZSmxN_x2VGZEUtzLpBQ1VTE_eVEUlmO_r4h6zK8f7iqXnzbiKV3Y4ehMPRA0WPefj6DSKE/s1600/band.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1007" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcaTXK__foM0Zlrwrz-5Z7lptky_xiGl4tCYk411waST-ajBWdfdjEtBNVRNxfQUUAWX29oZSmxN_x2VGZEUtzLpBQ1VTE_eVEUlmO_r4h6zK8f7iqXnzbiKV3Y4ehMPRA0WPefj6DSKE/s320/band.jpg" width="201" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7lM6Zb79Uh2n7IDol92qVSarJMi9HNXtuiSUbMcu9w0j3n9Izh3BT6-dySy1wnfvOJqrpCkIsdvRcbL8-4GEpdOUi_m4Sh32-db2rgpFYx4qKT3bQwbg_fKJ1Bc9iwQsq94Eq2Vtvthw/s1600/ios_cgms.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1042" data-original-width="744" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7lM6Zb79Uh2n7IDol92qVSarJMi9HNXtuiSUbMcu9w0j3n9Izh3BT6-dySy1wnfvOJqrpCkIsdvRcbL8-4GEpdOUi_m4Sh32-db2rgpFYx4qKT3bQwbg_fKJ1Bc9iwQsq94Eq2Vtvthw/s320/ios_cgms.jpg" width="228" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
Resurrected my iPhone app, which hasn't seen a phone in 3 years, last used with iOS 8.3.<br />
BLE works better, whatever version we're on now. Lot's of cleanup, this was some of the nastiest code I've written, getting closer to looking like my Pebble app. Still Xcode is foreign, and it took me almost as long to convince it I was a registered developer as it did to get it working again.<br />
<br />
All this came about because I started messing around with all these $30 fitness trackers. The information is out there to pair directly with one and send notifications to it (the Mii Fit anyway).<br />
So, as a preliminary step, I wanted to get notifications working with the phone again and see if this was going to work. Future may include a ble nano /cc2500 combo, direct to band. Although I'd like to find something better than the nano, I really need a device that can do both central and peripheral.<br />
Normally the device is Central to the Band, but it needs to be Peripheral to the iPhone for calibrations (or whenever I want a front end).<br />
<br />
And down that rabbit hole. None of the cheapies handle a basic notification. With allot of work I can spoof a phone call and get the info to the Mii, but it'll take me days.<br />
Knowing the VivoSmart worked well in the past, I bought the VivoSmart3. I am having a real good time with it. I can't prevent the Vivo from vibrating when it receives a notification, so that caused me to rethink what I was doing.<br />
<br />
Tired of always looking at the numbers, I realized I could let the phone do all the work for me. If BG is stable between 90 and 160, am I going to do anything?, No. So, the new app, if BG is between 90 and 160 AND the slope of glucose change is less than 1.5, then just send Good, once. Now I go hours with a wristband that's quiet. When things get lousy, it starts sending me data, and the vibration is useful. The vibration isn't nearly strong enough to wake me at night, the phone gets that task.<br />
<br />
Also, and here's the bigger item, I'm playing around with just displaying the estimated glucose rather than what the Dex (if I had a Dex) would display. See above example, real time glucose is 154, based on the slope of change, it's really 163 (ie. what it will be in 10 minutes). I've been using this for years, but only to estimate how long until I'm at a critical value(countdown above), which is 80 or 180. 33 minutes until 180 in the above example. I thought, why bother with that, and just show the value.<br />
<br />
Cuts down on allot of thinking on my part. I show estimated glucose and the countdown value. If I'm already over 180 or under 80, I display the Rate. It's like before this tech existed, I feel good and I can just ignore the disease until the device buzzes.<br />
<br />
It's fun to have a fitness band that I can actually use the functionality on, as well as track glucose. Battery life is a 3+ days.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2090121141266718432.post-51229816179087437192017-12-12T13:52:00.000-08:002018-06-19T12:59:31.877-07:00Android Wear (Finally)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6XJ0-sPTW4GQQmvq3y94MWN97W60YIx-pzwtZlz_U_xf7uLpv1Gdg7pbYwAq6aKU4SXAZqOZtXaYXbVPhaU_vVCuif3NiNj1M75Q-OyMI-G2IBuWt-h5CH0XzeJiMoy8W4Ks2TAyorUo/s1600/moto.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1168" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6XJ0-sPTW4GQQmvq3y94MWN97W60YIx-pzwtZlz_U_xf7uLpv1Gdg7pbYwAq6aKU4SXAZqOZtXaYXbVPhaU_vVCuif3NiNj1M75Q-OyMI-G2IBuWt-h5CH0XzeJiMoy8W4Ks2TAyorUo/s320/moto.jpg" width="233" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimOSCjWfSlqZcN35ZwWaEIMgbXQ8YLj7PR63Br4pSf2DwGEOGHwjWc5kZnqEmmOUJBnXCO8vBKi_gBxjsT4Mhkggf66HSaRdG-Q_OpA3ygs5NuEWO8hFxr2RS12AyluC46Y4aSSvD9ock/s1600/moto_plain.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1383" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimOSCjWfSlqZcN35ZwWaEIMgbXQ8YLj7PR63Br4pSf2DwGEOGHwjWc5kZnqEmmOUJBnXCO8vBKi_gBxjsT4Mhkggf66HSaRdG-Q_OpA3ygs5NuEWO8hFxr2RS12AyluC46Y4aSSvD9ock/s320/moto_plain.jpg" width="276" /></a></div>
<br />
So, I left this project alone for a while, then started it up again yesterday, and now, it just works.<br />
I'll attribute this to problems with knowing if the updated code actually makes it onto the watch.<br />
Maybe a restart caused the new code to run.<br />
<br />
I have it running both as a watchface and as a complication. <strike>Downside to the complication is vibration alerts don't work. </strike> Alerts are good. Also, I can't see it if I look quickly.<br />
<br />
The watchface design, leaves allot to be desired for now, but that's on me.<br />
<br />
Again, not sure why this works now. Maybe the watch OS got updated...<br />
My last change was to shutdown the ble connection every few minutes and force the watch to reconnect. I'm hoping this forces the app to stay "awake", which it appears to do. It's good for about 12 hours, I can probably improve that by leaving the ble up longer, but who knows at what point the device will go to sleep... Other downside to the watch, it's only good to about 35% of battery and it doesn't alert when the battery level is low, it just dies.<br />
<br />
Also, I did away with the Sweetblue api's and wrote the bluetooth from scratch. There was too much going on there that I couldn't follow.<br />
<br />
12/29 update<br />
Getting up to 15 hours of use now. Have to remember to turn WIFI off, sometimes it defaults to on after a restart. Works reliably for days. Can also run the battery down closer to zero.<br />
Currently, stopping and restarting the Service that holds my Bluetooth intent every 10 minutes(this is in the code).<br />
Somewhere between 10 and 15 minutes is the tipping point, where Bluetooth becomes unusable after several hours.<br />
<br />
2/25 update<br />
Looks like watch firmware improved, no longer having WIFI turn on. Battery life is 30+ hours(on the device, not the watch).Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-90702331575247785612017-10-20T13:57:00.004-07:002017-11-27T08:28:25.447-08:00Android Wear Success ( or Not)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAduUSWpNwdg2fCkBE6gs0F3K3Jg5e4hbcCVYCVF_UgylW35ls5XkOMuj3yL-X1-AAZVLs3cXOvJm_sYWpGkHgmkb1ULlbw0ueA44bB_j3TQaGqbFZmhG2FjnLpZbAnob6vobMDeFm18c/s1600/IMG_1364.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1160" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAduUSWpNwdg2fCkBE6gs0F3K3Jg5e4hbcCVYCVF_UgylW35ls5XkOMuj3yL-X1-AAZVLs3cXOvJm_sYWpGkHgmkb1ULlbw0ueA44bB_j3TQaGqbFZmhG2FjnLpZbAnob6vobMDeFm18c/s320/IMG_1364.JPG" width="231" /></a></div>
<br />
Here's what happens when you make a device without any programmer access...<br />
Luckily, hot glue is reversible with alcohol.<br />
<br />
To make everything work, I needed to reprogram my device to send out the isig every 5 minutes. This way, another device (the watch) can listen for a notification. I originally wrote this, years ago, to only send a response to a request, but this isn't really how BTLE wants to work.<br />
<br />
Finally success with android wear. The end result looks exactly like my last post. Unfortunately, I can't really see those numbers without reading glasses, so I'm stuck with a custom watch face and bigger numbers. I'll work on that, I'm still trying to figure out complications, they only work by accident now.<br />
<br />
As to the android studio issues, here's what to do when it starts acting up.<br />
To connect to the watch you do "adb connect {watch ip address}". This should connect quickly.<br />
Signs that you're screwed are the following:<br />
- can't connect to the watch, and you get various meaningless errors<br />
- studio hangs, windows crashes etc<br />
- studio tells you it can't put the apk on the watch etc.<br />
- you deploy code, but the debugger doesn't stay connected so no logging<br />
<br />
First, toggle wifi off/on on the watch, then try the connect statement. That generally fixes things. If problems persist, restart everything. Your PC, the watch and your router. It will work for up to a week after that. Also, you probably need to wake the watch up to program, otherwise Android Stuido will just sit there. Not exactly user friendly.<br />
<br />
I'm using the Sweet Blue bluetooth libraries. That got me around allot of headaches. One strange thing, the device name has to be LOWER case. The device is programmed in UPPER case, and you can confirm that with a bluetooth scanner, but you need lower case for sweet blue.<br />
<br />
Complications, aptly named, when developing this, I had no issue pushing a value to the complication and having the screen refresh immediately. In practice, there is a delay, not enough that I care, the vibratory alerts happen real time, and you can tap the display to get the current value, but they can lag a few minutes. Another issue on the programming side, if I update the code on the watch, the bluetooth doesn't always start up again, it binds the device, but no values show up. Solution, restart the watch.<br />
<br />
Well, that's it, I'll update this post when I've figured out what the battery life is going to be. The CC2500/RFduino device is good for 24 hours, I'm hoping the watch will hold out for a full day.<br />
-----------<br />
10 hours, and the battery indicator was at 50%... I'll try again with WIFI off.<br />
-----------<br />
11/27... Basically, this is a failure. Only works for a few hours at best, appear to be fighting with power management. Most telling thing I've noticed, at some point when the watch has been untouched, the "Tick" event stops (every minute an event normally fires).Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-80603685222998246252017-10-09T11:55:00.001-07:002017-10-09T11:55:41.296-07:00Android Wear... Sort of<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2ZLO29rehtbvdKj250sBnNVCmcN16GgPj28PQ5kWeBnkd10hJlHrmlE2-E2Cex6jDV4jnpCoVyII7BATn8pY06ZehxV6PCazIOxZ93Wq_spKWfc9YhIBTOsjRzO_6EJOhR_gcOKOtcg/s1600/moto360.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1368" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2ZLO29rehtbvdKj250sBnNVCmcN16GgPj28PQ5kWeBnkd10hJlHrmlE2-E2Cex6jDV4jnpCoVyII7BATn8pY06ZehxV6PCazIOxZ93Wq_spKWfc9YhIBTOsjRzO_6EJOhR_gcOKOtcg/s320/moto360.jpg" width="273" /></a></div>
<br />
<br />
What it should be. <br />
<br />
My Pebble round lasted 1.5 years. The replacement 3 months. Now I'm using a Pebble Time, which is working great, but for how long?<br />
<br />
Saw a good price on the Moto 360, so I ordered one. Turns out I was early to the party. Waited around a month for the 2.0 update to finally show up. 2.0 being important since that allows watch to bluetooth device communication, and not just a phone.<br />
<br />
Programming this thing is impossible. The connection between Android Studio and the Watch is sketchy at best. You have to connect from the Terminal using something like "adb connect 192.xxx.xxx.xxx". But allot of the time, it won't connect. Sometimes it seems like maybe it's the watch has gone to sleep. Other times, you toggle wifi on the watch and then the connect will work. Who knows. Buggy. I had one magical day where it sat in the charger and worked flawlessly. Today, I might get the APK deployed, but then the watch disconnects, so no debug.<br />
<br />
I was very surprised when I switched to a Kindle tablet. Infinitely easier. The device just shows up when you click run, imagine that. <br />
<br />
Oh, and bluetooth. I have it working, but after reinstalling the app on the watch, I'm getting messages that I need to grant access to bluetooth. You have to do this multiple places. <br />1. In the manifest<br />
2. After the program is deployed, there's a permissions section<br />
3. And it appears, you need to answer the dialogs asking for access to bluetooth as well.<br />
<br />
There's the rub. This is running as a complication, there's nowhere to pop-up a dialog, so you are dead in the water, stupid. You can see the issues "they" are having with security on Android.<br />
<br />
At the moment I'm not sure how I had bluetooth working, and since I can't get a reliable debug(today)... I know some of my tests I had a basic watchface, then I loaded the complication, and it all worked. Thinking I got lucky, and the authorization I provided for one app bled over to another.<br />
<br />
Going to implement this on the kindle first, just to work out the coding issues and then keep my fingers crossed that I can get something to work on the watch.<br />
<br />
On the plus side, Apple announced that their watch will soon communicate directly with the G5, at least the manufacturers are getting the message that people don't want to be tied to a phone. I may get an iWatch, as soon as that update hits, probably better long term possibilities there, sounds(and looks) like Android Wear is DOA.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-81254347677348741622016-12-08T05:57:00.000-08:002016-12-08T05:57:09.471-08:00Pebble...Been kind of done with the blog thing. Reached my destination and all that. And then...<br />
<br />
Shouldn't be too surprised, did a year on Metawatch and 2 years on Pebble. Now, looks like I need to find the next watch.<br />
<br />
Although, no great rush. Hoping to buy another Round at fire sale prices. I can push my app changes directly to the watch from my Mac, note to self: test that process since it's been over a year.<br />
<br />
Future platform, probably Android Wear. Almost bought a Moto 360 sport last night, but the battery life on all of these watches is junk. When using a watch as a CGMS, it's always working. I can't leave it in a charger all night. Really need 24+ hours of battery life, that means I can charge it for an hour once a day (say while reading before I fall asleep). Anything less than that means having to charge multiple times a day, which is unacceptable, at least while I have another option. <br />
<br />
Waiting for the next generation of Android Wear wearables at this point.Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-2090121141266718432.post-12774436115074091582016-05-14T16:20:00.001-07:002016-05-15T14:26:26.234-07:00Smartstrap Debugging<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwBNCP-iFXtLBpy0N-Ji8JgmWXzQb0iEwFm1dK1i7zk_w9AYmlI5ul4RCc1EjLRBIPHIQloVF2Apg3cVnrH3oIJt7QC9SmHZKMj-ahGyt0CvUAACQx-BOePXvqj39432qMlKFXsMntaxU/s1600/pebble-wixel-smartstrap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwBNCP-iFXtLBpy0N-Ji8JgmWXzQb0iEwFm1dK1i7zk_w9AYmlI5ul4RCc1EjLRBIPHIQloVF2Apg3cVnrH3oIJt7QC9SmHZKMj-ahGyt0CvUAACQx-BOePXvqj39432qMlKFXsMntaxU/s400/pebble-wixel-smartstrap.jpg" width="400" /></a></div>
<br />
<br />
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.<br />
<br />
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.<br />
<br />
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. <br />
<br />
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.<br />
<br />
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.<br />
<br />
Finally, thought I'd include a picture of the current device. Similar to the part mockup in an earlier post.<br />
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.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_SnD5CIig7-lkVWRaL1rEx4s2_H_6D3ajaX79KpNHSunTb2_0lhBx8iYxdAp_mdOxVtQeLkpF_X_ewyCaQnTcNXybGidkjQ63ATmxlYLyfN-7XwBGtBaNJjy-aVwGJx6LR2Qewj5V-jo/s1600/device1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_SnD5CIig7-lkVWRaL1rEx4s2_H_6D3ajaX79KpNHSunTb2_0lhBx8iYxdAp_mdOxVtQeLkpF_X_ewyCaQnTcNXybGidkjQ63ATmxlYLyfN-7XwBGtBaNJjy-aVwGJx6LR2Qewj5V-jo/s400/device1.JPG" width="207" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Update</b>: 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.</div>
<br />Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2090121141266718432.post-22501035312354584512016-03-11T09:43:00.000-08:002016-03-11T09:50:04.068-08:00Smallest device with the smallest watchI've always wanted the Analog watchface, probably why I put up with my ugly display for as long as I did. Now with the the Pebble round, seemed appropriate to spend the time and get the Analog face working. <br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizk1bF4UH6maa2VZRZdqW0BXTLg1zO6gVcGHkhZKZoA9k1AcpERDnlU9qJ8ZS_4nMllRExTbTWIffCReDhv4SJTq9RZIj3con87mPchTjf_DMf1XI9U_kqzNYiwlZ4ehZoxOiy3sVXcJw/s1600/pebble+round+and+device.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizk1bF4UH6maa2VZRZdqW0BXTLg1zO6gVcGHkhZKZoA9k1AcpERDnlU9qJ8ZS_4nMllRExTbTWIffCReDhv4SJTq9RZIj3con87mPchTjf_DMf1XI9U_kqzNYiwlZ4ehZoxOiy3sVXcJw/s400/pebble+round+and+device.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The 3'oclock position shows estimated time until 80/180. Under the date will be the missed signal (!) and funny data(???) indicators. 12'oclock is the slope of the glucose readings followed by the Calibration slope. 9'oclock is Glucose.</div>
<div class="separator" style="clear: both; text-align: center;">
The round pairs better with the Blugiga radio than it does with my iPhone, good thing. It seems the best way to get paired to upgrade the App, is to reboot the watch. Strange.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Still need to design and print a charger base. Good day today, the 3d printer is working!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Here's a better picture with more indicators in use.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_d_dD_7ZK9Y-iQrEk7pZqF7RR5ahDfCVzNbKRCksWasDLEOlpmp2SPY1LXTw0jJDapU_xhZ-afY4WdhihV9-i-SGsP3ZGCjGMgZ9yxrsZXEibF5x9kq-_qNBmeVxVROPYMOqzEODAsGs/s1600/device2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_d_dD_7ZK9Y-iQrEk7pZqF7RR5ahDfCVzNbKRCksWasDLEOlpmp2SPY1LXTw0jJDapU_xhZ-afY4WdhihV9-i-SGsP3ZGCjGMgZ9yxrsZXEibF5x9kq-_qNBmeVxVROPYMOqzEODAsGs/s320/device2.jpg" width="283" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-2090121141266718432.post-57677996861450856092016-03-07T17:34:00.000-08:002016-03-09T08:26:57.029-08:00Bluegiga WT12 Controls all PebblesDid some searching and found a bluetooth chip that does SSP Master, which is used by all the pebbles. My existing code still works, just the initial configuration of the board (which you can do through serial) is different. <br />
<br />
SET BT PAIR *<br />
SET BT AUTH * 0000<br />
SET BT SSP 3 0<br />
SET BT POWER 0 0 0<br />
CALL b0:b4:48:9d:cc:08 1101 RFCOMM<br />
SET CONTROL AUTOCALL 1101 5000 RFCOMM<br />
<br />
This configures the board to connect and automatically reconnect to a watch. Power=0, gets translated to -2, which is still enough power to cover my house. Once paired with the watch and the Wixel in sleep, it's around 5ma. With the Wixel actively listening it's approx 27ma. When the Bluetooth module receives data it's 35ma. Generally you're running at 5ma, the higher numbers are for a few seconds every 5 minutes. The pebble appears to be "chatty", so you see frequent 35ma bursts, this may be an issue, but I think I can get 20 hours out of a 110 mAh battery.<br />
<br />
I'll probably make this over the weekend:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHttwzD9KBrfFSyIFpXKTs1WSLUyzCsC0DqyHi4nXDJAXJgi4X1jwj8o0KV3m6vqa4nhlu8ffDnNcuvM5CdUOGLeuY0ZpogiyN7VwBhe_sm4kXtWk9DEVWBtPX1L9-SZOg2lsNRIU6Szc/s1600/device.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHttwzD9KBrfFSyIFpXKTs1WSLUyzCsC0DqyHi4nXDJAXJgi4X1jwj8o0KV3m6vqa4nhlu8ffDnNcuvM5CdUOGLeuY0ZpogiyN7VwBhe_sm4kXtWk9DEVWBtPX1L9-SZOg2lsNRIU6Szc/s320/device.jpg" width="231" /></a></div>
<br />
That's the WT12 "dead bugged" on top of the Wixel. Curious to see if I can get away with that.<br />
<br />
Allot of useful information here: <a href="http://www.keyglove.net/2011/03/24/bluegiga-wt12-bluetooth-module-connection/" target="_blank">http://www.keyglove.net/2011/03/24/bluegiga-wt12-bluetooth-module-connection/</a> , this guy also sells a development board for the WT12 which makes it breadboard friendly. Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2090121141266718432.post-6783031548907523432016-02-26T06:34:00.001-08:002016-02-26T10:23:19.120-08:00More BLE CentralI would still like a "Band"... I really can't wear the watch when doing hand to hand stuff etc. A band is a little easier to get away with, and less likely to hurt someone.<br />
<br />
A few weeks ago I stumbled on some posts for the Xiomi MI, band. Cheap thing $30, Amazon gets it to me in 2 days. I found websites that detailed how to communicate with it from a BLE Central device, so I thought cool, I'll get one. Impulse buy.<br />
<br />
This was the perfect use for my BLE Nano. I already had some BLE Central code written that worked for communicating with the RFDuino. Of course, this wouldn't work...<br />
After about 8 hours, it came down to a parameter change on the connect, ex.<br />
<br />
<b><i>
ble.gap().connect(params->peerAddr, Gap::ADDR_TYPE_PUBLIC, NULL, NULL);</i></b><br />
<b><i><br /></i></b>
<div>
My original code had a random address type. This was quite maddening because I could connect with the MI from both Unix and my iPhone using "LightBlue". </div>
<div>
<br /></div>
<div>
It wasn't until I connected that I realized the communication protocol's for the MI had changed. </div>
<div>
The current protocol is actually more standardized. All alerts (buzzing) are through a standard BLE endpoint for "Immediate Alert". LED control, not so much, I now realize LED control isn't exposed to an external device. My plan had been to use the 3 led's as a sort of traffic light, or:<br />
- led 1 = >200mg/dl<br />
- led 2 = >100mg/dl<br />
- led 3 = blink out the 10's every minute or so.</div>
<div>
<br /></div>
<div>
Or something like that, coupled with buzzing to queue me in on what's going on. </div>
<div>
If you look around for posts on the MI, you'll see the lights don't really work anyway. They're triggered by an accelerometer that only responds to some bizarre form of hand waving, I got them to light up once or twice, the motion required being way to ridiculous for public presentation.</div>
<div>
<br /></div>
<div>
That said, could be an excellent vibrating alert device that can go a month on a charge.</div>
<div>
<br /></div>
<div>
Some other notes from this experience:</div>
<div>
1. The BLE Nano (with MBED) doesn't really work with Windows 10, unless you're comfortable restarting windows frequently. The Arduino version may be fine, I have one of each, but I have issues with BLE Central on the Arduino version. In the end, I moved my development over to the Mac. Additionally, opening and closing serial windows and dragging/dropping hex files is a PIA. I was able to automate this to some extent with the Mac, one of the reasons I purchased a Mac, nice to finally put that to use. See my github for a basic script. In a nutshell, it's a ksh that watches the download folder for a hex file, moves it to the Nano, and launches a serial window.</div>
<div>
<br /></div>
<div>
2. I don't think BLE sniffing is all it's cracked up to be. I have an Ubertooth and a Nordic device and can hook them up to Wireshark. With an RFduino I can see all the "Magic" packets (ATT etc). With more proprietary devices like the MI or the Pebble, once these things pair, I don't see anything. If you want to hack a BLE device, decompile the Android APK if one is available.</div>
<div>
<br /></div>
<div>
<b>On to the Pebble watch</b>. Still going strong. Found out from Pebble support that the aplite versions of the pebble support "Pin" pairing via bluetooth. The new models only support ssp (simple secure protocol). They also pointed out the mfg'r note for nRF51, which indicates that while ssp is in the command set, it doesn't actually work. Allegedly there's a beta that will support ssp, and will pair with the Pebble Time. Wait and see. </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-73097019371677769002016-01-13T06:55:00.002-08:002016-01-13T07:28:55.141-08:00New year, new device<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkEfpsHG1pRR5h04ozrpPSzvfgu3NhIIS2ny-T8ZOX0Qk8m6-0qEzsLWVKucAc05N0TBCD_aIhuWOGhqaWJy-1emkorWVfaI4PbL4BD6N9llqQpvkQUX9KRu9Soc6iT1P1dkM_2P-45js/s1600/devicewithcharger.png" imageanchor="1"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkEfpsHG1pRR5h04ozrpPSzvfgu3NhIIS2ny-T8ZOX0Qk8m6-0qEzsLWVKucAc05N0TBCD_aIhuWOGhqaWJy-1emkorWVfaI4PbL4BD6N9llqQpvkQUX9KRu9Soc6iT1P1dkM_2P-45js/s320/devicewithcharger.png" width="320" /></a><br />
<br />
Finally got most of the kinks worked out of the Pebble as CGMS project. Above is the device with it's charging stand. Completely removed the phone component. Added all the calibration functionality to my pebble. Some screen shots from the emulator:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizmivWBOUdWDYcA0h7TvSsP5bXezFR5sAyJNj_p1EN4klhYKmgsDfKbRGUhKNYt_DX1oFRYZ82FzJXtQn4lLTd3qMQdvyi7lf2Fyyny0S3lsgsgYn6zts3om5IXZ-AezzS342k7_TeOPg/s1600/watch+faces.png" imageanchor="1"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizmivWBOUdWDYcA0h7TvSsP5bXezFR5sAyJNj_p1EN4klhYKmgsDfKbRGUhKNYt_DX1oFRYZ82FzJXtQn4lLTd3qMQdvyi7lf2Fyyny0S3lsgsgYn6zts3om5IXZ-AezzS342k7_TeOPg/s640/watch+faces.png" width="448" /></a><br />
<br />
For calibration values, you can choose 80-190 in 10 mg/dl steps. I also added a 15 minute snooze for alarms. Entering anything is a two step process to avoid issues with accidentally pushing the buttons. This will probably see more work, but for now, you click an action then scroll back to the top and choose Enter. Finally broke my watch code up into libraries, much happier with it now, and it's easier to maintain. Maybe I'll let my iOS developer license lapse now. I really dislike xCode, I spend more time proving to it that I'm an authorized developer, than I do coding.<br />
<br />
For the circuit, I realized I was better off with the Wixel, since it handles running it's radio and a 115k Serial connection. Almost no room for a program on the Wixel, but I only had to cram in a function to blast out 2 packets to the pebble every 5 minutes. <br />
<br />
A picture of the packed circuit board:<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCGT8LmSvVSLLSmqZGKdDCPl3DqntK0LuOBoLAhFltIvxQK347sBUr7LYFpATPlTY9_gSnUfCDr9b0-XRKZ-NdLiG-K5o58DCKvEqir8ynRTsNYh76DtVkiVz2uWU_l3Vas9NhTDabKmQ/s1600/packedboard.png" imageanchor="1"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCGT8LmSvVSLLSmqZGKdDCPl3DqntK0LuOBoLAhFltIvxQK347sBUr7LYFpATPlTY9_gSnUfCDr9b0-XRKZ-NdLiG-K5o58DCKvEqir8ynRTsNYh76DtVkiVz2uWU_l3Vas9NhTDabKmQ/s400/packedboard.png" width="400" /></a><br />
<br />
I'm very happy with this. I no longer have to keep track of the phone. Also both the boards I'm using are pretty awesome at their jobs. The Bluetooth board easily covers the house, and pairing is automatic, handled by firmware. No more disconnects from blocking the device. The Wixel is also much better at pulling in signals than my CC2500 devices. <br />
<br />
I did the PCB on a CNC router this time. Just barely worked, luckily this is a simple circuit. I should be able to do better on the next PCB I route.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE14eRab3Vklqxzuoh7MJAvY4mgk5kyw9njROqgRO0-RCjCJYMv8WYixUMIkASZ9c-EVY11PNAnzKDDLy2VkebKmLoHAWdq6mrgTX_utyk298FlF5iUctRchvrgWqV1YhZqEtWPdWnzZo/s1600/pcb.png" imageanchor="1"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE14eRab3Vklqxzuoh7MJAvY4mgk5kyw9njROqgRO0-RCjCJYMv8WYixUMIkASZ9c-EVY11PNAnzKDDLy2VkebKmLoHAWdq6mrgTX_utyk298FlF5iUctRchvrgWqV1YhZqEtWPdWnzZo/s320/pcb.png" width="320" /></a><br />
<br />
One downside for now, is I can only get the Classic Pebble and Pebble Steel to pair. There is something different with the Pebble Time and what it expects for Pairing. There are quite a few parameters for the RN41 so I have a few other options to explore. On the upside, while the Classic is fairly ugly, it has nearly a 5 day battery life.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2090121141266718432.post-39449322919680625902015-12-19T07:38:00.001-08:002015-12-19T07:38:37.155-08:00Pebble BattlesI was hoping to get allot of programming done on my Pebble yesterday. Not so.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSS8d7LMFg4ZzvCnx9XjNdQ6UOhTpBIVC9U4HmWQP01lf6FZNoosJY5WI_MlYn6flo5vwpCNlPisERVnUPKgaKJ-3f1hk162ebjfZV7ujUao9lPqYp9IJgI46sTjum-oMJWnfDL1nOEMs/s1600/error.jpg" imageanchor="1"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSS8d7LMFg4ZzvCnx9XjNdQ6UOhTpBIVC9U4HmWQP01lf6FZNoosJY5WI_MlYn6flo5vwpCNlPisERVnUPKgaKJ-3f1hk162ebjfZV7ujUao9lPqYp9IJgI46sTjum-oMJWnfDL1nOEMs/s640/error.jpg" width="640" /></a><br />
<br />
I left off Thursday with a working app, started up Friday morning to this. It's telling me that pebble.h doesn't exist. Sort of a fundamental problem. So I scour the internets to see what's going on, nothing. Send an email to support, then consider my options. <br />
<br />
The last time CouldPebble was down I developed on my Mac, so back to that. Fumble around for a while, it's been almost a year. Load app on my watch, mistakenly putting it on the one I'm wearing, and not the development model... App doesn't work. Try to load onto my original pebble, just get this message "Couldn't install app". Dead. Nothing. Try app in emulator, works fine.<br />
<br />
After an hour or two of this, I notice that pebble is on a new SDK release. Start fiddling around with the command line:<br />
->pebble sdk list<br />
<br />
Tells me I'm on 3.8.1. Hmm, lets try 3.7.<br />
->pebble sdk install 3.7<br />
->pebble activate 3.7<br />
<br />
I like the way you can easily switch and install SDK's, beats the hell out of Java and hunting around for the correct version.<br />
Then build, install and success! Most of my day is gone, but the watches are back to working.<br />
As of today, CloudPebble is still wasted. I really liked this tool, and the mbed site as well, good for casual use I suppose. Looks like I'm officially done with CloudPebble for development.<br />
<br />
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;"><!--[if gte vml 1]><v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75"
alt="" style='width:1018.5pt;height:507pt'>
<v:imagedata src="file:///C:/Users/brown/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png"
o:href="cid:image001.png@01D13990.F350AEC0"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-66385987581740060762015-12-17T09:30:00.001-08:002015-12-17T09:32:21.842-08:00Working PrototypeBread boarded and working. <br />
Now to get this on a PCB, and figure out what kind of battery I'm going to need. <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEAuB-MSehMmBLD5yznlC4eqi2fOTtq4u0nZ-VIZ670w0odVaOYGfbIVRIKjY9Z7W5ixnHzsnPX9GA1q2Otdto8PjH7ZOuBwQ_Gu_ZoQ1jXCYUXvUkHYM__LM7hIF3gk7YDi9428EIezA/s1600/proto.jpg" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEAuB-MSehMmBLD5yznlC4eqi2fOTtq4u0nZ-VIZ670w0odVaOYGfbIVRIKjY9Z7W5ixnHzsnPX9GA1q2Otdto8PjH7ZOuBwQ_Gu_ZoQ1jXCYUXvUkHYM__LM7hIF3gk7YDi9428EIezA/s320/proto.jpg" width="200" /></a><br />
<br />
Final build:<br />
- BLE Nano<br />
- Sparkfun Bluetooth Mate Gold<br />
- Teensy 3.1<br />
- A couple of discrete components so I can control the Bluetooth Mate<br />
<br />
The Nano, like the RFDuino, can't run at 115k with the radio on, so I have to have the Teensy around to coordinate everything. <br />
Cool thing with the nano, is I have it in Central Mode. My CGMS devices pair directly with this if the phone isn't available.<br />
<br />
So it's:<br />
Sensor->CGMS->iPhone-> Watch<br />
<br />
OR<br />
<br />
Sensor->CGMS->"The new device"->Watch<br />
<br />
Also this device will pair and/or wait to pair for as long as it has power. No issues with something shutting down the "process" like the iPhone does if the BLE connection has been idle for more than a few minutes.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-2090121141266718432.post-82711875862666529522015-12-10T08:35:00.001-08:002015-12-12T06:43:13.065-08:00More on PebbleConnecting an Arduino to a Pebble.<br />
<br />
I'm using a sparkfun, bluetooth mate, GOLD. I don't believe the Silver will work. A big issue with this process is what type of bluetooth dongle you have, I'm sure they all work differently.<br />
<br />
The guy here: https://gist.github.com/southwolf/6365045, has some basic working(for him) code. What's left out, is the initial pairing. With the Mate, you are better off not trying to control it programatically. After many hours, it just doesn't seem consistent and tends to be unresponsive. It is meant to be configured over serial from a lengthy command set. Most of the settings don't appear to "take" until you reboot the device, and just power cycling may blow them away. Also, some important settings don't persist. The big one that comes to mind is baudrate, so assume you are going to be at 115200.<br />
<br />
Before you do anything with the arduino, configure the Mate, you aren't done until the Mate stops flashing red and the green light stays on, indicating you are paired. From that point forward, the mate should automatically pair with the pebble until the end of time (although it may take as long as a minute, or never)...<br />
<br />
The commands you should send to the Mate:<br />
SF,1 //factory reset<br />
SP,9999 //takes care of the pairing code<br />
SM,6 //pairing<br />
SA,4 <br />
SY,0000 //power<br />
SW,0640 //sniff mode<br />
R,1 //reset so settings are saved/active and pebble should ask to connect<br />
<br />
Once the light hits green, pairing with the watch will take place, the first time the watch will ask, any time after that it will be silent. The watch will send you a version request. You need to send two packets in reply, screw this up and the watch will just ignore you.<br />
<br />
I send:<br />
// //phone version<br />
{0x00, 0x02, 0x00, 0x30, 0xff, 0x08};<br />
<br />
Followed 100ms later with:<br />
<span style="font-size: x-small;">// 0x11 = 17 = Phone Version endpoint</span><br />
<span style="font-size: x-small;">// phone version</span><br />
<span style="font-size: x-small;">// remote capabilities Telephony.SMS.Android</span><br />
<span style="font-size: x-small;">// //session capabilities............</span><br />
<span style="font-size: x-small;">{0x00, 0x0d, 0x00, 0x11, 0x02, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};</span><br />
<br />
You shouldn't send the above again, unless you "forget" the bluetooth device from your watch.<br />
<br />
Once that's complete you can ping the watch:<br />
// endpoint<br />
// 2001=ping<br />
{0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};<br />
<br />
Send a notification:<br />
//this says BG 115 <br />
// B G 1 1 5<br />
{0x00, 0x1A, 0x0B, 0xB8 , 0x01 , 0x02, 0x42, 0x47, 0x03 , 0x31 , 0x31 , 0x35, 0x11, 0xFF, 0xFF , 0xFF , 0xFF , 0xFF, 0xFF, 0xFF, 0xFF , 0xFF , 0xFF, 0xFF, 0xFF , 0xFF, 0xFF , 0xFF , 0xFF, 0xFF};<br />
<br />
Note: the above packet has a header and body. The header is 2 bytes and says "BG". The body is 3 bytes and says "115". The 0x11, signifies 17 bytes until the end of the message.<br />
<br />
Or, and this is the big one, send an application message.<br />
For this one you need the UUID of the app, which you can see in Cloud Pebble.<br />
<br />
With that, I can send an integer value of 120 to the first element(tuple?) in my applications dictionary.<br />
//app messages to uuid, glucoseKey<br />
//001b 0030 0100 7f7a38901a1c43a3adf121449e4f352d 040100 0000 03:01:00:78<br />
//msg app push UUID................................................... key len 120<br />
// msg int (0x03)<br />
// dict element (0x01)<br />
<br />
I may have to update this one.<br />
<br />
Can't use the RFDuino. Number of serial ports is one issue, the bigger one though is you can't run the Radio and Serial at 115200, 9600 works, but 115200 will cause the app to hang.<br />
<br />
Turning one off and the other on, also doesn't work, doing a Serial.end / Serial.begin appears to glitch the serial line to the mate and causes it to disconnect.<br />
<br />
It looks like this project will be continuing with a Teensy. One serial for debug, the second for the Mate, SPI for the CC2500, maybe a third serial to run an RFDuino if I want BLE. <br />
<br />
<br />
See github (https://github.com/brownedon/Arduino-to-Pebble) for a working sample.<br />
<br />
<br />Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-2090121141266718432.post-74401040903132872362015-12-04T09:09:00.000-08:002015-12-04T09:09:16.370-08:00Direct control of Pebble with ArduinoSlow week, and I was cleaning up the bench. Stumbled on one of my Sparkfun Bluetooth Mates.<br />
I used these with the metawatch a few years ago. I was never able to work out the pairing to get these to connect to the Pebble. Well, I know a bit more, and I'm probably even more persistent these days...<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgHss_jdVbk9RoWfumyzwcv__1npXPaoJjrQ5pRUPO1ISUkvvMMSYwNJJhpCx1xnnDSYFTvnMehNee7ZRHmDbceVhUaxmGDM55qUhANcphSn6N6lMXkKoM-4qfdM-OWY7PzB_Zi3Oep8c/s1600/pebble.jpg" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgHss_jdVbk9RoWfumyzwcv__1npXPaoJjrQ5pRUPO1ISUkvvMMSYwNJJhpCx1xnnDSYFTvnMehNee7ZRHmDbceVhUaxmGDM55qUhANcphSn6N6lMXkKoM-4qfdM-OWY7PzB_Zi3Oep8c/s320/pebble.jpg" width="320" /></a><br />
<br />
I need to work out how to send an application message, then I can go phoneless. I might have to use the Wixel again, could keep my parts count down. This will net me a larger carry, but no phone requirement for extended periods. Still need to get calibrations in somewhere, though.<br />
<br />
This guy (<a href="https://gist.github.com/southwolf/6365045" target="_blank">here</a>) was close. But he's leaving out the initial pairing step. The packets have changed since this was published also. Allot of strange details, probably bluetooth device dependent. I'll post more when I can sort through all the details, but I can reliably pair with the watch and send a notification to it.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-2090121141266718432.post-16067394734601937632015-10-05T08:50:00.001-07:002015-10-05T19:59:35.170-07:00The final CC2500 DeviceAll this work on watches, and discussions about how small this device could be, got me motivated this weekend to make another (last) device. This took the whole weekend. Fiddling with eagle, realized I could do it without jumpers, and I left out the serial interface for programming. Leaving out those traces makes a huge difference, no issues with trying to sneak by the CC2500 antenna. Program the chip before installing...<br />
<br />
Screenshot from eagle:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlHD3QPMI8uqIGztCUeLC2YVJdczfs1x5IQtUwUc5w3Wdnx93uOEL1HpES-mra6667XeUxZ-FgEst6dYf7udPR5aSkzB_RWnCbIhXnlgcj46z1Osic1A6HvRKPA-G07a-dEYVqU2G4kJs/s1600/dex-eagle.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlHD3QPMI8uqIGztCUeLC2YVJdczfs1x5IQtUwUc5w3Wdnx93uOEL1HpES-mra6667XeUxZ-FgEst6dYf7udPR5aSkzB_RWnCbIhXnlgcj46z1Osic1A6HvRKPA-G07a-dEYVqU2G4kJs/s320/dex-eagle.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
From the left: Rfduino, CC2500, and a Polulu 5v to 3.3v converter. Used a 40 maH lipo which fits on the top right. I realized after the fact that I could make life easier on myself, and have dedicated pads for the lipo, that aren't so close too each other. As it is, the lipo is directly soldered to the pin-header socket. <br />
<br />
Completed device, in 3d printed ABS case.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihobzSgN_-1i-3q5y4qvkpGoVXPA4jwBa0ehiqYKLiJ2U0Xs7h0oab1f6IdXrT1v_ni4vcujibEN1IazcKDVOeBnq_fs5sHWy9OhxkJhWYNnLrChRZVtB75BeWb8Sq55l4x8spWYDUMEM/s1600/enclosure.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihobzSgN_-1i-3q5y4qvkpGoVXPA4jwBa0ehiqYKLiJ2U0Xs7h0oab1f6IdXrT1v_ni4vcujibEN1IazcKDVOeBnq_fs5sHWy9OhxkJhWYNnLrChRZVtB75BeWb8Sq55l4x8spWYDUMEM/s320/enclosure.jpg" width="320" /></a></div>
<br />
<br />
It's almost bic lighter size.<br />
<br />
A shot of the board, Dexcom for scale :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmXwscgVlyaqtmT64uPok7-X1D4zYRz-YvEke-xkIa7_4oYjx0unEJ-w5xTq0KQjX6oRZZdBf7icPqXGJTBojuSYDo7dfHMDa4G0CWKP-vv-FCA1FUaYQqOrnszmNPVfjZOSY_e0VZwxw/s1600/dexforscale.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmXwscgVlyaqtmT64uPok7-X1D4zYRz-YvEke-xkIa7_4oYjx0unEJ-w5xTq0KQjX6oRZZdBf7icPqXGJTBojuSYDo7dfHMDa4G0CWKP-vv-FCA1FUaYQqOrnszmNPVfjZOSY_e0VZwxw/s320/dexforscale.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And in it's charger base.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzLMtViqdXOgsUYBURz0ccBnsUGXzcXluY_apXsdq3EWNuAo6EBgsWvv8qWhPYNqOxPlHo8OKgaiIZFuIGQeHZe4-t7rDFmizgv76NDPpCRx2p2a5PrGRqVuVrI-62RVsDpIIjTyiihIg/s1600/charger.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="164" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzLMtViqdXOgsUYBURz0ccBnsUGXzcXluY_apXsdq3EWNuAo6EBgsWvv8qWhPYNqOxPlHo8OKgaiIZFuIGQeHZe4-t7rDFmizgv76NDPpCRx2p2a5PrGRqVuVrI-62RVsDpIIjTyiihIg/s320/charger.jpg" width="320" /></a></div>
<br />Unknownnoreply@blogger.com16