connecting Libre 3 with DiaBLE App and Watch
Hi,
I tried your code and built the iOS App on my iPhone. Now I try to connect my freestyle libre 3 sensor with the app. But it is not possible to connect the libre 3 sensor. In settings I selected the "libre" tap and I tried to find my chip. It connects but then disconnects. What could be the reason that my iPhone does not connect to the sensor. The original Freestyle Libre 3 app works with the sensor.
Is that a problem with the 'get session info' that I saw in your TODOs?
Here is my log
Bluetooth: reconnecting to 8065592AA8F0...
Bluetooth: error type 7: The specified device has disconnected from us.
Bluetooth: 8065592AA8F0 has disconnected.
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: sending to Libre 3 8065592AA8F0 `get session info` command 0x08
Libre 3 8065592AA8F0: writing 40-zero challenge data (it should be the unlock payload)
Libre 3 8065592AA8F0: security challenge # 0108: a3f86b4b42b3c038279583eced5db095080100003d6c45
Libre 3 8065592AA8F0: received 25 bytes of challenge data (payload: 23 bytes):
00 A3 F8 6B 4B 42 B3 C0 38 27 95 83 EC ED 5D B0 95 08 01 00
01 00 3D 6C 45
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (5 bytes received): hex: 01003d6c45, string: "=lE"
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (20 bytes received): hex: 00a3f86b4b42b3c038279583eced5db095080100, string: "��kKB��8'����]��"
Libre 3 8065592AA8F0: expected response size: 25 bytes (payload: 23 bytes)
Bluetooth: 8065592AA8F0 did update value for security commands characteristic (2 bytes received): hex: 0817, string: ""
Bluetooth: 8065592AA8F0 did write value for security commands characteristic
Bluetooth: 8065592AA8F0 did update notification state for certificate data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for challenge data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for security commands characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for factory data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for event log characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for clinical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for historical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for one-minute reading characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for patch control characteristic: notifying
Bluetooth: sending to Libre 3 8065592AA8F0 `read security challenge` command 0x11
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089823FA-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (certificate data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089822CE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (challenge data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 08982198-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (security commands)
Bluetooth: discovered Libre 3 data service's characteristic 08981D24-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (factory data)
Bluetooth: discovered Libre 3 data service's characteristic 08981BEE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (event log)
Bluetooth: discovered Libre 3 data service's characteristic 08981AB8-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (clinical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898195A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (historical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898177A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (one-minute reading)
Bluetooth: discovered Libre 3 data service's characteristic 08981482-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Read"] (patch status); avoid enabling notifications because of 'Encryption is insufficient' error
Bluetooth: discovered Libre 3 data service's characteristic 08981338-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Write", "Notify"] (patch control)
Bluetooth: discovered 8065592AA8F0's service 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 (security service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 089810CC-EF89-11E9-81B4-2A2AE2DBCCE4 (data service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 180A (device information); discovering characteristics
Bluetooth: 8065592AA8F0 has connected; discovering services
Bluetooth: reconnecting to 8065592AA8F0...
Bluetooth: error type 7: The specified device has disconnected from us.
Bluetooth: 8065592AA8F0 has disconnected.
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: sending to Libre 3 8065592AA8F0 `get session info` command 0x08
Libre 3 8065592AA8F0: writing 40-zero challenge data (it should be the unlock payload)
Libre 3 8065592AA8F0: security challenge # 0107: c9387d67dbfdb675c4d9f5915e6b0f0307010000ff48ac
Libre 3 8065592AA8F0: received 25 bytes of challenge data (payload: 23 bytes):
00 C9 38 7D 67 DB FD B6 75 C4 D9 F5 91 5E 6B 0F 03 07 01 00
01 00 FF 48 AC
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (5 bytes received): hex: 0100ff48ac, string: "�H�"
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (20 bytes received): hex: 00c9387d67dbfdb675c4d9f5915e6b0f03070100, string: "�8}g���u����^k"
Libre 3 8065592AA8F0: expected response size: 25 bytes (payload: 23 bytes)
Bluetooth: 8065592AA8F0 did update value for security commands characteristic (2 bytes received): hex: 0817, string: ""
Bluetooth: 8065592AA8F0 did write value for security commands characteristic
Bluetooth: 8065592AA8F0 did update notification state for certificate data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for challenge data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for security commands characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for factory data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for event log characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for clinical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for historical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for one-minute reading characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for patch control characteristic: notifying
Bluetooth: sending to Libre 3 8065592AA8F0 `read security challenge` command 0x11
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089823FA-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (certificate data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089822CE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (challenge data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 08982198-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (security commands)
Bluetooth: discovered Libre 3 data service's characteristic 08981D24-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (factory data)
Bluetooth: discovered Libre 3 data service's characteristic 08981BEE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (event log)
Bluetooth: discovered Libre 3 data service's characteristic 08981AB8-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (clinical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898195A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (historical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898177A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (one-minute reading)
Bluetooth: discovered Libre 3 data service's characteristic 08981482-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Read"] (patch status); avoid enabling notifications because of 'Encryption is insufficient' error
Bluetooth: discovered Libre 3 data service's characteristic 08981338-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (patch control)
Bluetooth: discovered 8065592AA8F0's service 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 (security service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 089810CC-EF89-11E9-81B4-2A2AE2DBCCE4 (data service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 180A (device information); discovering characteristics
Bluetooth: 8065592AA8F0 has connected; discovering services
Bluetooth: reconnecting to 8065592AA8F0...
Bluetooth: error type 7: The specified device has disconnected from us.
Bluetooth: 8065592AA8F0 has disconnected.
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: 8065592AA8F0 did write value for challenge data characteristic
Bluetooth: sending to Libre 3 8065592AA8F0 `get session info` command 0x08
Libre 3 8065592AA8F0: writing 40-zero challenge data (it should be the unlock payload)
Libre 3 8065592AA8F0: security challenge # 0106: 61741c81b2b7c7e4ee8647f0eba8dfc106010000cbda74
Libre 3 8065592AA8F0: received 25 bytes of challenge data (payload: 23 bytes):
00 61 74 1C 81 B2 B7 C7 E4 EE 86 47 F0 EB A8 DF C1 06 01 00
01 00 CB DA 74
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (5 bytes received): hex: 0100cbda74, string: "��t"
Bluetooth: 8065592AA8F0 did update value for challenge data characteristic (20 bytes received): hex: 0061741c81b2b7c7e4ee8647f0eba8dfc1060100, string: "at������G����"
Libre 3 8065592AA8F0: expected response size: 25 bytes (payload: 23 bytes)
Bluetooth: 8065592AA8F0 did update value for security commands characteristic (2 bytes received): hex: 0817, string: ""
Bluetooth: 8065592AA8F0 did write value for security commands characteristic
Bluetooth: 8065592AA8F0 did update notification state for certificate data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for challenge data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for security commands characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for factory data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for event log characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for clinical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for historical data characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for one-minute reading characteristic: notifying
Bluetooth: 8065592AA8F0 did update notification state for patch control characteristic: notifying
Bluetooth: sending to Libre 3 8065592AA8F0 `read security challenge` command 0x11
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089823FA-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Write", "Notify"] (certificate data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 089822CE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Write", "Notify"] (challenge data)
Bluetooth: discovered Libre 3 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 service's characteristic 08982198-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Write", "Notify"] (security commands)
Bluetooth: discovered Libre 3 data service's characteristic 08981D24-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (factory data)
Bluetooth: discovered Libre 3 data service's characteristic 08981BEE-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (event log)
Bluetooth: discovered Libre 3 data service's characteristic 08981AB8-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (clinical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898195A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (historical data)
Bluetooth: discovered Libre 3 data service's characteristic 0898177A-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify"] (one-minute reading)
Bluetooth: discovered Libre 3 data service's characteristic 08981482-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Read", "Notify"] (patch status); avoid enabling notifications because of 'Encryption is insufficient' error
Bluetooth: discovered Libre 3 data service's characteristic 08981338-EF89-11E9-81B4-2A2AE2DBCCE4, properties: ["Notify", "Write"] (patch control)
Bluetooth: discovered 8065592AA8F0's service 0898203A-EF89-11E9-81B4-2A2AE2DBCCE4 (security service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 089810CC-EF89-11E9-81B4-2A2AE2DBCCE4 (data service); discovering characteristics
Bluetooth: discovered 8065592AA8F0's service 180A (device information); discovering characteristics
Bluetooth: 8065592AA8F0 has connected; discovering services
Bluetooth: connecting to 8065592AA8F0...
Bluetooth: 8065592AA8F0's data service UUIDs: [089810CC-EF89-11E9-81B4-2A2AE2DBCCE4]
Bluetooth: found 8065592AA8F0: RSSI: -83, advertised data: ["kCBAdvDataServiceUUIDs": <__NSArrayM 0x2838a60d0>(
089810CC-EF89-11E9-81B4-2A2AE2DBCCE4
)
, "kCBAdvDataRxSecondaryPHY": 0, "kCBAdvDataTxPowerLevel": 5, "kCBAdvDataTimestamp": 678542844.396914, "kCBAdvDataRxPrimaryPHY": 1, "kCBAdvDataIsConnectable": 1]
Bluetooth: skipped MJ_HT_V1, scanning for 'abbott'...
Bluetooth: skipped an unnamed peripheral, scanning for 'abbott'...
Bluetooth: skipped an unnamed peripheral, scanning for 'abbott'...
Thank you Anubhav for your PR! There have been many forks of DiaBLE in the past but none submitted the implementation of new features.
I have been publishing a public beta on TestFlight for only a couple of days and now I must proceed very carefully in applying major modifications to project.pbxproj.
Could you please try refactoring your extension by putting it in a DiaBLE/DiaBLE/Widgets subdirectory as Glucose Direct for example is doing in https://github.com/creepymonster/GlucoseDirect/tree/main/Widgets ?
I tried by myself to add a Widget Extension target from Xcode 15.2, using DiaBLE.xcconfig as the configuration base (ff3ee94) and adjusting the WidgetsExtension.entitlements and Info.plist’s paths to point to the DiaBLE/Widget subfolder where I gathered them (d39afe6).
It compiled fine but, when I tried to run the WidgetExtensions scheme, Xcode was crashing almost immediately so I reverted the commits in main but left them in the dev branch: https://https://github.com/gui-dos/DiaBLE/commits/dev
I rebased dev on main and will retry...