malaow3 / Glucose-Widget

13 stars 6 forks source link

Empty glucose readings #1

Closed daniel2887 closed 2 years ago

daniel2887 commented 4 years ago

Hi,

(Thanks for sharing on Reddit :) )

I'm trying to run just main.py on a Windows PC to test this out. I hardcoded my username and password in the script, and ran it using Python 3.8. It gets pretty far into get_data(), but fails due to empty glucoseReading:

Traceback (most recent call last):
  File "main.py", line 121, in <module>
    glucose, trend, datalist = get_data()
  File "main.py", line 67, in get_data
    glucose = glucoseReading[0]["Value"]
IndexError: list index out of range

If I print out glucoseReading right after glucoseReading = json.loads(glucoseReading), I get [].

Have you run into such an issue?

malaow3 commented 4 years ago

Hey Daniel!

While I haven't experience this issue personally, I'd be glad to help you try and work through it (to the best of my abilities, I'm certainly not an expert my any means!)

Just a few preliminary questions: 1) have you installed all the required packages (e.g. matplotlib, Flask)? 2) Are you based in the US? I know the endpoints being used here don't work with EU users, so if you're not in the US I can help you set up different endpoints for the Share API

daniel2887 commented 4 years ago

I haven't installed matplotlib and Flask yet since I'm just running main.py for testing purposes. (Though I should mention that I commented out keep_alive for now, which is why I didn't need these modules to get this far.)

Yes I'm located in the US. I tried the EU server as well (shareous1), but that caused a return code of 500 after the initial session request.

I also tried to use a bogus username, which also resulted in a return code of 500, so I think I'm getting authenticated okay with my real credentials...

Do you use the same login credentials that you use to log in to, say, Clarity?

malaow3 commented 4 years ago

Yep, same account, just be sure you're using the username tho and not the email, as I've made that mistake before in the past. Other than that I'm not entirely sure where the issue is occurring. Out of curiosity, which sensor are you using? Not sure if that may be the cause of the issue

daniel2887 commented 4 years ago

Yep I'm using the username, not email.

I'm using G6, and I can see my data through Clarity so the readings are making their way to Dexcom...

I'll keep poking around.

malaow3 commented 4 years ago

Hmm ok I’m using G6 too, not sure where the issue is. I can investigate a bit on my end as well and see if I can resolve the issue

ebouchut commented 3 years ago

Hey Daniel, Have you found a solution/workaround so far?

malaow3 commented 3 years ago

@ebouchut I'm not sure if Daniel will see w/o pinging him @daniel2887

daniel2887 commented 3 years ago

Hey @ebouchut, no I did not... I ended up taking the easy way out and set up NightScout for fetching data from Dexcom, together with:

ebouchut commented 3 years ago

Hey @malaow3 and @daniel2887 Thank you for sharing your dev, tips, and feedback. Really appreciated. I will also give NightScout a try as I'm stuck with a 500 error even with the correct credentials (id (not e-mail) and correct password).