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

[GLOOKO] Problem with nightscout-connect using European Glooko account #14

Open
fjpezuela opened this issue Aug 5, 2023 · 42 comments
Open

Comments

@fjpezuela
Copy link

I am trying to connect to a European Glooko account from Spain, and I get an error when connecting. Here are the logs from Nightscout:

2023-08-05T18:23:30.513865455Z stdout F MiniMed Connect not enabled
2023-08-05T18:23:26.821569259Z stdout F Executing setupMMConnect
2023-08-05T18:23:26.821517826Z stdout F Dexcom bridge not enabled
2023-08-05T18:23:25.015052031Z stdout F Executing setupBridge
2023-08-05T18:23:24.819624981Z stdout F }
2023-08-05T18:23:24.819622748Z stdout F kind: 'glooko'
2023-08-05T18:23:24.819620799Z stdout F baseURL: 'https://eu.api.glooko.com';,
2023-08-05T18:23:24.819619004Z stdout F glookoTimezoneOffset: -7200000,
2023-08-05T18:23:24.819617002Z stdout F glookoPassword: '',
2023-08-05T18:23:24.819614804Z stdout F glookoEmail: '
*@gmail.com',
2023-08-05T18:23:24.819612086Z stdout F glookoServer: 'eu.api.glooko.com',
2023-08-05T18:23:24.819609229Z stdout F glookoEnv: 'eu',
2023-08-05T18:23:24.819593054Z stdout F INPUT PARAMS { kind: 'glooko' } {
2023-08-05T18:23:24.819203689Z stdout F GLOOKO using ms offset: -7200000 2

2023-08-05T18:23:43.195213184Z stdout F }
2023-08-05T18:23:43.195211094Z stdout F response: [Object]
2023-08-05T18:23:43.195208838Z stdout F request: [ClientRequest],
2023-08-05T18:23:43.195206737Z stdout F config: [Object],
2023-08-05T18:23:43.195204564Z stdout F code: 'ERR_BAD_REQUEST',
2023-08-05T18:23:43.195202226Z stdout F at processTicksAndRejections (node:internal/process/task_queues:83:21) {
2023-08-05T18:23:43.195199974Z stdout F at endReadableNT (node:internal/streams/readable:1358:12)
2023-08-05T18:23:43.195195974Z stdout F at Unzip.emit (node:events:525:35)
2023-08-05T18:23:43.19519297Z stdout F at Unzip.handleStreamEnd (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:2989:11)
2023-08-05T18:23:43.195188961Z stdout F at settle (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:1909:12)
2023-08-05T18:23:43.195184914Z stdout F data: AxiosError: Request failed with status code 422
2023-08-05T18:23:43.195180833Z stdout F type: 'AUTHENTICATION_ERROR',

@burnedikt
Copy link

Hi, I also had some issues getting the eu servers to work and in the end, the following config worked for me. It seems like there's yet another server for germany / france so I had to replace eu.api.glooko.com by de-fr.api.glooko.com. Unsure were Spain is hosted, though.

CONNECT_SOURCE=glooko
CONNECT_GLOOKO_ENV=eu
CONNECT_GLOOKO_SERVER=de-fr.api.glooko.com
CONNECT_GLOOKO_EMAIL=<glooko-useraccount-email>
CONNECT_GLOOKO_PASSWORD=<glooko-useraccount-password>
CONNECT_GLOOKO_TIMEZONE_OFFSET=1

@fjpezuela
Copy link
Author

de-fr.api.glooko.com

2023-08-08T06:34:49.820874039Z stdout F FRAME ERROR
2023-08-08T06:34:49.819681626Z stdout F }
2023-08-08T06:34:49.819679517Z stdout F }
2023-08-08T06:34:49.819677664Z stdout F }
2023-08-08T06:34:49.819675802Z stdout F response: [Object]
2023-08-08T06:34:49.819673853Z stdout F request: [ClientRequest],
2023-08-08T06:34:49.819671923Z stdout F config: [Object],
2023-08-08T06:34:49.81966995Z stdout F code: 'ERR_BAD_REQUEST',
2023-08-08T06:34:49.81966812Z stdout F at processTicksAndRejections (node:internal/process/task_queues:83:21) {
2023-08-08T06:34:49.819666213Z stdout F at endReadableNT (node:internal/streams/readable:1358:12)
2023-08-08T06:34:49.819663577Z stdout F at Unzip.emit (node:events:525:35)
2023-08-08T06:34:49.819661685Z stdout F at Unzip.handleStreamEnd (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:2989:11)
2023-08-08T06:34:49.819658451Z stdout F at settle (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:1909:12)
2023-08-08T06:34:49.819655352Z stdout F data: AxiosError: Request failed with status code 401
2023-08-08T06:34:49.81965311Z stdout F type: 'AUTHENTICATION_ERROR',
2023-08-08T06:34:49.819650716Z stdout F event: {
2023-08-08T06:34:49.819648807Z stdout F },

Thank you very much for your reply.

With the server you indicated, it shows a 401 error (invalid credentials). The credentials are correct. I think the server in Spain must be a different one.

Thank you very much.

@burnedikt
Copy link

You should be able to find out the correct url if you log into the glooko website and check the network tab of the browser's developer tool. There should be a bunch of requests going towards glooko's server.

@fjpezuela
Copy link
Author

image

I have checked the domain that opens when logging in to the Glooko site, and it uses the domain eu.my.glooko.com, but it still gives error 422.

@fjpezuela
Copy link
Author

image

I have also tried eu.api.glooko.com, but it also gives error 422.

@fjpezuela
Copy link
Author

fjpezuela commented Aug 8, 2023

I add an analysis of a Glooko web login, in case it helps. I have hidden some data.

<title>LogbookWeb</title> <script type="text/javascript" nonce="xxxx"> window.env = {"process.env.NODE_ENV":"production","apiUrl":"https://eu.api.glooko.com","auditApiUrl":"https://eu.audit.glooko.com","gladUrl":"https://eu.glad.glooko.com","popInsightsUrl":"https://eu.analytics.glooko.com","insuletUrl":"https://eu.middleware.glooko.com","glookoUploaderOsxUrl":"https://download.diasend.com/update/GlookoUploader.pkg","mellitusHealthUrl":"/api/v2/partners/mellitus_health","academyUrl":"https://academy.glooko.com/diasend/auth","regionalJoinUrl":"https://eu.join.glooko.com","popInsightsApiUrl":"https://eu-api.analytics.glooko.com","brazeWebSDKUrl":"sdk.fra-02.braze.eu","brazeWebSDKApiKey":"6ce27393-4f6a-41e5-a38c-4a38179ead20","graphsBetaUrl":"https://global.betagraphs.glooko.com"} </script> <script type="text/javascript" nonce="xxxx"> window.api_server_url = "https://eu.api.glooko.com"; window.sessionId = "xxxx"; window.logbook_web_session = "xxxx"; window.application_version = "23.3.0.1"; </script> <script src="/assets/application-0f4f8fb0974795e0ab7f8211326e867a2fcef6e3b1869a71ed11fef712ddc3b7.js" type="text/javascript" integrity="sha256-7u6yyGtDWp65r5FqfGAfdEEB4fE9f4UJsi2M1hLgMD8="></script> <script src="/assets/analytics/page_load-3eb51b8d2e1ba584f54206a1c6b511461c0c10d278d7f1d61f3278d91bc67313.js" type="text/javascript" integrity="sha256-PJVD7RgoMWXcganna1BJO/dQ0Br7bcgj6+2L3g/Vhrs="></script> <script type="text/javascript" nonce="xxxx"> document.createElement('header'); document.createElement('hgroup'); document.createElement('nav'); document.createElement('menu'); document.createElement('section'); document.createElement('article'); document.createElement('aside'); document.createElement('footer'); window.I18n_locale = "es"; window.I18n_default_locale = "en"; window.I18n_available_locales = ["de","en","fr-CA","el","es-US","tr","hr","en-GB","fr","es","it","fi","sk","pl","nl","sv","da","cs","nb-NO","pt-PT","ar"]; window.RailsToClientConstants = { email_path: "/email", edit_user_registration_path: "/users/edit", language_path: "/language", signed_in_by_token: "false", create_pdf_target: "_blank" }; </script> <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js" integrity="sha384-B1miHxuCmAMGc0405Cm/zSXCc38EP5hNOy2bblqF6yiX01Svinm1mWMwJDdNDBGr" crossOrigin="anonymous"></script> <style id="clearly_highlighting_css" type="text/css">/* selection */ html.clearly_highlighting_enabled ::-moz-selection { background: rgba(246, 238, 150, 0.99); } html.clearly_highlighting_enabled ::selection { background: rgba(246, 238, 150, 0.99); } /* cursor */ html.clearly_highlighting_enabled { /* cursor and hot-spot position -- requires a default cursor, after the URL one */ cursor: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--cursor.png") 14 16, text; } /* highlight tag */ em.clearly_highlight_element { font-style: inherit !important; font-weight: inherit !important; background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--yellow.png"); background-repeat: repeat-x; background-position: top left; background-size: 100% 100%; } /* the delete-buttons are positioned relative to this */ em.clearly_highlight_element.clearly_highlight_first { position: relative; } /* delete buttons */ em.clearly_highlight_element a.clearly_highlight_delete_element { display: none; cursor: pointer; padding: 0; margin: 0; line-height: 0; position: absolute; width: 34px; height: 34px; left: -17px; top: -17px; background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/highlight--delete-sprite.png"); background-repeat: no-repeat; background-position: 0px 0px; } em.clearly_highlight_element a.clearly_highlight_delete_element:hover { background-position: -34px 0px; } /* retina */ @media (min--moz-device-pixel-ratio: 2), (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) { em.clearly_highlight_element { background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/[email protected]"); } em.clearly_highlight_element a.clearly_highlight_delete_element { background-image: url("chrome-extension://pioclpoplcdbaefihamjohnefbikjilc/clearly/images/[email protected]"); background-size: 68px 34px; } } </style> <style>[touch-action="none"]{ -ms-touch-action: none; touch-action: none; }[touch-action="pan-x"]{ -ms-touch-action: pan-x; touch-action: pan-x; }[touch-action="pan-y"]{ -ms-touch-action: pan-y; touch-action: pan-y; }[touch-action="scroll"],[touch-action="pan-x pan-y"],[touch-action="pan-y pan-x"]{ -ms-touch-action: pan-x pan-y; touch-action: pan-x pan-y; }</style>
<script type="text/javascript" nonce="xxxx"> window.analyticsUser = {"glooko_code":"eu-west-1-violet-cambridge-5967","user_id":"xxxx","patient_glooko_code":null,"patient_id":null,"primary_authorized_site_id":null,"provider_group":null,"provider_group_sites":[]}; window.user_type = "Patient"; window.patient = "eu-west-1-violet-cambridge-5967"; window.current_user_glooko_code = "eu-west-1-violet-cambridge-5967"; window.Users = { patient: { first_name: "xxx", last_name: "xxxx", guid: "xxxx", date_of_birth: "XXXX-09-16T00:00:00Z", timestamps: {"pump":"2023-08-08T15:49:34.222Z","cgm_device":"2023-08-08T15:49:35.000Z"} }, current_user: { guid: "xxxx", user_type: "Patient" } }; </script> <script nonce="xxxx"> var pendoData = { visitor: { id: "xxxx", // Required if user is logged in glooko_code: "eu-west-1-violet-cambridge-5967", provider_group_site_id: "", provider_group_site_name: "", pgs_diasend_migration: false, pgs_diasend_migration_clinic_admin_name: "", pgs_diasend_migration_clinic_transmitters: [], pgs_diasend_migration_clinic_uploader: false, pgs_academy: false, provider_group_name: "", primary_authorized_site_id: "", primary_authorized_site_name: "", primary_authorized_site_group_name: "", provider_group_sites: [], subscription_model: "", features: [], auth_code: "", application_name: 'LogbookWeb', application_version: "23.3.0.1", device_id: "server", domain: "https://eu.my.glooko.com", glooko_language: "es", user_type: "Patient", diabetes_type: "type_1", user_diasend_migration: true, user_diasend_connected_apps: [], used_diasend_uploader: false, synced_in_the_last_month: "true", user_cloud_connections: [], available_cloud_connections: ["DEXCOM_ACCOUNT","INSULET_OMNIPOD_5_CLOUD","OMNIPOD_DASH_CLOUD"] }, account: { id: "", provider_group_site: "", subscription_model: "" } }; for (var key in pendoData.visitor) { if (Object.prototype.hasOwnProperty.call(pendoData.visitor), key) { if (pendoData.visitor[key] === '') pendoData.visitor[key] = 'not_defined'; } } for (var key in pendoData.account) { if (Object.prototype.hasOwnProperty.call(pendoData.account), key) { if (pendoData.account[key] === '') pendoData.account[key] = 'not_defined'; } } // because this api is unversioned we are not implementing SRI on it in the first round // See the ticket for context (function(apiKey){ (function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[]; v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w
<script src="/webpack/production/vendor.7e4d63ef4f701529c19a.js"></script> <script src="/webpack/production/navigation.7e4d63ef4f701529c19a.js"></script> <script src="/webpack/production/devices.7e4d63ef4f701529c19a.js"></script>

Para proteger su privacidad, se ha cerrado automáticamente su sesión por inactividad.
Cerrar

<script nonce="xxxx"> // despite being a versioned api segment has changed their hosted code at least once after setting up SRI so we can't easily secure this !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t `

@webwude
Copy link

webwude commented Aug 17, 2023

I have the same issue.
If I add "CONNECT_GLOOKO_ENV=eu" or eu.api.google.com as server (as this is shown in the browser details as well, I get an 422 authentification error.
If I remove all eu flags, I get an authentification error as well, with code 401.

Snipplet from container manager / docker on my Synology (sorry for the strange encoding):

<html><body>
<!--StartFragment-->

2023/08/17 11:11:18 | stdout | event: { type: �[32m'SESSION_ERROR'�[39m }
-- | -- | --
2023/08/17 11:11:18 | stdout | },
2023/08/17 11:11:18 | stdout | elapsedWaiting: �[33m8�[39m
2023/08/17 11:11:18 | stdout | endedWaiting: �[33m1692263478221�[39m,
2023/08/17 11:11:18 | stdout | startedWaiting: �[33m1692263478213�[39m,
2023/08/17 11:11:18 | stdout | started: �[33m1692263478213�[39m,
2023/08/17 11:11:18 | stdout | diagnostics: {},
2023/08/17 11:11:18 | stdout | last_known: �[1mnull�[22m,
2023/08/17 11:11:18 | stdout | session: �[1mnull�[22m,
2023/08/17 11:11:18 | stdout | duration: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | retries: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | context: {
2023/08/17 11:11:18 | stdout | {
2023/08/17 11:11:18 | stdout | FRAME ERROR
2023/08/17 11:11:18 | stdout | }
2023/08/17 11:11:18 | stdout | }
2023/08/17 11:11:18 | stdout | }
2023/08/17 11:11:18 | stdout | response: �[36m[Object]�[39m
2023/08/17 11:11:18 | stdout | request: �[36m[ClientRequest]�[39m,
2023/08/17 11:11:18 | stdout | config: �[36m[Object]�[39m,
2023/08/17 11:11:18 | stdout | code: �[32m'ERR_BAD_REQUEST'�[39m,
2023/08/17 11:11:18 | stdout | �[90m    at processTicksAndRejections (node:internal/process/task_queues:83:21)�[39m {
2023/08/17 11:11:18 | stdout | �[90m    at endReadableNT (node:internal/streams/readable:1345:12)�[39m
2023/08/17 11:11:18 | stdout | �[90m    at Unzip.emit (node:events:539:35)�[39m
2023/08/17 11:11:18 | stdout | at Unzip.handleStreamEnd (/opt/app/node_modules/�[4mnightscout-connect�[24m/node_modules/�[4maxios�[24m/dist/node/axios.cjs:2989:11)
2023/08/17 11:11:18 | stdout | at settle (/opt/app/node_modules/�[4mnightscout-connect�[24m/node_modules/�[4maxios�[24m/dist/node/axios.cjs:1909:12)
2023/08/17 11:11:18 | stdout | data: AxiosError: Request failed with status code 422
2023/08/17 11:11:18 | stdout | type: �[32m'AUTHENTICATION_ERROR'�[39m,
2023/08/17 11:11:18 | stdout | event: {
2023/08/17 11:11:18 | stdout | },
2023/08/17 11:11:18 | stdout | failures: �[33m0�[39m
2023/08/17 11:11:18 | stdout | authorization_errors: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | authorizations: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | authentication_errors: �[33m1�[39m,
2023/08/17 11:11:18 | stdout | authentications: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | sessions: �[33m0�[39m,
2023/08/17 11:11:18 | stdout | retries: �[33m0�[39m,

<!--EndFragment-->
</body>
</html>
'''

@atomphil
Copy link

atomphil commented Aug 21, 2023

I have the same problem, my variables are as follows:

CONNECT_SOURCE = glooko
CONNECT_GLOOKO_EMAIL = *********@gmx.de
CONNECT_GLOOKO_PASSWORD = *******!
CONNECT_GLOOKO_SERVER = de-fr.my.glooko.com
CONNECT_GLOOKO_ENV = eu
CONNECT_GLOOKO_TIMEZONE_OFFSET = 2

This results in a status code 422
'AUTHENTICATION_ERROR'

Same for CONNECT_GLOOKO_SERVER = de-fr.api.glooko.com
With CONNECT_GLOOKO_SERVER = eu.api.glooko.com I get error code 401

2023-08-21T14:21:22.134976391Z stdout F   context: {
2023-08-21T14:21:22.134943961Z stdout F {
2023-08-21T14:21:22.04220788Z stdout F FRAME ERROR
2023-08-21T14:21:22.040628159Z stdout F }
2023-08-21T14:21:22.04062454Z stdout F   }
2023-08-21T14:21:22.040620788Z stdout F     }
2023-08-21T14:21:22.040616998Z stdout F       response: [Object]
2023-08-21T14:21:22.040613173Z stdout F       request: [ClientRequest],
2023-08-21T14:21:22.040609565Z stdout F       config: [Object],
2023-08-21T14:21:22.040605899Z stdout F       code: 'ERR_BAD_REQUEST',
2023-08-21T14:21:22.040602397Z stdout F         at processTicksAndRejections (node:internal/process/task_queues:83:21) {
2023-08-21T14:21:22.040599014Z stdout F         at endReadableNT (node:internal/streams/readable:1358:12)
2023-08-21T14:21:22.040595241Z stdout F         at Unzip.emit (node:events:525:35)
2023-08-21T14:21:22.040591334Z stdout F         at Unzip.handleStreamEnd (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:2989:11)
2023-08-21T14:21:22.040586932Z stdout F         at settle (/workspace/node_modules/nightscout-connect/node_modules/axios/dist/node/axios.cjs:1909:12)
2023-08-21T14:21:22.040582709Z stdout F     data: AxiosError: Request failed with status code 422
2023-08-21T14:21:22.040578421Z stdout F     type: 'AUTHENTICATION_ERROR',
2023-08-21T14:21:22.040574534Z stdout F   event: {
2023-08-21T14:21:22.040571402Z stdout F   },
2023-08-21T14:21:22.040567827Z stdout F     failures: 0
2023-08-21T14:21:22.040564629Z stdout F     authorization_errors: 0,
2023-08-21T14:21:22.040561648Z stdout F     authorizations: 0,
2023-08-21T14:21:22.040558238Z stdout F     authentication_errors: 1,
2023-08-21T14:21:22.040554779Z stdout F     authentications: 0,
2023-08-21T14:21:22.04055104Z stdout F     sessions: 0,
2023-08-21T14:21:22.040547558Z stdout F     retries: 0,
```
`

@bewest
Copy link
Member

bewest commented Aug 25, 2023

Would someone be willing to send me an email at bewest at gmail.com or medicaldatnetworks.com? Please mention nightscout-connect and glooko in the subject line. It would be great to try accessing a temporary password in my development environment to test.

@peisenh
Copy link

peisenh commented Aug 25, 2023

Also struggling with

CONNECT_GLOOKO_SERVER = de-fr.api.glooko.com

and getting 422 status code if the right email and password is used, 401 with incorrect login.

I am little bit confused about the API.
Is it even possible for a "normal" Glooko user to use the API directly or is this only possible for commercial customers who registered as developers?
See: https://developers.glooko.com/docs/directintegrations/registration

Question to the people which are able to use this: Are you a "normal" glooko user or registered developer? (regardless of region)

@webwude
Copy link

webwude commented Aug 26, 2023

Would someone be willing to send me an email at bewest at gmail.com or medicaldatnetworks.com? Please mention nightscout-connect and glooko in the subject line. It would be great to try accessing a temporary password in my development environment to test.

I could help. But as mentioned, I have a more complicated setup: my nightscout installation is on a docker on my synology NAS - I do not have direct access to the installation, only via installing an updated docker image and setting the config values.

@peisenh
Copy link

peisenh commented Sep 14, 2023

I am stuck here. Was somebody able to use this on the de-fr servers from glooko?

@webwude
Copy link

webwude commented Sep 14, 2023

I am stuck here. Was somebody able to use this on the de-fr servers from glooko?

I am not aware of anybody from EU. On the other hand: if somebody is able, would he / she check issues on Github?

@bjornoleh
Copy link
Contributor

Hi, I also had some issues getting the eu servers to work and in the end, the following config worked for me. It seems like there's yet another server for germany / france so I had to replace eu.api.glooko.com by de-fr.api.glooko.com. Unsure were Spain is hosted, though.

CONNECT_SOURCE=glooko
CONNECT_GLOOKO_ENV=eu
CONNECT_GLOOKO_SERVER=de-fr.api.glooko.com
CONNECT_GLOOKO_EMAIL=<glooko-useraccount-email>
CONNECT_GLOOKO_PASSWORD=<glooko-useraccount-password>
CONNECT_GLOOKO_TIMEZONE_OFFSET=1

Hi @burnedikt , do you happen to know details about server / env settings for Scandinavian users (Norway / Sweden)?

Thanks!

@webwude
Copy link

webwude commented Oct 16, 2023

@bjornoleh tried your settings, still the same error :(

@bjornoleh
Copy link
Contributor

@bjornoleh tried your settings, still the same error :(

Those were not my settings, I was replying to the post by burnedikt :-)

@bewest
Copy link
Member

bewest commented Oct 16, 2023

If you are logged into the Glooko web interface, you can use the browser inspector and network tools to see which servers are being used. We can add that information to the repository here.

@bjornoleh
Copy link
Contributor

bjornoleh commented Oct 16, 2023

If you are logged into the Glooko web interface, you can use the browser inspector and network tools to see which servers are being used. We can add that information to the repository here.

Thanks! I did have a go at that, but didn’t quite know my way around the source inspector in Chrome. I am trying again now.

I am seeing:

https://eu.my.glooko.com
https://eu.api.glooko.com

@bewest , Anything else I should look for?

@rosserl
Copy link

rosserl commented Nov 3, 2023

Hey there, I did some reverse engineering and found this deviceInformation fields, and signing in works for me with these values (via eu.api.glokoo.com):

	"deviceInformation": {
		"applicationType": "logbook",
		"os": "android",
		"osVersion": "33",
		"device": "Google Pixel 4a",
		"deviceManufacturer": "Google",
		"deviceModel": "Pixel 4a",
		"serialNumber": "ab43bfjdj3423421fb",
		"clinicalResearch": false,
		"deviceId": "716c34bac673f4b9",
		"applicationVersion": "6.1.3",
		"buildNumber": "0",
		"gitHash": "g4fbed2011b"
	}

The only field actually needed is applicationType, which can be "kiosk" or "logbook" - both work.
Although I would set the other fields too, so they could not detect it not being the app. (deviceId and serial are random in my example above, version/build/git hash are form the latest play store version).

@bewest ^^

@peisenh
Copy link

peisenh commented Nov 3, 2023

And we have a winner here! Thanks! :-)

I am using the values you send, did some random deviceId and serialNumber instead the above in your example. Then with:

export CONNECT_SOURCE=glooko
export CONNECT_GLOOKO_SERVER=de-fr.api.glooko.com

(for germany)

I am now able to get values from glooko and feed them to nightscout.

At least current glucose level and basal seem to work at first glance.

Thanks again.

@webwude
Copy link

webwude commented Nov 3, 2023

Where do I put the values? Where can I insert them? I am using a docker image for nightscout on Synology.

@bjornoleh
Copy link
Contributor

Where do I put the values? Where can I insert them? I am using a docker image for nightscout on Synology.

Along with other configuration variables, probably in docker-compose.yml or similar

@peisenh
Copy link

peisenh commented Nov 3, 2023

At the moment: This is hard coded in lib/sources/glooko/index.js, so you need to edit the source.
Look for
...
"deviceInformation": {
"deviceModel": "iPhone"
}
...
This needs to be replaced by the segment above. Of cause you need to be able to run modified code on your nightscout instance, so consider this only as a proof of concept or temporary solution.

In the long term: To be able to use configuration variables the source must be patched accordingly to allow this.

I am quite busy now - maybe can provide a PR in the next 2 week for this. If somebody has some more time to work earlier on this: Please feel free. This will help all of us.

@funkstille
Copy link

funkstille commented Nov 6, 2023

Just tried it with nightscout version "15.0.2 head", as it is, no modfications. Works fine with glooko Account from Germany.

Used the following variables:

ENABLE=careportal basal food iob bwp cage sage iage bage pushover pump cors cob bridge Boluscalc connect
CONNECT_SOURCE=glooko
CONNECT_GLOOKO_SERVER=de-fr.api.glooko.com
CONNECT_GLOOKO_EMAIL=email
CONNECT_GLOOKO_PASSWORD=password
CONNECT_GLOOKO_TIMEZONE_OFFSET=1

It only retrieves the bolus (carbs and insulin) and basal, no cgm data. But that is fine for since I get those from xdrip companion.

@webwude
Copy link

webwude commented Nov 6, 2023

Just tried it with nightscout version "15.0.2 head", as it is, no modfications. Works fine with glooko Account from Germany.

Just tried - used the posted settings - still 401 error (authentification) :(

@peisenh
Copy link

peisenh commented Nov 6, 2023

It only retrieves the bolus (carbs and insulin) and basal, no cgm data. But that is fine for since I get those from xdrip companion.

Same here. Did forget I had xdrip running - so the cgm was indeed coming from xdrip instead from glooko. Did not find I way to retrieve the cgm data via api so far.

So at the moment:

  • Insulin / Carbs / Basal from glooko with some time delay
  • Did not find a way to get any CGM from glooko (?)
  • CGM via xdrip - this then more or less realtime

@zehnBE
Copy link

zehnBE commented Nov 6, 2023

Looks, that the folloging changes helps:


diff --git a/gluko/lib/sources/glooko/index.js b/gluko/lib/sources/glooko/index.js
index 010e0c87..7deba045 100644
--- a/gluko/lib/sources/glooko/index.js
+++ b/gluko/lib/sources/glooko/index.js
@@ -51,7 +51,18 @@ function login_payload (opts) {
       "password": opts.glookoPassword
     },
     "deviceInformation": {
-      "deviceModel": "iPhone"
+        "applicationType": "logbook",
+        "os": "android",
+        "osVersion": "33",
+        "device": "Google Pixel 4a",
+        "deviceManufacturer": "Google",
+        "deviceModel": "Pixel 4a",
+        "serialNumber": "ab43bfjdj3423421fb",
+        "clinicalResearch": false,
+        "deviceId": "716c34bac673f4b9",
+        "applicationVersion": "6.1.3",
+        "buildNumber": "0",
+        "gitHash": "g4fbed2011b"
     }
   };
   return body;

@Heiner1
Copy link

Heiner1 commented Nov 6, 2023

Next good news: It's running with zehnBE changes.
I hope it's a solution for all.

@rosserl
Copy link

rosserl commented Nov 15, 2023

I'd like to point out one more time, that each user should configure a different deviceId and serialNumber (and maybe also the device), so glooko can't filter out these requests as easy.

@AlexM4H
Copy link

AlexM4H commented Nov 15, 2023

@Heiner1 Is the Patch still working for you?

I think I might be doing something wrong. No requests are being sent to de-fr.api.glooko.com at all.

I have connect enabled and use nightscout-latest-dev and the patched nightscout-connect version. What else could I have forgotten?

'nightscout-connect capture' at least provides the personal data such as name and date of birth

@Heiner1
Copy link

Heiner1 commented Nov 15, 2023

@rosserl

I'd like to point out one more time, that each user should configure a different deviceId and serialNumber (and maybe also the device), so glooko can't filter out these requests as easy.

Good idea! But before the content was only "deviceModel": "iPhone";
I think it's also possible that Glooko would be alarmed about this.

@AlexM4H Yes it's still working; unfortunately I have nightscout running at 10be, so I've limited overview about zehnBEs server configuration. If you're living in Germany you should also ask funkstille, because he was not forced to change "deviceInformation“. Maybe it has something to do where servers are located, he uses railway.

@AlexM4H
Copy link

AlexM4H commented Nov 15, 2023

@rosserl

I'd like to point out one more time, that each user should configure a different deviceId and serialNumber (and maybe also the device), so glooko can't filter out these requests as easy.

Good idea! But before the content was only "deviceModel": "iPhone"; I think it's also possible that Glooko would be alarmed about this.

@AlexM4H Yes it's still working; unfortunately I have nightscout running at 10be, so I've limited overview about zehnBEs server configuration. If you're living in Germany you should also ask funkstille, because he was not forced to change "deviceInformation“. Maybe it has something to do where servers are located, he uses railway.

Thx a lot. I will asked him. I used a docker image on a hetzner cloud server.

@rosserl
Copy link

rosserl commented Nov 15, 2023

@rosserl

I'd like to point out one more time, that each user should configure a different deviceId and serialNumber (and maybe also the device), so glooko can't filter out these requests as easy.

Good idea! But before the content was only "deviceModel": "iPhone"; I think it's also possible that Glooko would be alarmed about this.

Yes, but then you could remove all of that data, except for applicationType , which s the only required field. (So there would be no improvement in regards to detection by glooko, but also no unnecessary stuff.)

@AlexM4H
Copy link

AlexM4H commented Nov 15, 2023

It seems to be a bit more complicated. In my case, the data is transferred from CamAPS to Glooko. The bolus rates are also included in the Glooko reports. However, they may not be transferred via the API. I will take a closer look tomorrow.

@atomphil
Copy link

My Nightscout is running on Northflank. I just forked the repository and used Buildpack to build a container. As a result, nightscout-connect is only included as a Nightscout plugin.
How can I apply the patch in this configuration? Or is there a way to run nightscout-connect in a Docker container? Is there perhaps already a suitable docker-compose.yml?

@lucienimmink
Copy link

lucienimmink commented Nov 19, 2023

Same issue here. Created a PR for the patch above (#31) I've replaced the 2 IDs by a function that generates the IDs at random.

Extra info:
My nightscout runs in a container inside my synology NAS. Glooko account it used for uploading data from a T:slim x2 pump (which has no active mobile app in the EU yet!) which makes me think: should we capture/use a desktop grade device instead of a mobile one?

@bewest
Copy link
Member

bewest commented Nov 19, 2023

Thanks, looking good! Has anyone experimented with other values? For example, it might be nice to attribute nightscout-connect and a stable device id for the entire runtime. It might be nice to optionally read these values from the incoming configuration. This would enable changing the values using environment variables, which can give some relief from needing to change the code in the case where Glooko implements a trivial change.

@peisenh
Copy link

peisenh commented Nov 19, 2023

I am able to get data with the patch and feed it to nightscout - however I am only getting bolus/basal/carb values but no values from CGM. It this working for somebody?

@funkstille
Copy link

No CGM is not working / supported so far. If you are using camAPS you can use xDrip in companion mode for CGM.

@AlexM4H
Copy link

AlexM4H commented Nov 20, 2023

What is the graph API (v3) command all about? I found it commented out in the source code.

@lucienimmink
Copy link

...so this is it? What's needed to get this going?

@sircsaba
Copy link

I'm using NS 14.2.6 image on Docker with Portainer on a Raspberry Pi 4 . Where do I put the information to get glooko working please ?

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