Code Monkey home page Code Monkey logo

minimed-connect-to-nightscout's People

Contributors

bewest avatar fredmk avatar mddub avatar mrinnetmaki avatar pietergit avatar saukk900 avatar stijnbrouwers avatar sulkaharo avatar szymjaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minimed-connect-to-nightscout's Issues

http 400 while login

I receive an 400 while trying to setup NS using docker image
MiniMed 670G (in canada 770g in EU I believe)

2022-01-09T03:51:35.581Z [Arguments] { '0': 'Logging in to CareLink' }
2022-01-09T03:51:35.582Z [Arguments] { '0': 'EU login 1' }
2022-01-09T03:51:35.584Z [Arguments] {
  '0': 'EU login 1',
  '1': 'https://carelink.minimed.com/patient/sso/login?country=gb&lang=en'
}
2022-01-09T03:51:35.774Z [Arguments] {
  '0': 'EU login 2 (url: https://carelink.minimed.eu/patient/sso/login?country=gb&lang=en)'
}
2022-01-09T03:51:36.016Z [Arguments] {
  '0': 'EU login 3 (url: https://mdtlogin.medtronic.com/mmcl/auth/oauth/v2/authorize?locale=null&countrycode=null)'
}
MiniMed Connect error: Error: Request failed with status code 400
stack: Error: Request failed with status code 400
    at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12)
    at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25
    at new Promise (<anonymous>)
    at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9)
    at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:162:20)
    at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:250:28)
    at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:279:21)

env value

  • name: API_SECRET
    value: somevalue
  • name: BRIDGE_SERVER
    value: EU
  • name: AUTH_DEFAULT_ROLES
    value: readable
  • name: INSECURE_USE_HTTP
    value: 'true'
  • name: SECURE_HSTS_HEADER
    value: 'false'
  • name: BG_HIGH
    value: '220'
  • name: BG_LOW
    value: '60'
  • name: BG_TARGET_BOTTOM
    value: '80'
  • name: BG_TARGET_TOP
    value: '180'
  • name: ENABLE
    value: careport basal mmconnect
  • name: MMCONNECT_USER_NAME
    value: someuser
  • name: MMCONNECT_PASSWORD
    value: somepassword
  • name: DEVICESTATUS_ADVANCED
    value: 'true'
  • name: PUMP_FIELDS
    value: reservoir battery clock
  • name: PUMP_WARN_BATT_P
    value: '51'
  • name: PUMP_URGENT_BATT_P
    value: '26'
  • name: MONGO_CONNECTION
    value: 'mongodb://mongo:27017/nightscout'
  • name: MMCONNECT_VERBOSE
    value: 'true'
  • name: TZ
    value: Europe/Berlin

Memory leak

Nightscout users who are using mmconnect in NS are now reporting the site crashes every couple days due to running out of memory. The issues seems to be isolated to this module; help checking where the leak is would be great.

mmconnect and 770g in US

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!

EU login 5 fails because of MFA challenge

All accounts in my country Norway (personal and caretaker) require MFA (two-factor auth via email code). When I try to run minimed-connect-to-nightscout the EU login 5 stage fails because a MFA oauth challenge response is received instead of the expected result, so response.headers.location is undefined and the EU login 5 stage fails because of this.

Is there any workaround to this? Is MFA-support being worked on? Can I hack around it by pretending I live in a different country where MFA is not required? I really want to make this work as I always use my PC and seldom use my smartphone.

Thanks in advance.

CareLink Recaptcha EU

Minimed seems to have implemented recaptcha with the standard https://carelink.minimed.eu/patient/sso/login authorization, at least in Europe, thus it does not work for me anymore...

connection issue (medtronic EU)

I'm seeing the following in my heroku logs:

2020-12-07T01:22:00.305636+00:00 app[web.1]: tick 2020-12-07T01:22:00.305Z
2020-12-07T01:22:05.428919+00:00 app[web.1]: Load Complete:
2020-12-07T01:22:05.428928+00:00 app[web.1]: 	 sgvs:473, profiles:1, devicestatus:265
2020-12-07T01:22:05.428941+00:00 app[web.1]: data loaded: reloading sandbox data and updating plugins
2020-12-07T01:22:07.850928+00:00 app[web.1]: MiniMed Connect error: Error: connect ETIMEDOUT 144.15.107.20:443
2020-12-07T01:22:07.850959+00:00 app[web.1]: stack: Error: connect ETIMEDOUT 144.15.107.20:443
2020-12-07T01:22:07.850960+00:00 app[web.1]:     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)

Any ideas if something has changed recently?
I wasn't seeing updates this morning - so I redeployed on heroku, then realised i was a bit behind master, so I rebased and redeployed again - and now see the above error. (and I'm not seeing any updates on my heroku site)

Values fetched from CareLink are in the wrong timezone (UTC)

After switching from dexcom to medtronic (780G + Guardian 4), the values displayed are shifted by one hour:
image

If I look at the data in mongodb, I suspect that mmconnect wrongly stores the timestamp:
image
image

More Information about my setup:
I'm running a NAS with unRaid 6.9.2 (timezone: UTC+1 Europe/Brussels)
Included in unraid is Docker version 20.10.5
running docker mongodb version
running docker nightscout version 14.2.5

MiniMed Connect error: Error: connect ETIMEDOUT

Hi,

Since yesterday I am having problems with my minimed-nightscout connection.

It has started to report the following error, without having carried out any kind of modification action on the code displayed on heroku.

2020-12-07T14:51:55.095873+00:00 app[web.1]: MiniMed Connect error: Error: connect ETIMEDOUT 144.15.107.20:443
2020-12-07T14:51:55.095886+00:00 app[web.1]: stack: Error: connect ETIMEDOUT 144.15.107.20:443
2020-12-07T14:51:55.095886+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
2020-12-07T14:52:47.520866+00:00 app[web.1]: tick 2020-12-07T14:52:47.520Z
2020-12-07T14:52:52.629027+00:00 app[web.1]: Load Complete:
2020-12-07T14:52:52.629043+00:00 app[web.1]: sgvs:390, profiles:1, devicestatus:59
2020-12-07T14:52:52.629049+00:00 app[web.1]: reloading sandbox data
2020-12-07T14:52:52.631122+00:00 app[web.1]: �[32mWS: �[0mrunning websocket.update

Thank you all very much, I appreciate any help or indication that you can give me.
Regards!

403 when refreshing token for EU server

I'm not 100% sure why this happens, but I fixed it by changing the headers:

        return await axios.post(
            CARELINKEU_REFRESH_TOKEN_URL,
            {},
            {
                headers: {
                    Authorization: "Bearer " + _.get(getCookie(CARELINKEU_TOKEN_COOKIE), 'value', ''),
                    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0",
                    Cookie: ''
                },
            },
        )

So it's either the cookies or the token refresh service is banning the axios user agent.

npm stoped after 15min

I use minimed-connect-to-nightscout in PowerShell for logging in Carelink and upload bg value in Heroku Noghtscout.
This is the solution to avoid Medtronic actions for blocking shared IP's.
My problem is: npm is stopping after 15 min (same duration like manual web logging in Carelink)
There is a solution for restarting logging in Carelink after 15min?

Add upload of treatments

The raw data retrieved from care link has markers fields with different type of markers (AUTO_BASAL_DELIVERY, MEAL, INSULIN). It would be nice to convert this data into the treatments (like xDrip+ CareLink Follower does).

do the following error, how do I fix it? I am in docker

at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),

tick 2022-01-25T02:40:40.528Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),
tick 2022-01-25T02:41:40.537Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),
tick 2022-01-25T02:42:40.547Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),
tick 2022-01-25T02:43:40.556Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),
tick 2022-01-25T02:44:40.566Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),
tick 2022-01-25T02:45:40.575Z,
Load Complete:,�
profiles:1,
data loaded: reloading sandbox data and updating plugins,
MiniMed Connect error: Error: Request failed with status code 400,
stack: Error: Request failed with status code 400,
at createError (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15),
at settle (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25,
at new Promise (),
at responseInterceptor (/opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9),
at /opt/app/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67,
at processTicksAndRejections (internal/process/task_queues.js:93:5),
at async doLoginEu3 (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:170:20),
at async checkLogin (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:280:28),
at async Object.fetch (/opt/app/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),

retryDurationOnAttempt(n) function is missing in carelink.js

The retryDurationOnAttempt(n) function in carelink.js is missing, which causes program errors and later data gaps, because the module remains in a wrong state after the first error:

First error due to missing funcion:

app/web.1 tick 2020-08-28T06:40:53.654Z
app/web.1 MiniMed Connect error: ReferenceError: retryDurationOnAttempt is not defined
app/web.1 stack: ReferenceError: retryDurationOnAttempt is not defined
app/web.1     at Object.fetch (/app/node_modules/minimed-connect-to-nightscout/carelink.js:231:35)
app/web.1     at process._tickCallback (internal/process/next_tick.js:68:7)

Subsequent continuous errors due to the first error:

app/web.1 tick 2020-08-28T06:41:53.654Z
app/web.1 MiniMed Connect error: Error: Request failed with status code 500
app/web.1 stack: Error: Request failed with status code 500
app/web.1     at createError (/app/node_modules/axios/lib/core/createError.js:16:15)
app/web.1     at settle (/app/node_modules/axios/lib/core/settle.js:17:12)
app/web.1     at /app/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25
app/web.1     at new Promise (<anonymous>)
app/web.1     at responseInterceptor (/app/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9)
app/web.1     at instance.interceptors.response.use.res (/app/node_modules/axios-cookiejar-support/lib/index.js:130:67)
app/web.1     at process._tickCallback (internal/process/next_tick.js:68:7)

The missing retryDurationOnAttempt(n) function exists in the original modified version of the carelink.js in FredMK's repo: FredMK/minimed-connect-to-nightscout

mmconnect data has wrong timezone?

Hi all,
I just got a new Medtronic Guardian G4 sensor and am now finally also able to easily use Nightscout. I just installed the docker image (version 14.2.5) on a private computer.
Now, that I received the first glucose values via mmconnect, I observe that their time tag is 1hr in the future. Seems like a timezone issue (since I'm in Europe/Berlin or UTC+1). This looks a little weird since the blue-dotted predictions start after the last glucose value (see screenshot)
In my docker-compose I have set TZ: Europe/Berlin and I also chose this TZ in my Nightscout default profile.

Did anybody observe this before or knows how to handle it?

image
Time of screenshot: 16:07 local time. mmconnect data gets time-tagged 1 hr in future.

Carelink follower (mmconnect to nightschout)

Does anyone have a manual or know a step by step on how to link mmconnect directly to nightscout without going through xdrip+?

I use nightscout through fly.io , which I migrated from herokuapp.

Thanks.

Status code 400 on raspberry

Hi together ,
Iam trying to setup mmconnect on a raspberry.
Have set all necessary variables.
but at npm start iam getting these errors.
If it’s not good readable, sorry as it’s from my mobile !

MMConnect] Wait 0 seconds before startError: Request failed with status code 400stack: Error: Request failed with status code 400 at createError (/home/pi/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/createError.js:16:15) at settle (/home/pi/node_modules/minimed-connect-to-nightscout/node_modules/axios/lib/core/settle.js:17:12) at /home/pi/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:79:25 at new Promise () at responseInterceptor (/home/pi/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/interceptors/response.js:78:9) at /home/pi/node_modules/minimed-connect-to-nightscout/node_modules/axios-cookiejar-support/lib/index.js:130:67 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async doLoginEu3 (/home/pi/node_modules/minimed-connect-to-nightscout/carelink.js:170:20) at async checkLogin (/home/pi/node_modules/minimed-connect-to-nightscout/carelink.js:280:28) at async Object.fetch (/home/pi/node_modules/minimed-connect-to-nightscout/carelink.js:309:21),^C

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.