Open gotpancreas opened 3 years ago
@gotpancreas a new login method was introduced in the EU during the summer and it was solved very soon, the mmconnect was modified. However there was a small bug in the code, which caused an error in NS if there was a temporary error in CareLink EU. It seems to me, that the same new authentication method was also introduced in the US and thus the mmconnect is not working anymore for US.
@bewest based on this issue and other FB posts in CGM in the Cloud it seems to me that the authentication for CareLink was changed in the US to the same as in the EU. Could you please modify the carelink.js
for the US to use the same authentication logic and URLs as EU, but with country code us? As I see it the country code is defined at more places in the code: default value 'gb' for DEFAULT_COUNTRYCODE
and also hardcoded in the CARELINKEU_LOGIN_URL
url end: country=gb&lang=en
. Maybe the country and language parameters in the CARELINKEU_LOGIN_URL
should be generated using the CARELINKEU_LOGIN_LOCALE
?
Interesting. Fantastic, that actually might make things a bit simpler. Regarding parameters, we/I really need them to be able to be passed in. If you audit the code you'll see that I added some code to inspect and reconstruct URLs based on parameters that are either dynamically generated or passed in at use/run-time. One of the reasons this is important is testing, but another is to safely enable "multitenant" use, where one long lived process might be responsible for validating credentials for many users across the world, and similar use cases where a single process wants to call these functions with slightly different parameters. Thanks for the notes!
Please see for patches to help fix this issue.
Howdy all, we've had some success with updates on this. The most recent version released contains updates to better handle the undocumented changes from Medtronic. There are some lingering issues having to do with whether or not IP addresses from shared cloud environments, such as Heroku remain blocked due to past activity. The resolution in these circumstances is to obtain a new IP address.
I tried running mmconnect on a Linux PC. I am accessing a Carelink EU account tied to my daughters 780G pump. It starts and puts out one line:
[MMConnect] Wait 0 seconds before start
After that it just sits there and no data is displayed in NS. Is there any way I can check what it is doing?
Yes, if you are familiar with environment variables, you can set CARELINK_QUIET=false
which should print additional logging messages.
OK, thanks. I must have missed this. Anyway I get the following message:
2021-01-25T20:51:36.591Z [Arguments] {
'0':
'GET data https://carelink.minimed.eu/patient/connect/data?cpSerialNumber=NONE&msgType=last24hours&requestTime=1611607896591' }
2021-01-25T20:51:37.389Z [Arguments] { '0': 'Stale CareLink data: 26860131.62 minutes old' }
But the official Carelink Connect App shows correct data. Any idea?
26860131 minutes are 51 years, so it looks like CareLink reports timestamp of 1970 (unix epoch time 0).
Maybe this is related to this comment and the data from the 780G uploaded with the Minimed Mobile app can actually not be retrieved with the mmconnect plugin.
Hi there. I'm just confirming the same thing that @ondrej1024 reported. I'm on a 770g in the US and I'm also seeing the "Stale CareLink data..." message as well:
2021-01-25T23:20:13.474Z [Arguments] {
'0': 'GET data https://carelink.minimed.com/patient/connect/data?cpSerialNumber=NONE&msgType=last24hours&requestTime=1611616813474'
}
2021-01-25T23:20:13.939Z [Arguments] { '0': 'Stale CareLink data: 26860280.21 minutes old' }
Also similar to ondrej1024, I'm seeing accurate and up-to-date data in the Minimed Mobile app (iOS) and on CareLink Connect via web:
In case it's helpful, I also get the following result if I change the value of "STALE_DATA_THRESHOLD_MINUTES" in transform.js to something greater than the value shown in the "Stale CareLink data..." error above (in this example, I used "STALE_DATA_THRESHOLD_MINUTES = 27860280"):
2021-01-25T23:28:58.163Z [Arguments] {
'0': 'Guessed pump timezone +44767100 (pump time: "Feb 20, 2072 22:53:56"; server time: Mon Jan 25 2021 17:28:56 GMT-0600 (Central Standard Time))'
It looks to me like the pump time is being reported differently than we're interpreting it? Please excuse me if this isn't a useful contribution - I'm still quite new to all of this and am simply trying to help get to the bottom of this. If there's anything further that I can do to help the cause, please advise.
So just to be clear, I'm still a little confused.
If the data is not visible in Medtronic's own web based display, we might have to pursue options other than this bridge.
Does 770g upload data to Carelink web portal
Yes, in my case the 770g connects via BLE to Minimed Mobile app (for me, this is on an iPhone) which then uploads the data to CareLink in real-time (or near real-time).
Is recent data from 770g visible in the web portal?
Yes, the web portal reflects the same real-time data that the app shows (which is also the same as my pump shows).
I can't personally speak for the 780g, but Medtronic has implied that the 770g and 780g use the same hardware (MMT-1880) and that the only difference is software. That is to say, that I should (in the future) be able to update my pump with new software in order to upgrade it to 780g. This hardware commonality leads me to believe that they are quite likely to behave similarly.
@bewest - I will email the HAR file to you since I think it likely contains personally identifiable information.
The way I understand it, this is how the data flows via the Medtronic infrastructure:
The Minimed Mobile app sends new sensor and pump data every 5 mins to the Cloud which can be downloaded and displayed by the Carelink app. However I am not able to see any data on the web portal. I tried this with a web browser both from a PC and Android phone. When going to the "Connect" tab, this message is displayed:
Interesting... this is different than what I'm experiencing. @ondrej1024, it looks like you might be logging in to CareLink Web with a Care Partner account and not the main patient account? The reason I think this is because the icon in the upper right of your screenshot appears different than in my screenshot - and I've seen the same icon as you have whenever I log in using a Care Partner account. I don't know for certain that this would make a difference, but I'm curious to see if using the main patient account would at least let you see Connect data on the web.
To help with clarity, here's what I'm experiencing:
Model: 770g Location: US (carelink.minimed.com) Logged in as main patient account: Connect tab shows all data in real time Logged in as Care Partner account: Connect tab shows all data in real time
I have never seen the message in CareLink web that says "Please download the mobile application...". In a previous post, you mentioned that you're using a 780g and in the EU, and I'm trying to understand whether we're seeing differences because 1) the type of account you're using, 2) location/server (EU), or 3) you're using a 780g.
I wonder if this is simply a privacy/GDPR thing? That is to say that it's working for me in the US, but Medtronic doesn't allow this function for EU users because of privacy laws in the EU?
You are right, when I took the screenshot I was using a Care Partner account. But I have also tried with the patient account and it does not make any difference.
I suspect it could also be a question of the combination of browser and operating system and only a few combinations are allowed. I have tried both Firefox and Chromium on Ubuntu and I get a warning that this is not supported but it let's me log in anyway.
There is a report here that it was seen working only from a mobile phone browser and not from desktop PC. Really confusing 😕
What OS and browser are you using?
I'm having success using Chrome v87.0.4280.141 on Windows 7 and Windows 10, and also using MS Internet Explorer v11.0.9600 on Windows 7.
Now I tried using a user agent switcher with Firefox, posing as a Chrome browser on Windows 10. But that doesn't change the fact that there is no real time data shown on the Carelink site for my account. So there must be some other criteria as you wrote earlier.
I guess it would be really helpful to find out what interface the Carelink Connect app is using to retrieve the data from the Cloud. Probably a proper REST API, unfortunately not documented anywhere.
No indeed wouldn't be documented but if you inspect and follow that page you should see the GET calls and maybe some POSts. because we need only what we see in the website for US. So in fact they could find the corresponding rest calls that are happening from the site --> Carelink Cloud.
Two different things happen with the 7X0G, every 5 minutes a subset of data is uploaded to the cloud, in the US it can be viewed with mobile browser (Safari...) by logging into patient or caregiver account and it looks (almost) identical to what you see in the app. Every 24 hours all of the data that was uploaded from the 670G is uploaded, it can only be viewed by a computer (not mobile browser) by logging into the same portal as above. After login there are 2 different redirects /home for desktop and something different for Mobile which is also different in EU vs. US. My guess is in EU you would have to mimic whatever Browser ID the App is sending.
Perhaps related to the original problem posted in this thread, I'm having trouble logging in to Carelink. Turning off quiet mode, it looks like we're using the EU URL but I'm based in the US. I've tried with the environment variable MMCONNECT_SERVER absent and set to "US", with no visible difference. Log showing failed logins:
graceallen-carelink-to-ns-logs-1612205335876.txt.
I am able to log in to the Carelink website myself using Chrome and can see current data as I would expect.
Any ideas what I could be doing wrong? Thanks!
@theNateAllen yes. This probably needs better documentation, but please use MMCONNECT_COUNTRYCODE=us
as well.
I've noticed that MMCONNECT_COUNTRYCODE
needs to be set to an ISO3166 country code that matches the regulatory domain that MMCONNECT_SERVER
will use. I have found it's best to set MMCONNECT_SERVER
explicitly to the server to be used:
MMCONNECT_SERVER=carelink.minimed.com
MMCONNECT_COUNTRYCODE=us
MMCONNECT_SERVER=EU
MMCONNECT_COUNTRYCODE=uk
Hope this helps. You may be observing bugs in the environment handling logic, apologies.
Thanks @bewest, that got me going. I'm now stopped by the stale data error reported above. Let me know if capturing my network traffic while viewing the Carelink site would be useful.
Is 770g working in other countries or just broken in US? Are other pumps working or broken? It looks like there is an issue with at least getting US data, although looking to confirm what is working vs not.
As I'm digging through the HTTP traces, I'm pretty impressed with Medtronic's system here.
https://carelink.minimed.com/patient/users/me/profile
provides profile information, critically a field called username
(presumably the same as what was used to log in?)https://carelink.minimed.com/patient/countries/settings?countryCode=us&language=en
fetching this url provides an object with property blePereodicDataEndpoint
, in this case: blePereodicDataEndpoint: "https://clcloud.minimed.com/connect/v2/display/message"
https://carelink.minimed.com/patient/users/me
fetching this URL after authorized provides a role
== CARE_PARTNER
in the case I'm looking at.POST
to https://clcloud.minimed.com/connect/v2/display/message
with a payload of eg { username: "loginuser", role: "carepartner" }
finally gives us all the data we expectIn the US, role can be PATIENT
, and in EU, it may be PATIENT_OUS
when fetching from /me
.
I see: there are patient roles and then "Care Partner" roles. Care partner roles must post their authorized role and username to the blePereodicDataEndpoint
to get data, otherwise patients can poll their own /patient/connect/data?cpSerialNumber=NONE&msgType=last24hours&requestTime=
? That's my current theory, anyway. I still don't quite understand the Careportal Partner vs Connect Patient concepts fully. https://www.youtube.com/watch?v=whTzTItL_i0
The patient is the person with the pump and running the MiniMed App what uploads some data every 5 minutes and complete data every 24 hours, they authorize Caregivers ("Care Partner") who run a different App each with their own users ID and Password.
@paul1956 yes, in addition there seem to be a whole host of rules attached to these roles. I can see at least PATIENT
, PATIENT_OUS
, and CARE_PARTNER
and that the behavior is different. It looks like patients cannot access real-time web carelink display unless the mobile app is enabled and installed and linked to the account.
However, the carelink patient credentials cannot be used in the app. Rather, in order to activate the mobile app, you must sign up for a new carepartner credentials in the mobile app, and only in the mobile app. From what I can see, it's not possible to create a carepartner in carelink web portal?
This is part of what confuses me, there is a way to link different accounts together for the purposes of sharing. It looks like the minimum path in order to "share with yourself" is to create both carepartner credentials as well as patient carelink credentials. It's important to note that these credentials require different behaviors. mmconnnect only works with "patient carelink credentials", and doesn't yet know how to use carepartner credentials. It looks like the self-patient carelink credential access is mediated by installation of the mobile and linking the new carepartner account to an existing careportal patient account. According to the youtube video, a similar flow is required for each carepartner.
There are other rules as well, it looks like the countrycode matters quite a bit: the patient careportal and carepartner accounts must share the same countrycode. Medtronic only supports Followers inside the same country.
Finally, the new Carelink interfaces include mock or stub responses on some endpoints, it looks like specifically aimed at preventing things depending on the results from crashing while yielding no data. We'll need continued analysis to really gather the full requirements.
Right now it looks like the most reliable mechanism is going to be:
/patient/users/me
to find the role
is set to CARE_PARTNER
.
role == 'CARE_PARTNER
then GET
/patient/countries/settings?countryCode=us&language=en
with correct parameters and set the json url to the result of the property blePereodicDataEndpoint
in the response./patient/connect/data
( role should be PATIENT
or PATIENT_OUS
)It looks like an approach like this should work more consistently without worrying as much about which credentials are used, so long as the countrycode matches. Unfortunately, attempting all country codes could result in locking accounts or worse, so users will need to know and correctly indicate the countrycode of the original patient account at multiple points in the workflow.
@bewest : I'm triying from UE (ES - Sapin) and cannot get data . The login seems correcta, but the minimed-connect-to-NS can't fetch data from Carelink Server .
How can I help you with this issue?
Regards ! !
New user here in the US with a 770G. Seems like Medtronic is forcing two factor authentication on my account. I assume this is the reason why I can't see data in NS, along with the fact I keep getting emails with a 2FA password once a minute.
Any way around this?
From carelink:
Emails after configuring setting up night guard:
Is there anything I can do to help solve this? The carelink connect alerting is garbage since dismissing the alert on the pump can happen before the app even gets the alert. I'm missing any alerts entirely thanks to subconscious button clicks by my son.
I have nightscout configured to pull and it appears to be trying, but is getting no data. Interesting log bits below. I am in the US and am using the same username and password on the carelink connect app and website successfully. I do not have two factor enabled for this login.
Mar 05 04:03:09 jackson-bg app/web.1 2021-03-05T09:03:08.739Z [Arguments] { '0': 'Logging in to CareLink' } Mar 05 04:03:09 jackson-bg app/web.1 2021-03-05T09:03:08.743Z [Arguments] { '0': 'EU login 1' } Mar 05 04:03:09 jackson-bg app/web.1 2021-03-05T09:03:08.744Z [Arguments] { Mar 05 04:03:09 jackson-bg app/web.1 '0': 'EU login 1', Mar 05 04:03:09 jackson-bg app/web.1 '1': 'https://carelink.minimed.com/patient/sso/login?country=gb&lang=en' Mar 05 04:03:09 jackson-bg app/web.1 } Mar 05 04:03:09 jackson-bg app/web.1 2021-03-05T09:03:08.950Z [Arguments] { Mar 05 04:03:09 jackson-bg app/web.1 '0': 'EU login 2 (url: https://carelink.minimed.eu/patient/sso/login?country=gb&lang=en)' Mar 05 04:03:09 jackson-bg app/web.1 } Mar 05 04:03:09 jackson-bg app/web.1 MiniMed Connect error: Error: Request failed with status code 403
@mattster98 are you using 770G? Is the Connect online web application working for you in CareLink (https://carelink.medtronic.com/)? In the EU the Connect online web application, which can be used with Guardian Connect and which is used as the datasource for MMConnect is not available for 780G users.
edit I tried that carelink url and cannot login now.. but can use those credentials with the carelink connect app. Let me figure out what is going on there..
The application is functioning properly, just doesn't work well for our needs.
On Fri, Mar 5, 2021, 4:23 AM Bence Szász notifications@github.com wrote:
@mattster98 https://github.com/mattster98 are you using 770G? Is the Connect online web application working for you in CareLink ( https://carelink.medtronic.com/)? In the EU the Connect online web application, which can be used with Guardian Connect and which is used as the datasource for MMConnect is not available for 780G users.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nightscout/minimed-connect-to-nightscout/issues/11#issuecomment-791288632, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALGX4RB5ACH7COTOBT3BS3TCCPHPANCNFSM4UNUCUWA .
@mattster98 sorry, I may have sent the wrong login US link, I know it is different from the European, but not sure about the correct one. Anyhow, you should be able to login to CareLink using the https://carelink.minimed.eu/app/login and by selecting US. So when you login to CareLink is the online Connect webapp available for you and can you see the current sensor glucose values like this:
In the EU this is only working for Guardian Connect users and not 780G users.
Whew 😅 YES that got me in. Why is it so hard to find the right URL to log in just to get you back to the same url in the end!! I guess that is part of the issue..
Yes, I just confirmed that worked with the account I'm using and I do see the pump data there.
On Fri, Mar 5, 2021, 8:38 AM Bence Szász notifications@github.com wrote:
@mattster98 https://github.com/mattster98 sorry, I may have sent the wrong login US link, I know it is different from the European, but not sure about the correct one. Anyhow, you should be able to login to CareLink using the https://carelink.minimed.eu/app/login and by selecting US. So when you login to CareLink is the online Connect webapp available for you and can you see the current sensor glucose values like this:
[image: CareLink-Connect-OnlineWebapp] https://user-images.githubusercontent.com/32592661/110122665-31f0f580-7dc0-11eb-90ce-c5217a071da4.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nightscout/minimed-connect-to-nightscout/issues/11#issuecomment-791424091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALGX4TZHHVOBLGVFGVR6OLTCDNEJANCNFSM4UNUCUWA .
I realized in my edit I didn't answer your original question. I am using the 770g.
@mattster98 wrote to you in gitter, I wouldn't like to flood this thread.
Has there been any movement on this issue? Is Medtronic blocking calls from Nightscout or blacklisting the Heroku site? I've tried just about all of the suggestions available but still not able to get any data into Nightscout.
Bence said that's the case. I've been working with Bence on updates to xdrip+ to provide a bridge as an interim solution, but it's not ready yet.
On Fri, Mar 12, 2021 at 2:54 PM rankelly @.***> wrote:
Has there been any movement on this issue? Is Medtronic blocking calls from Nightscout or blacklisting the Heroku site? I've tried just about all of the suggestions available but still not able to get any data into Nightscout.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nightscout/minimed-connect-to-nightscout/issues/11#issuecomment-797718272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALGX4XZ4YW24W45TT2Z7R3TDJPP3ANCNFSM4UNUCUWA .
Thanks.
Hi all, Im a new to the this modern version of NS, im on the 770g system. Just verifying as of now, there's no way to pull data from Carelink to NS?? Thanks
Bence said that's the case. I've been working with Bence on updates to xdrip+ to provide a bridge as an interim solution, but it's not ready yet. … On Fri, Mar 12, 2021 at 2:54 PM rankelly @.***> wrote: Has there been any movement on this issue? Is Medtronic blocking calls from Nightscout or blacklisting the Heroku site? I've tried just about all of the suggestions available but still not able to get any data into Nightscout. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#11 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALGX4XZ4YW24W45TT2Z7R3TDJPP3ANCNFSM4UNUCUWA .
Hi @mattster98 , I'm an spain user and currently I use the 780G . could I help you in some way? Thanks for your work ! ! !
@ClifClimber currently I am trying to create an alternative solution for downloading data from CareLink instead of MMConnect, which is currently seems to be blocked by Medtronic when used in Heroku. My original scope was Guardian Connect, but I am working on extending it to other devices too. Because it is not MMConnect I think it is not related to this thread. I will write you in Gitter.
@ClifClimber currently I am trying to create an alternative solution for downloading data from CareLink instead of MMConnect, which is currently seems to be blocked by Medtronic when used in Heroku. My original scope was Guardian Connect, but I am working on extending it to other devices too. Because it is not MMConnect I think it is not related to this thread. I will write you in Gitter.
@benceszasz This sounds interesting. I was also thinking about a solution to get the data out of the 780G. I would prefer to bypass the whole CareLink infrastructure and pull the data directly from the pump via BLE but this seems to be rather a long shot. So I reckoned getting the data from Carelink might be easier but reading this thread I am not so sure about this anymore.
So I would like to know more about your solution. Is there a place where you can share you ideas and the work you've already done?
@ondrej1024 I am just trying to write a port of MMConnect in Java when my time allows and it is in a very early stage. The logic is the same as it is in MMConnect. I don't have a place for it yet, if you want to you can find me in Gitter.
Wouldn't it be easier to pull the glucose level from the Minimus Mobile app notification. The notification updates every time there's new data.
@Cosmin702 It's a very good idea, but only for Android and xDrip+. With this way a new follower can be written, that would listen to notification with specified app (PACKAGE_NAME) and maybe with some regex to get the glucose value.
@benceszasz What is your opinion about this? I would take a look on this, but sadly I don't have time for a few months.
With Android it' able to get this this kind of information for any notification:
{
"filterbox.field.APP_NAME": "Guardian CGM",
"filterbox.field.PACKAGE_NAME": "com.medtronic.diabetes.guardianconnect",
"filterbox.field.USER_ID": 0,
"filterbox.field.ONGOING": true,
"filterbox.field.WHEN": 1617652810529,
"filterbox.field.GROUP": "com.medtronic.guardian.services.notification.l.g",
"filterbox.field.CHANNEL_ID": "channel_1",
"filterbox.field.HAS_CONTENT_VIEW": false,
"filterbox.field.HAS_BIG_CONTENT_VIEW": false,
"filterbox.field.HAS_HEADS_UP_CONTENT_VIEW": false,
"android.showChronometer": false,
"android.progress": 0,
"android.showWhen": true,
"android.icon": 2131230921,
"android.title": "Sensor disconnected",
"android.bigText": "Connect transmitter to sensor to continue.\nIf transmitter is connected to sensor, ensure connection is secure.",
"android.template": "android.app.Notification$BigTextStyle",
"android.progressMax": 0,
"android.appInfo": "ApplicationInfo{c025104 com.medtronic.diabetes.guardianconnect}",
"android.progressIndeterminate": false,
"android.text": "Connect transmitter to sensor to continue.\nIf transmitter is connected to sensor, ensure connection is secure."
}
hello, if this is not the right place, excuse me, a question? Wouldn't it be possible to work on a patched apk that does the uploader function?
@AlejandroPaula Yes, this discussion here is probably not the right place. There have been a lot of other ideas (including modification of the apk) in this discussion, but it was also not the right place. so it was closed.
There are lots of ideas, suggestions, some tests ecc floating around and I was wondering what would be the right place, to collect all this information. The common goal is to pull the data from the Minimed 770G/780G and there are potentially many ways to do this. This is completely independent from Nightscout, so it is probably necessary to create a site to coordinate the efforts dedicated to this goal. I don't know if a new Github repository would be a good idea or if there are more appropriate tools, like Gitter or others.
@FredMK I can look at it. Notifications seems to provide only limited information, but can work even when CareLink is down.
@Cosmin702 could you send me notification samples with details using some kind of notification manager (for example FilterBox or Notification Log etc.)? It would be good to have all kind of notifications generated by the application (normal status info, connection lost, pump notifications, etc.). You can send them for example in Gitter.
Not sure whether this is the right place to post (I’m new to GitHub), but I’ve been trying to set up a new NS instance to connect with my 770g via CareLink and the MiniMed Mobile app. I’ve got NS working fine, but there mmconnect portion seems to be returning a 404 error and I’m not able to see any SGV or pump data in NS. I’ve confirmed that the data appears in CareLink as expected and that my CareLink credentials are correct in mmconnect as well. The login page for CareLink US has recently changed, so I’m wondering if it uses a different server than before (or a problem similar to this)? I’ve read discussion about issues with CareLink EU as well, but not so much about US. I’m happy to provide logs, do testing, or whatever I’m capable of to help this project and make it work!
Thanks for all this community has done so far, and thanks in advance for your help!