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

Connect LibreLink Time Delay #35

Open
timtheis opened this issue Jan 15, 2024 · 11 comments
Open

Connect LibreLink Time Delay #35

timtheis opened this issue Jan 15, 2024 · 11 comments

Comments

@timtheis
Copy link

Using Nightscout v15.02. Using the following environment variables.
CONNECT_SOURCE='linkup'
CONNECT_LINK_UP_USERNAME='xxxxxxxx'
CONNECT_LINK_UP_PASSWORD='xxxxxxxx'
CONNECT_LINK_UP_REGION='US'

Glucose data points show up, but it takes 22 minutes before they show in NS.
Attached jpeg...
1-Stopped using [timoschlueter]Libre Link up and started using Connect-linkup
2- Stopped Connect-linkup and resumed [timoschlueter]Libre Link up
Note the 22 minute period of no data. This is the delay I was experiencing.

This is probably as designed... but is there a way to increase the sampling from 5 minutes to 1 minute through a CONNECT_LINK_UP_TIME_INTERVAL environment variable?
BGCData

@timtheis
Copy link
Author

That 22 minutes probably includes server reboot time to switch between libre linkup systems... so the delay may actually be more like 20 minutes. I did check the system clock on my server and the time is accurate and is GMT. To be clear, I had to wait about 20 minutes for that sample just to the right of 1 to show up on the graph... and the Glucose reading in the upper right was just --.. it never updated.

@FoosaHeven
Copy link

FoosaHeven commented Jan 23, 2024

I do have the same issue. I have setup nightscout for the first time and have no other tooling using the linkup interface. I also uninstalled the LibreLinkUp app from my mobile which I used to setup the account. It's running now for 12h and I get my data in avarage 20 minutes delayed. Any ideas what is going wrong?

image

@ady624
Copy link

ady624 commented Jan 24, 2024

I believe this is intentional [by Libre]. Libre does 20 minutes, Dexcom delays Apple HomeKit by a whole 3 hours. This is most likely their way to prevent other apps from making real time decisions on this data. I opened a PR to fix the delay with LinkUp.

@ady624
Copy link

ady624 commented Jan 24, 2024

And this PR addresses the interval.

@timtheis
Copy link
Author

That was quick!!! Thank-you for doing this! I'm unfamiliar with the nightscout-connect update process... Is there a way I can tell which version of nightscout will incorporate the changes? Thanks again for your quick response. It's very much appreciated.

@ady624
Copy link

ady624 commented Jan 24, 2024

I do not know their process, I believe PRs would have to be approved, merged, then released as part of a future NS release. If you're feeling adventurous, here's is a HACKY way to do it, you can go into your NS instance where you installed it, browse into:

<your_installation_folder>/node_modules/nightscout-connect/lib/sources /librelinkup.js

make a backup copy, then replace it with this file from my fork. Or, better, implement the changes from the PRs into your file yourself. Restart the service afterwards and test that it still works. This is a risky way to do it, if your version is not the same as the one I modified, you may ruin your install. I recommend making the same changes yourself, based off of the PRs.

If using pm2 to run it as per NS instructions, if changing the my.env file to add the 1min interval, you may need to delete the pm2 item and readd it. If that's how you run it, per NS instructions, this should do it:

go to your NS folder, where you installed it, then:

lists the active services:
pm2 l

┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼───────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ server    │ default     │ 15.0.3  │ fork    │ 24704    │ 0s     │ 0    │ online    │ 0%       │ 31.4mb   │ hoobs    │ disabled │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

delete the item you want, ID is a zero based integer, left column, replace X with the proper ID:
pm2 delete X

reinstall the pm2 service:
env $(cat my.env) pm2 start lib/server/server.js

then save:
pm2 save

@ady624
Copy link

ady624 commented Jan 24, 2024

image

POC: No delay, data extends to 10:45am, and has one entry per minute 😋

@timtheis
Copy link
Author

I can confirm that your fixes work! I chose to modify my existing librelinkup.js file directly. Thank you for the guidance!!!

@ady624
Copy link

ady624 commented Jan 24, 2024

Well then, it's off to the races! Glad I could help.

@timtheis
Copy link
Author

timtheis commented Jan 24, 2024 via email

@ady624
Copy link

ady624 commented Jan 25, 2024

Thanks for the heads up, I've updated README.md as well to notify about the new CONNECT_LINK_UP_INTERVAL parameter.

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

3 participants