Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop integration / Spying on LibreTransmitter #463

Open
Menno86 opened this issue Sep 23, 2023 · 11 comments
Open

Loop integration / Spying on LibreTransmitter #463

Menno86 opened this issue Sep 23, 2023 · 11 comments

Comments

@Menno86
Copy link

Menno86 commented Sep 23, 2023

With the upcoming release of Loop 3.4.0 the easy built script integration for xDrip4iOS will no longer be available. This will force a lot of people - who do not know how to realize the integration in Loop (such as myself) - to abandon xDrip4iOS.

It would be great if there is a way to keep using xDrip4iOS since it is far superior then the LibreTransmitter plugin that will be in Loop 3.4.0 (and if already in the current Dev).

### Would it be possible to:

A. xDrip4IOS spying on Loop communication?
To use the Xdrip4iOS app as a follower of LibreTransmitter plugin. So that it is practically spying on the communication between Loop and the Libre sensor.

B. replacement for lack of L&L build script
Create a manual to get xDrip4iOS integration working, since the built script no longer provided this in the Code Customization script.

There is currently an integration script which can be found on the L&L website, but this will no longer work as of the release of Loop 3.4.0.

Zullip
A related request was also placed in LoopKit (click) and Zullip (click).

@JohanDegraeve
Copy link
Owner

JohanDegraeve commented Sep 23, 2023

A.
xDrip4iOS has a setting "suppress unlock payload", enabling this allows to run the official librelink app (with bluetooth allowance) and xDrip4iOS. This should work also with Loop. If you first start Loop, let it connect to the sensor, then force close loop, launch xDrip4iOS, connect it to the sensor, with the setting "suppress unlock payload" enabled. Once connected relaunch Loop. I didn't test this with Loop but it works with LibreLink.

xDrip4iOS will receive the data that contains the readings from the transmitter and is able to decode the data.
There might (actually will) be a difference in values. I see that LibreTransmitter has it's own calibration algorithm, which is probably different from the xDrip4iOS algorithm. Although I would expect that if you calibrate both, readings should be close to each other.

B.
that should still work if you follow the steps described here https://github.com/JohanDegraeve/xdrip-client-swift-1
or will it not work anymore as of 3.4.0? In that case, stick to 3.2.3 for now

@paulplant
Copy link
Collaborator

@Menno86 , please keep Johan's comments about using the "suppress unlock payload" out of any Facebook comments for now... we've mentioned this function several times and it has almost always resulted in problems, mainly due to people not correctly following the instructions that he has written and we would end up with hundreds of people complaining that the app "doesn't stay connected" :) That's why it's still in developer settings for now until we can test it enough to see if it's worth making "public". (By "worth it" I mean if it can be supported by the resources we have due to the amount of people that would likely have issues).

Give it a good try during several days and let us know your feedback here...also test connecting and disconnecting now and again in xDrip4iOS and also manual scanning with LibreLink.

Let us know if (B) doesn't work with Loop dev. I can try and test it in the next days but I'm travelling at the moment.

There is also a good chance that we can just update the share client and then use the Loop and Learn script to incorporate the required changes automatically.

@Menno86
Copy link
Author

Menno86 commented Sep 25, 2023

I will start testing this weekend and will let you know. (@paulplant i’ll keep the testing out of the facebook groups)

@crsohr
Copy link

crsohr commented Sep 30, 2023

Curious about the “instructions” regarding how to successfully enable “suppress unlock payload”. I tried searching previous issues here and check the code but did not find anything outside of the initial commit and comments therein — and I'm not using Facebook so if guidelines have been posted there that would have been out of my reach.

I'd be interested in using the stock smoothing algorithm for readings, which I suspect provides lower values for me (I'd prefer that to get a better HBA1c), and still be able to enable better notifications (for fast rise/drop, repeated low alarms, etc.)

@OliNix
Copy link

OliNix commented Sep 30, 2023

I have attempted to test this multiple times, with always the same result and no success; I fall at the first hurdle. I have tried to active "Suppress Unlock Payload" and have not changed any other settings, nor allowed any other apps permission to connect to the sensor (so only changing 1 variable).

Setup

  • iPhone 14 Pro (iOS 17.0.2 - same experience on 16.7)
  • xDrip4iOS 4.11.5 (4190)
  • Libre 2 Sensor (direct connect to xDrip4iOS)
  • Bluetooth permissions disabled in LibreLink
  • Sensor started with LibreLink

See my findings from after activating "Suppress Unlock Payload" below:

  1. The sensor intermittently turns from "Scanning" to "Connected", but reverts back to "Scanning" immediately (I only know it connects due to the regular "successful connection popup" that you get when making a new connection to the sensor. xDrip4iOS does not ever receive any readings.
    image
    image

  2. When "Use transmitter algorithm?" is "checked":

  • No readings are ever recorded by xDrip4iOS.
  • No error messages are seen other than missed readings.
  1. When "Use transmitter algorithm?" is "unchecked":
  • when you try to calibrate, you receive an initial error message of "You cannot calibrate unless you have started a sensor"
    image
  • If you disconnect and reconnect the sensor, the error message changes to "You cannot calibrate unless you have a sensor connected".
    image
  • Due to the intermittent connection mentioned in (1), you are never able to calibrate or receive any readings.

Hope this helps.

I am happy to retest if I have missed an essential prerequisite.

@JohanDegraeve
Copy link
Owner

I have attempted to test this multiple times, with always the same result and no success

If "suppress unlock payload" is set in xDrip4iOS then another app needs to be running, connected to the Libre and have the suppress unlock payload enabled.

Here's what I tested just now

  • first start a new sensor with the official librelink app (as we always do), this one has bluetooth disabled. After start, force close LibreLink app
  • also enable "show BG in notifications" with interval 0
  • launched xDrip4iOS, scan and connect as usual, (with suppress unlock payload disabled) , once connected, and after have received a first reading, then enable 'suppress unlock payload'
  • force close xDrip4iOS
  • download Shuggah from the App store (I used second instance of xDrip4iOS with another name, but it will work also with Shuggah)
  • Now do the same with Shuggah, but don't enable 'suppress unlock payload'
  • After having received a reading, relaunch xDrip4iOS

after 1 minute I get this on my screen :
IMG_5076

The two instance of xDrip4iOS are able to receive and decode the readings. This will go on till the sensor expires.
Also after disconnect and reconnect. I remember some year ago or more I tested this for several days.

The two instances don't 'spy' on each other, they both receive the data from the libre sensor. Only one of them sends the 'unlock payload' command. But both are able to decrypt the data. (which I don't fully understand why because some decryption key is exchanged while doing the NFC scan).

Note : after removing Shuggah, you'll need to disable the "suppress unlock payload". There always needs to be one (just one app) that sends this command

This should be possible also with Loop and xDrip4iOS running in parallel.

You could use calibration in one of the two only. As long as xDrip4iOS is able to receive the data and some other app sends the 'unlock payload' command, then it should work.

This 'spying' mechanism as it's called here, is also what Loop is doing when it's used with a Dexcom G5 or G6. The official Dexcom app runs in parallel with room. The official app is handling the authentication, but both Loop and the official Dexcom app receive the data. It's a bit different than how it goes with Libre, because the data itself is not encrypted by the app. But it's the same principle that is used.

@JohanDegraeve
Copy link
Owner

I wonder however if it still makes sense to have this available? because Libre 3 is getting spread all over the world I assume? which can't be decoded yet

@JohanDegraeve
Copy link
Owner

too complicated for me :)

@robinwo
Copy link

robinwo commented Oct 28, 2023

Given Loop 3.4 is coming up.. Is there anything we could do? Or will Loop 3.4 officially rule out the use of other apps like xDrip for receiving Libre values. That would be a big setback..

@paulplant
Copy link
Collaborator

It won't necessarily rule anything out.

I guess that the way we include the xDripClient would just need to be updated, but to be honest we haven't actually looked at it.

We're really busy with other features now, but will definitely get around to looking at Loop soon.

@Menno86
Copy link
Author

Menno86 commented Jul 14, 2024

With the release of Loop 3.4 yesterday, this topic has become more relevant (see the first post under B). All customization options in the script have been removed, making it no longer possible to easily build Loop with the Xdrip plugin using Xcode.

A script or how-to guide for people with limited IT coding knowledge (like myself) would be greatly appreciated.

@paulplant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants