/DiaBLE

Diabetes: test the FreeStyle Libre 2 glucose sensor as a Bluetooth Low Energy device

Primary LanguageSwift

Since the FreeStyle Libre 2 glucose sensor is a Bluetooth Low Energy device and my purchase experience with the transmitters available for the previous generation has been quite frustrating, I am trying to leverage its capabilities to implement something new compared to the traditional apps:

  • a universal SwiftUI application for iPhone, iPad and Mac Catalyst;
  • an independent Apple Watch app connecting directly via Bluetooth;
  • scanning the Libre directly via NFC;
  • using both online servers and offline methods for calibrating just like Abbott’s algorithm;
  • showing for comparison the HealthKit and Nightscout data shared with other apps;
  • varying the reading interval instead of the usual 5-minute one;
  • a detailed log to check the traffic from/to the BLE devices and remote servers.

Still too early to decide the final design (but I really like already the evil logo 😈), here there are some recent screenshots I tweeted:



  

Libre 2 decrypted thanks to @ivalkou - Atlas stress test: 1-minute uploads


Phones and transmitters: who needs them?


Filling the gaps from a Mac



The project started as a single script for the iPad Swift Playgrounds to test the workings of the several BLE devices I bought, mainly the Bubble and the MiaoMiao. It was then quickly converted to an app by using a standard Xcode template: it should compile finely without external dependencies just after changing the Bundle Identifier in the General panel and the Team in the Signing and Capabilities tab of Xcode -- Spike users know already very well what that means... ;)

I am targeting only the latest betas of Xcode. Please refer to the TODOs list for the up-to-date status of all the current limitations and known bugs of this prototype.


Credits: @bubbledevteam, @captainbeeheart, @cryptax, @dabear, @ivalkou, LibreMonitor, Loop, Nightguard, @travisgoodspeed, WoofWoof, xDrip+, xDrip4iOS.