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

Medtronic 770G/780G combined with Guardian Link 3 compatibility #6568

Closed
mohammed-nep-group opened this issue Nov 23, 2020 · 92 comments
Closed

Comments

@mohammed-nep-group
Copy link

mohammed-nep-group commented Nov 23, 2020

If you need support for Nightscout, PLEASE DO NOT FILE A TICKET HERE
For support, please post a question to the "CGM in The Cloud" group in Facebook
(https://www.facebook.com/groups/cgminthecloud) or visit the WeAreNotWaiting Discord at https://discord.gg/zg7CvCQ

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Yeah I can't get data from my current system/from carelink to Nightscout

Describe the solution you'd like
A clear and concise description of what you want to happen.

I would like to pull data from carelink which stores the 780G and Guardian Link 3
Or maybe even pull it from the pump since this is an Bluetooth enabled one.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Pull data from the insulin pump itself since this is Bluetooth enabled, don't know if this is already possible.
Additional context
Add any other context or screenshots about the feature request here.

@iwanvandaele
Copy link

Same here

@mohammed-nep-group
Copy link
Author

mohammed-nep-group commented Nov 24, 2020

I think this is related to my ticket : #6520

Maybe also related : NightscoutFoundation/xDrip#1473

@michaelholderman
Copy link

michaelholderman commented Nov 28, 2020

Same here. Is this something a developer can do, or is it a limitation posed by Medtronic? (I believe you could setup Nightscout with their stand alone Guardian Connect system, which uses the same process as the 770/780 as far as data upload to Carelink.)

@michaelholderman
Copy link

I would love to help figure out how to get Nightscout to work with the 770/780g and Carelink. I have been using Nightscout for years with the 670g and also with the Guardian Connect system and now have a couple of 770g systems that I can use to test. Just not sure where to begin. Is there someone that has worked in this in the past that I could reach out to?

@benceszasz
Copy link

@michaelholderman if you have 770Gs, which you can use to test, then please check the CareLink device family of the 770G in CareLink, it is returned by the /patient/monitor/data REST API. You can use for example the network traffic monitor of a browser: /patient/monitor/data REST API is called, when you click on the Connect link in CareLink. The DeviceFamily can be found in the response of the https://carelink.minimed.com/patient/monitor/data request. For example with Chrome you can use the Network Traffic monitor in the Developer Tools (More Tools > Developer Tools).

@mohammed-nep-group
Copy link
Author

@benceszasz tried to use the api endpoint but resulted in :

{
"error": {
"type": "InvalidToken",
"group": "AUTH"
}
}

I don't know how the Authorization needs to be passed to Carelink. I already tried Basic auth , didn't work.

@mohammed-nep-group
Copy link
Author

mohammed-nep-group commented Dec 7, 2020

I have the 780G and would love to help, let me know where I can help,
If I do a GET to : https://carelink.minimed.com/patient/monitor/data
With a Bearer token which I took in a request from me to Carelink. I get the following message: Not Found

I think I need to pass a parameter but don't know what. In order to define who am I looking data for.

@mohammed-nep-group mohammed-nep-group changed the title Medtronic 780G combined with Guardian Link 3 compatibility Medtronic 770G/780G combined with Guardian Link 3 compatibility Dec 7, 2020
@mohammed-nep-group
Copy link
Author

@benceszasz however I found the following endpoint does return a GET result with adding the Bearer token :
https://carelink.minimed.eu/patient/dataUpload/recentUploads?numUploads=40

In this case 40 times in JSON.
{
"date" : 1607128862,
"mobileUploaded" : true,
"device" : "MiniMed 780G",
"serialNumber" : "_serial_number_removed_it_self"
}, {
"date" : 1607042518,
"mobileUploaded" : true,
"device" : "MiniMed 780G",
"serialNumber" : "_serial_number_removed_it_self"
}

@mohammed-nep-group
Copy link
Author

mohammed-nep-group commented Dec 7, 2020

@michaelholderman if you have 770Gs, which you can use to test, then please check the CareLink device family of the 770G in CareLink, it is returned by the /patient/monitor/data REST API. You can use for example the network traffic monitor of a browser: /patient/monitor/data REST API is called, when you click on the Connect link in CareLink. The DeviceFamily can be found in the response of the https://carelink.minimed.com/patient/monitor/data request. For example with Chrome you can use the Network Traffic monitor in the Developer Tools (More Tools > Developer Tools).

I found in the endpoints you specified the following, I think that's what you're looking for :

{
"deviceFamily" : "BLE_X"
}

@ondrej1024
Copy link

Hi all,
I would like to join the development efforts to implement an open source solution for reading the sensor and pump data from the 770G/780G. Before going into details I would like to understand how the official Medtronic system works and where we can hook up our community system. I made a simple drawing which shows how I think the system is working right now:

minimed 780g comms

So my first question is: Is my understanding of this correct?

If the answer to that question is yes, then I see 2 possibilities to get the data out of the system. The first is the Bluetooth connection (1) and the second the Carelink REST API (2).

Is there any documentation available for either of these 2? This is important to know because if there is none it will have to be a reverse engineering effort which is probably quite a long shot. So any information you might have would be very welcome.

@mohammed-nep-group
Copy link
Author

@ondrej1024 Hi man, Nice that you're also joining the effort to fix this.

I think your image is indeed correct, as far as I know couldn't find any documentation. But I am going to call or mail with Medtronic minimed.

@mohammed-nep-group
Copy link
Author

@ondrej1024 called with Medtronic but they told me they can't provide me with anything.

So I think the reverse engineering is the only way. Also since Medtronic is strict on this.

@ondrej1024
Copy link

That was to be expected. These companies don't collaborate with the open source community without specific agreements. 😞

I have contacted Tidepool.org to find out if they are working on support for the 770G/780G for their uploader software which supports all the previous Medtronic pumps. They have links to Medtronic. Hope to get some answer soon.

If there is no documentation whatsoever it will get very tricky. As for the pumps Bluetooth based radio communication, I guess we need dumps of the Bluetooth packets exchanged between the pump and the Minimed Mobile app. But that communication is probably encrypted. So if anyone has experience with that ...

To give you an idea of what we are talking about, here is a document describing the packet structure of the 640G/670G pumps radio based communication (which has also been reverse engineered).

@benceszasz
Copy link

benceszasz commented Dec 7, 2020

@ondrej1024 reverse engineering the complete Bluetooth communication and pairing process between the 7xxG pumps and the Minimed Mobile application seems very complicated for me.
Wouldn't it be "easier" to either try to "patch" the official MiniMed Mobile / CareLink Connect application like the patched Dexcom app / LibreLink app / Eversense app or try to reverse engineer the REST API communication with CareLink servers?

@ondrej1024
Copy link

@benceszasz

Wouldn't it be "easier" to either try to "patch" the official MiniMed Mobile / CareLink Connect application like the patched Dexcom app / LibreLink app / Eversense app

What exactly do yo mean by patching the official apps? These are proprietary. We don't have their source code.

or try to reverse engineer the REST API communication with CareLink servers?

Yes, this is probably easier, although the HTTP traffic is surely encrypted and at the moment I have no idea how to work around that.

But in the end I would prefer being able to pull the data directly from the pump via the Bluetooth link to be completely independent from the Minimed mobile app and the Carelink cloud.

@benceszasz
Copy link

@ondrej1024 by patching I mean to modify the offical application in a way to extract data from it just like in the case of the other CGM applications, which I have mentioned: read the internal database of the application or inject a custom code (for example an event listener to receive and forward the data to another app (eg. xDrip+) or NS). Of course the source code is not available, but there is the APK.

@mohammed-nep-group
Copy link
Author

Oké Guys, what are now the possibilities? Because I am still interested to fix this. @ondrej1024 @benceszasz

@pazaan
Copy link
Collaborator

pazaan commented Dec 9, 2020

The CareLink Connect app is using Firebase (and therefore Protobufs as the communication protocol), and has so far been resilient to the simple attacks (straight MITM, attempts to run it on a rooted Android device). There are further possibilities to try, but they start to get quite a bit more involved and low-level.

Longer term, I would say that we would want to RE the BLE, since reverse engineering the API still leaves data collection dependent on CareLink servers, which hasn't been as reliable up to this point that we'd like it to be 😉.
I would expect that the underlying app-level protocol is the same (or very similar) to the 600-series protocol. It's just the higher level BLE layer that needs to be unwrapped.
I don't have any background for sniffing BLE. Also, I don't have a 780G, so I don't even have a place to start.

@ondrej1024
Copy link

Hi Lennart, don't you think that Tidepool and Medtronic might reach some agreement as to documentation of the BLE based protocol ? Or is Tidepool just hoping that sooner or later someone will reverse engineer it so they can in also integrate it into the TP uploader?

@pazaan
Copy link
Collaborator

pazaan commented Dec 10, 2020

I'm not sure. It's possible, but I certainly wouldn't rely on it if you would like data in Nightscout sooner rather than later.

@markxoe
Copy link

markxoe commented Dec 13, 2020

I am not sure if this helps, but i just saw this: https://github.com/nightscout/minimed-connect-to-nightscout

@mohammed-nep-group
Copy link
Author

I am not sure if this helps, but i just saw this: https://github.com/nightscout/minimed-connect-to-nightscout

This is only working up to the 670g as I understand. The 770/780G series are a little bit different.

I already tried to let it work but didn't succeed with the data extractor you mentioned in the nightscout project.

@markxoe
Copy link

markxoe commented Dec 13, 2020

The 670G doesn't have a iphone app, I think it is for the 770G, maybe someone can try? I only have the 670G 😬

@ondrej1024
Copy link

@mohammed-nep-group , if you have a 770G or 780G you could start by dumping the BLE packets exchanged between the pump and the Minimed Mobile app on the Smartphone. If your phone is Android you could start here for instructions about packet sniffing.

@mohammed-nep-group
Copy link
Author

I do have the 780G and are already on it 2/3 weeks. So I do know how it works.
I only use an Iphone. Will be looking for a BLE sniffer for that. @ondrej1024

@mohammed-nep-group
Copy link
Author

I see there are possibilities on Iphone : https://www.bluetooth.com/blog/a-new-way-to-debug-iosbluetooth-applications/
As soon as I got Bluetooth sniffing logs, I will let it know here.

@mohammed-nep-group
Copy link
Author

Schermafbeelding 2020-12-15 om 19 48 24

You can see here a part of the Bleutooth Logging. I filtered only on the pump data.

@mohammed-nep-group
Copy link
Author

pump data .txt

Also here is a txt dump of some time logging the Bluetooth device. @ondrej1024

@ondrej1024
Copy link

I'll try to export all source code to upload here

Having readable source code of the Minimed Mobile app would be a huge step forward. Please keep us updated.

@gerardoabal
Copy link

gerardoabal commented Jan 24, 2021

With ApkTool I manage to decompile, change only one text, recompile and try... Did you see the difference?
Screenshot_2021-01-24-13-19-22-630_com medtronic diabetes minimedmobile eu
Screenshot_2021-01-24-14-38-41-897_com medtronic diabetes minimedmobile eu

Not a huge change, now I'll try to change behavior and do not block my device

@bewest
Copy link
Member

bewest commented Jan 24, 2021

Let's reorganize our efforts efficiently. Nightscout's cgm-remote-monitor has never pulled directly from a medical device. Instead, some application responsible for talking to the device, such as a radio or a modem, used by a mobile application collects the data and then uploads it to cgm-remote-monitor using the REST API. Openaps uses decocare (short for decoding-carelink), mmeowlink, while Loop uses RileyLink. When I was doing reverse engineering I found it best practice to make a project specifically focused on that one device. For example, if 7780G uses BLE, you will need repo related to the BLE communications. Does one exist? Or is this an augmentation and extension of decoding-contour-next-link? https://github.com/pazaan/decoding-contour-next-link
Is there a suitable location to pose the well framed question: "how do we get data form 780G?" I don't want to close the issue without having some place for the discussion to take place, but am concerned this is not the right place for it.

@bewest
Copy link
Member

bewest commented Jan 24, 2021

If the question is how to get data from Carelink web portal, the mmconnect plugin contains updates to allow this to work.

@gerardoabal
Copy link

gerardoabal commented Jan 25, 2021

Let's reorganize our efforts efficiently. Nightscout's cgm-remote-monitor has never pulled directly from a medical device. Instead, some application responsible for talking to the device, such as a radio or a modem, used by a mobile application collects the data and then uploads it to cgm-remote-monitor using the REST API. Openaps uses decocare (short for decoding-carelink), mmeowlink, while Loop uses RileyLink. When I was doing reverse engineering I found it best practice to make a project specifically focused on that one device. For example, if 7780G uses BLE, you will need repo related to the BLE communications. Does one exist? Or is this an augmentation and extension of decoding-contour-next-link? https://github.com/pazaan/decoding-contour-next-link
Is there a suitable location to pose the well framed question: "how do we get data form 780G?" I don't want to close the issue without having some place for the discussion to take place, but am concerned this is not the right place for it.

Very usefull your comments Ben, thanks a lot. I agree maybe this is not the place for this conversation perhaps could be moved to pazaan/600SeriesAndroidUploader#296. In my oppinion you can close this issue if you consider, but I wassent the one who create it, maybe mohammed-nep-group could refocus the topic.

As you say "Nightscout's cgm-remote-monitor has never pulled directly from a medical device" and has based other software-hardware "pieces" to do this necessary job in benefic of the whole system. I'm just looking to a new uploader "piece" that can work with 780G pump (so as far as I know is not compatible with the current uploader) and also improve the capabilities of the current solution. Perhaps I'm a idealist but having a Smartwatch (or similar wereable) with 4G/5G connectivity with the ability to pull data from pump and upload to NightScout will be a great step forward. From the point os view of a T1D child's father (my point of view) the NightScout and 600SeriesAndroidUploader system gave us a lot of calm and improve the health of our son during school time. THANKS ALL. But as anyone may imagine having all the time the uploader (smartphone+ContourNext) at 10m range from the kid is not real world situation. So provide the child with a wereable uploader is my dream.

The approach of using "mmconnect" plugin is an alternative workaround but not my first choice.

@ondrej1024
Copy link

If the question is how to get data from Carelink web portal, the mmconnect plugin contains updates to allow this to work.

@bewest Are you saying that this mmconnect plugin already works with the 780G insulin pump? I had understood that it was not compatible..

@bewest
Copy link
Member

bewest commented Jan 25, 2021

Lots to unpack: My advice is to make a new repo called decompiled-medtronic-carelink-connect, to store the decompiled source for analysis purposes. Make this repo private and invite everyone involved as collaborators in order to avoid DMCA.
It looks like 780G supports native BLE, designed to connect with smartphones.

Medtronic's design is that the data will go to their web portal, supported by their own mobile apps. Once the data is in Medtronic's web portal, the mmconnect plugin can copy it into Nightscout. I'm not aware of any specific problems creating compatibility issues with different pumps models in terms of data coming out of carelink. If there is an issue, I'd like to get it documented in minimed-connect-to-nightscout so we can fix it. To my knowledge there were some issues earlier this year, not due to 780g but due to changes in carelink itself, and the cloud interfaces changing. Since we support carelink in general, it would be surprising to learn that 780g is incompatible with carelink. Maybe I'm missing an important detail here?

I also recommend starting a decoding-mmble (decoding medtronic minimed's bluetooth low energy). This project would focus solely on understanding the new BLE messages and be useful in a future mm780-watch-uploader project. There's a lot of worthwhile and high value discussion happening and want to make sure it all gets organized and supported.

@sulkaharo
Copy link
Member

"Once the data is in Medtronic's web portal, the mmconnect plugin can copy it into Nightscout." AFAIK this is factually incorrect. The Medtronic portal and the older follow app do not get real time updates from the 780G app that syncs to the new API and the Carelink website asks users to use the new apps that use the new API to see data in real time. As is, there is no browser-based solution to see the data for 780G users.

@paul1956
Copy link

Actually there is if you take your phone/tablet and go https://carelink.minimed.com/app/login and log in with your personal caregiver account. Then you will be redirected and you can see the live data from 7X0G
IMG_E3871
This only works from a mobile browser, the display is completely different from a desktop. The above picture is from Safari on my iPhone.

@ivocarminati
Copy link

With ApkTool I manage to decompile, change only one text, recompile and try... Did you see the difference?
Screenshot_2021-01-24-13-19-22-630_com medtronic diabetes minimedmobile eu
Screenshot_2021-01-24-14-38-41-897_com medtronic diabetes minimedmobile eu

Not a huge change, now I'll try to change behavior and do not block my device

Keep us updated if you find a way to unblock our devices :)

@polarfish
Copy link

Actually there is if you take your phone/tablet and go https://carelink.minimed.com/app/login and log in with your personal caregiver account. Then you will be redirected and you can see the live data from 7X0G
IMG_E3871
This only works from a mobile browser, the display is completely different from a desktop. The above picture is from Safari on my iPhone.

Didn't work for me. I'm getting the same "Please download the mobile application to view device data and receive care partner notifications."
I have been using only 780G for several months (didn't use anything else before). I tried with iPhone (Safari) and Android Phone (Chrome).

@ondrej1024
Copy link

Didn't work for me. I'm getting the same "Please download the mobile application to view device data and receive care partner notifications."
I have been using only 780G for several months (didn't use anything else before). I tried with iPhone (Safari) and Android Phone (Chrome).

@polarfish : there is a discussion about this ongoing here

@gotpancreas
Copy link

Didn't work for me. I'm getting the same "Please download the mobile application to view device data and receive care partner notifications."
I have been using only 780G for several months (didn't use anything else before). I tried with iPhone (Safari) and Android Phone (Chrome).

@polarfish, we are actually just discussing this now over on #nightscout/minimed-connect-to-nightscout#11

It looks to me like it might be related to where you're located (EU vs US, specifically).

@mohammed-nep-group
Copy link
Author

mohammed-nep-group commented Jan 28, 2021

Hmm as I understand it's maybe wisely to move this conversation to the minimed-connect-to-nightscout project.

@polarfish
Copy link

It looks to me like it might be related to where you're located (EU vs US, specifically).

I'm in EU.

@mohammed-nep-group
Copy link
Author

It looks to me like it might be related to where you're located (EU vs US, specifically).

I'm in EU.

Same over here (NL), I think it's indeed some regulations based on your location EU/US

@AlejandroPaula
Copy link

Hi guys, someone has made some progress to be able to track the 780g on Nightscout

@TwistaTim
Copy link
Member

Hi everyone, I am going to close this issue as it doesn't directly pertain to CGM in the cloud.
Please Direct all conversation to the mmconnect issue here: nightscout/minimed-connect-to-nightscout#11

@Troxelke
Copy link

Troxelke commented Jul 6, 2021

With ApkTool I manage to decompile, change only one text, recompile and try... Did you see the difference?
Screenshot_2021-01-24-13-19-22-630_com medtronic diabetes minimedmobile eu
Screenshot_2021-01-24-14-38-41-897_com medtronic diabetes minimedmobile eu
Not a huge change, now I'll try to change behavior and do not block my device

Keep us updated if you find a way to unblock our devices :)

Hi, maybe interesting for you: I just see that the Minimed Mobile app has an update or something, as I can now load the app on my Xperia 5ii, where a few weeks back I still got the "device not supported" message. So check it out, maybe it now works for you?

For me however I can open the app, do the Carelink login, see my mobile on the pump, but pairing does not finish successful :(. Strange thing is that I get twice the popup on my phone to allow the pump to pair (I confirm), but no luck. Even with a full restart, new app install, removing from BT list. Any ideas?

@paul1956
Copy link

paul1956 commented Jul 7, 2021

@Troxelke That message is most likely coming from Server not local app. I have seen multiple cases on Android when that message appears and then a few days later its gone and the Android App version has not change. It is a matter of testing a device with the current app and then enabling it. If something is incompatible then you would need a new version of the app but from experience that is rare.

@Troxelke
Copy link

@Troxelke That message is most likely coming from Server not local app. I have seen multiple cases on Android when that message appears and then a few days later its gone and the Android App version has not change. It is a matter of testing a device with the current app and then enabling it. If something is incompatible then you would need a new version of the app but from experience that is rare.

Hi Paul, thanks! So you think it is still the Medtronic app? Well at the start it states that my device (Xperia 5ii) is accepted, but not yet tested on Android 11. So it may need another update from Medtronic side (FYI I tested on my wife's phone, Samsung S10e with Android 11, there all works).

I was thinking of hard-resetting my device, so you think that does not make sense to do? Thanks again!

@paul1956
Copy link

@Troxelke I don't think it is the app, I think the server is blocking your device/Android version combination because it is untested. And if and when they test it and it passes they will stop blocking it and it will just work with no changes on your side.

@Troxelke
Copy link

@Troxelke I don't think it is the app, I think the server is blocking your device/Android version combination because it is untested. And if and when they test it and it passes they will stop blocking it and it will just work with no changes on your side.

Thanks again Paul, so only thing to have patience here ;). I was only surprised as at the start of the app it now suddenly continues, where it now stops in the pairing process, so weird.

Hope they test/enable my device soon!

@eschweighofer
Copy link

eschweighofer commented Sep 16, 2021

Hi I own 780G in EU and managed to use a unsopported ROOTED device (xiaomi mi a2 - android One device with Android 10). Root with Magisk, MagiskHide (to hide root) + [XPosed]DevOptsHide (to hide developer options if you have enabled).
Then used the MagiskHidePropsConf module to change the phone to Google Pixel 4.

fingerprint=google/flame/flame:10/RQ3A.210905.001/7511028:user/release-keys
brand=google
manufacturer=Google
model=Pixel 4

@paul1956
Copy link

@eschweighofer Why dangerous? The phone in not used to control the pump in any mode. The phone just reports and uploads to CareLink.

@eschweighofer
Copy link

@eschweighofer Why dangerous? The phone in not used to control the pump in any mode. The phone just reports and uploads to CareLink.

yep @paul1956 , I already removed that part of my comment :)

@Troxelke
Copy link

@Troxelke I don't think it is the app, I think the server is blocking your device/Android version combination because it is untested. And if and when they test it and it passes they will stop blocking it and it will just work with no changes on your side.

Thanks again Paul, so only thing to have patience here ;). I was only surprised as at the start of the app it now suddenly continues, where it now stops in the pairing process, so weird.

Hope they test/enable my device soon!

Update guys! The Minimed Mobile app received an update which now allows my phone to install and connect! For my case a Sony Xperia 5ii, maybe other phones will also be enabled!

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