timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
200 stars 252 forks source link

Upload Nightscout fail #15

Closed JayJay265 closed 2 years ago

JayJay265 commented 2 years ago

I I installed the app on Heroku, but the log always shows the error "Upload to Nightscout Failed" The Nightscout URL and Api are correct.

timoschlueter commented 2 years ago

Is your Nightspot instance available from Heroku? do you host your NS on Heroku too?

stoneag11 commented 2 years ago

Same here! Upload to NIGHTSCOUT failed. Logging in to Libre Linkup and receiving blood glucose measurements works fine, but upload to NS is not possible (according to Heroku logs). Is this only possible with a dockerized NS instance? Or do I have to set up a new NS site?

blaqone commented 2 years ago

Same error here, too!

timoschlueter commented 2 years ago

just to verify: You have created a new subject/access token in the nightscout admin page and used the generated aAccess token with the uploader? The access token needs to have permissions to push data into the nightscout API.

blaqone commented 2 years ago

Yes, added a subject, added the admin role to the subject and generated a token. Used that token to login. Same Error.

timoschlueter commented 2 years ago

@blaqone can you try accessing the API of your NS instance through the swagger-ui (https://<your-ns-url>/api-docs/#/) and use the "authorize" button to authenticate with the created access token? does this work?

blaqone commented 2 years ago

@timoschlueter how can i see if the token did actually work within the swagger-ui? What method to auth shall i use? token_in_url (apiKey) ?

timoschlueter commented 2 years ago

@blaqone "api_secret" is the method you should use. after authentication you can try one of the endpoints by clicking "Try it out" and then "execute".

image

There should be a response coming back from your instance if everything works:

image

mbdiab commented 2 years ago

always used the initial created token. Now with a new created one on nightscout admin page --> data is succesfully uploaded to nightscout @timoschlueter great work thank very much

timoschlueter commented 2 years ago

awesome, @mbdiab! i should make that clear in the readme. will update with the next version! :)

blaqone commented 2 years ago

@blaqone "api_secret" is the method you should use. after authentication you can try one of the endpoints by clicking "Try it out" and then "execute".

image

There should be a response coming back from your instance if everything works:

image

Yes, this produced a proper response!

Sadly: image

blaqone commented 2 years ago

Okay, changing settings on my end to allow connections without and with port seemed to fix it as I get a working connection.

blaqone commented 2 years ago

@timoschlueter so after a few tries it works perfectly now, timo! Thank you very much for your work. :) One last question, how come it always tries to upload the last readings since the start of the script? So it counts up and up ... ?

timoschlueter commented 2 years ago

@blaqone glad that it works now! :) It should actually not count up forever. The LibreLink Up API returns 140 - 142 measurements max. (last 12 hours). The script uploads all the measurements it receives unfiltered into nightscout since nightscout seems to be handling duplicate entries quite well. At least i haven't noticed any issues so far. :)

Normally you should always see something like this in the logs:

Bildschirmfoto 2022-01-26 um 14 55 53

This means that the uploader always receives 142 (+-1) on every "tick". There should never be more than 142 measurements coming from LibreLink since they dont provide measurements for more than 12 hours in the past. This should also be the case if you restart the application. The script itself does not check if it already has uploaded the same data in the past. I uploads all the measurements coming from the API. Maybe this is something i could improve in the future. :)

blaqone commented 2 years ago

Im uploading g6 AND FL3 into my NS. Quite interestings .... image

Thank you for the explanation!

timoschlueter commented 2 years ago

Very interesting! Which one is the FL3 measurement?

LuisPuertollano commented 2 years ago

sorry to comment on a closed thread: Does this mean, a closed-loop with AAPS 3.0.0 would be the possible? but therefore, to exchange data between AAPS and Linre Link for Libre 3, the patched LibrelinkUp and Nightscout would then be needed....so then, without internet (e.g. on a plane?), there would be no closed-loop, right? Thank you!

blaqone commented 2 years ago

Correct!

Am 06.02.2022 um 17:29 schrieb LuisPuertollano @.***>:

 sorry to comment on a closed thread: Does this mean, a closed-loop with AAPS 3.0.0 would be the possible? but therefore, to exchange data between AAPS and Linre Link for Libre 3, the patched LibrelinkUp and Nightscout would then be needed....so then, without internet (e.g. on a plane?), there would be no closed-loop, right? Thank you!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

blaqone commented 2 years ago

Very interesting! Which one is the FL3 measurement?

The FL3 is below and always way too low.

LuisPuertollano commented 2 years ago

Thank you! I´m still undecided,....let me explain shortly: I´m going this week to the dr. office to decide if I renew the libre 2 year-supply or to upgrade to libre 3... ATM the method with libre 2 works fine enough for me (no internet needed), so I´m still thinking, if an over the internet closed loop would be whise in my case, as my home connection is not so good (is really lagy)...or maybe I should upgrade my phone data-plan... I sketched this "architecture"...I hope the one for libre 3 is correct 20220206_175450_2 .

blaqone commented 2 years ago

I’d keep the FL2 as it is way more accurate, at least in my case AND for now you always need a internet connection with the FL3.

LuisPuertollano commented 2 years ago

Oh! I never expected the FSL3 to be less accurate than the FSL2... But thinking about it, maybe better wait a bit until there is a way for FSL3 without needing the cloud.

Thank you and thank also everyone involved in this development! :-D