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

Testers needed for NovoPen NFC syncing #2074

Open
jamorham opened this issue Apr 11, 2022 · 75 comments
Open

Testers needed for NovoPen NFC syncing #2074

jamorham opened this issue Apr 11, 2022 · 75 comments

Comments

@jamorham
Copy link
Collaborator

jamorham commented Apr 11, 2022

I have a working open implementation for syncing dose information from the NovoPen 6 and NovoPen Echo Plus which I've been testing internally.

I am planning to make this available shortly in a nightly. This issue ticket is to find people willing to test the feature, receive feedback and diagnose any problems or incompatibilities.

So far, the way it works is that the preference feature must be enabled from within the Insulin Pens preference screen and then the pen display is touched against the NFC receiver of the phone while the xDrip+ home screen is open.

At this point it will attempt to retrieve the last 7 days worth of dose information from the pen and then present these as xDrip treatment items within the display/history log. Duplicate data will be discarded.

Each treatment item contains a note entry giving the pen serial number which it was retrieved from. I would say that this is best suited for logging rapid-acting doses. For long-acting you can use the multiple insulins feature of xDrip and designate each pen to the type of insulin it contains.

In a similar way that the glucose meter feature works, optional noises are generated to indicate data being successfully synced.

To delete all synced pen treatments there is a voice command for testing: delete all pen data

Coexisting with Libre should now be working.

If you prime your pen with a small dose before the real dose then you can specify the maximum size of a priming dose and the time window maximum between the priming and real dose and then priming doses can automatically be removed from the data.

For each dose you can tap on the item on the graph and select options such as adding a note, zeroing the value (if it was not actually a real dose) or with multiple insulins changing the future designation for that pen. (If you change what is in which pen etc)

If you are interested in testing this, please add a comment below with your phone model and android version and pen type. Also please make sure you have switched to the Nightly update channel so that you can receive the update when it is available.

@madsviggers @retroneo @PieterDeBruijn @utzaki @yoshimo @JtxGit @PaarnTh

@jamorham jamorham self-assigned this Apr 11, 2022
@aleks372
Copy link

aleks372 commented Apr 11, 2022

Interested, Galaxy S21 Ultra (SM-G998B) latest Android 12 and Novopen Echo Plus

@utzaki
Copy link

utzaki commented Apr 11, 2022

WOW! Good to hear! Sure I will do everything to help to test.

Echo Plus, Galaxy S7. The Android version is not known for now and I cannot check because of travelling. Unfortunately, the S7 is my old mobile, which is not in regular use anymore. But for a test, I could install xDrip+ there. My actual mobile is not compatible with Novopen 6.
I will jump into testing in week 17 after I will be back.

@PaarnTh
Copy link

PaarnTh commented Apr 11, 2022

I'l help.
Samsung S21FE (SM-G990B/DS)
Latest android (Android 12)
Novopen ehco plus. 2 of them.

@madsviggers
Copy link

Samsung galaxy s20 Fe, novopen 6, android 12

@jamorham
Copy link
Collaborator Author

The April 11th nightly including this feature is out. Make sure you are on the Nightly update channel and you can manually select Check for updated version from the 3 dot menu on the top right of the home screen to prompt for an update download.

Once installed find in the main settings page at the bottom a section for Insulin Pens and select the NovoPen section and enable OpenNov support. Then when back on the home screen of xDrip you can touch the pen to your NFC sensor (typically on the back of the phone) - Make sure NFC is enabled in your system settings first.

Beware that by default this is designed to sync the last week's worth of dose data. You should hear beep noises to indicate success or failure and whether there is new data available. The pens I've been testing with are new and so don't have many doses logged on them, so I'm interested to know if this works correctly for pens with many more doses logged in them.

To erase the synced data from xDrip see the voice command described in the first comment.

@jamorham
Copy link
Collaborator Author

If you're using Libre and would normally do NFC scans within xDrip, beware that this probably wont work correctly at the moment and enabling the OpenNov feature will probably stop those scans working. To revert to normal NFC behavior, turn off the setting in the preferences for OpenNov and then swipe off xDrip and then re-open it. If that doesn't restore Libre NFC then reboot your phone. I will address this issue after dealing with any issues to do with the actual operation of the OpenNov feature.

@loop2016
Copy link

Thank you, jamorham!
Pixel 6, Android 12, Novopen 6 (basal) & Echo Plus (bolus)

@jamorham
Copy link
Collaborator Author

Has anyone managed to test this yet? Keen to know whether its working for you guys? thanks

@PaarnTh
Copy link

PaarnTh commented Apr 12, 2022

Yep i have tested. Works perfect. No issues here.
First sync was 7days yes.

@madsviggers
Copy link

It works!!!!!!!! Just as it should!

@aleks372
Copy link

Works perfectly! Takes less than a second or two to scan and display predictions.
Had few Reading failed, but that was because the pen was not in a fixed position.

@tolot27
Copy link
Collaborator

tolot27 commented Apr 12, 2022

It works in general but create records with Humalog insulin. There should be an option to configure the insulin for each pen ID.

Also, there should be the "priming units" option like for InPen.

@tolot27
Copy link
Collaborator

tolot27 commented Apr 12, 2022

Deleting an insulin entry loaded from the pen causes a NightscoutUploader exception:

Couldn't find a reference_id for uuid: AAFTP6:Open######:1.0 got: null
Got exception parsing treatment lookup response: org.json.JSONException: Index 0 out of range [0..0)

@jamorham
Copy link
Collaborator Author

@tolot27 Can you describe your use case, which insulins in which pens etc? How you would imagine it could work better and whether the in-pen style priming doses strategy would work as you'd like here. With the nightscout uploads does it just noisily pass through all the deleted records or does it jam the upload process?

@tolot27
Copy link
Collaborator

tolot27 commented Apr 12, 2022

@tolot27 Can you describe your use case, which insulins in which pens etc?

We have up to four pens for FIASP, Humalog, Actrapid and Tresiba. The FIASP pen is the most frequently used pen followed by Tresiba (once a day).

How you would imagine it could work better and whether the in-pen style priming doses strategy would work as you'd like here.

The first thing we always do before we inject the pen in the body is to fill the canula with 0.5 IE. This is recommend to check whether the canula works correctly (not blocked) and no oxygen will be injected. If I understand it correctly, this is called priming unit. It should not be recorded as active treatment because it is not injected into the body.

With the nightscout uploads does it just noisily pass through all the deleted records or does it jam the upload process?

I can debug it further. Currently, both uploading new records and deleting recently added records causing an exception. Verbose logging does not give much detail.

The exception on upload of a new treatment is: Exception uplaoding REST API treatments: length=23; index=24.

No pen treatment is shown on Nightscout.

@jamorham
Copy link
Collaborator Author

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

@yoshimo
Copy link

yoshimo commented Apr 12, 2022

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

What if your current phiol gets empty and you need to refill it?
so you have 1 unit prime, first part of the dose, then "recharge" the empty pen, prime another and finish with one more unit? Wouldn't a manual "selection" be better in such a case?

@tolot27
Copy link
Collaborator

tolot27 commented Apr 12, 2022

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

Yes, I'm using the multiple insulins feature and Echo Plus/Echo 6 pens and like to see insulin/pen assignments.

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

Yes that would be fully sufficient. For penfill replacements, one can delete the not injected doses. But the problem with all deletions is that they will reappear after the next NFC scan. Hence, we need something like an "ignore this treatment" feature.

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

Only NFC pen readings are affected. They will not be uploaded. All subsequent data manually entered are uploaded to NS.

@yoshimo
Copy link

yoshimo commented Apr 12, 2022

Seems like there is a table needed with pen-id,timestamp and amount to ignore , so it can be filtered out of calculations and displaying.

@loop2016
Copy link

loop2016 commented Apr 13, 2022

jamorham:

@tolot27 so I assume that you are already using the multiple insulins feature of xDrip and that you'd like pens to match against those? Also you are using the Echo Plus?

In a similar way to inpen I can make it so that it nullifies the insulin value of doses that are <= X units within X minutes of another dose. So for example <=1 unit within 2 minutes of another dose. Do you think this would successfully filter your priming doses?

For nightscout this needs more investigation. I am keen to understand whether it just tries to upload deleted records and then skips them or whether it fundamentally is breaking the nightscout uploading affecting subsequent data?

That's a good idea. But perhaps just importing the last value would be more straightforward and comprehensible for the user.
Everything else works great for me. Thanks again. (Pixel 6, Android 12, Echo Plus)

@tolot27
Copy link
Collaborator

tolot27 commented Apr 13, 2022

That's a good idea. But perhaps just importing the last value would be more straightforward and comprehensible for the user.

But this is not enough for me, because I want to import all the values that my son injected during the day at school.

@jamorham
Copy link
Collaborator Author

There should be a new nightly available on Thursday which will include the following changes:

  • co-existing libre nfc scanning
  • nightscout upload bug fixed
  • optional automatic priming dose detection
  • optional hiding priming dose icons from the graph
  • ability to tap on a dose entry and zero it if it was not an actual utilized dose

@yoshimo
Copy link

yoshimo commented Apr 14, 2022

ability to tap on a dose entry and zero it if it was not an actual utilized dose
Does this persist across multiple imports from the pen so the ignore state won't get overwritten the next time people import data by connecting the pen?

@jamorham
Copy link
Collaborator Author

@yoshimo yes it does and it will also zero the value on nightscout as well

This nightly is now available.

@jamorham
Copy link
Collaborator Author

Friday nightly will include support for multiple insulin types where a type can be allocated to each pen.

@jamorham
Copy link
Collaborator Author

jamorham commented Apr 15, 2022

@aleks372 Do you do priming doses where you would dial up and press the plunger but not inject? Could that be the source of these? (for context a bug was reported which turned out not to be a bug and OP removed the report and screenshot above)

@DavidB766
Copy link

DavidB766 commented May 1, 2022 via email

@dsnomr
Copy link

dsnomr commented May 9, 2022

Samsung Galaxy note 8, Android 9 funktioniert mit Novopen echo plus

@pannal
Copy link

pannal commented May 19, 2022

Works well on Poco F2 Pro, Android 11.

I'm using two NovoPen Echo Plus, one for Tresiba and one for Fiasp. It would be nice to be able to "tag" each pen to have a visual color difference in the home graph. Sadly I can't select Tresiba right now, as the PR isn't merged yet.

Thanks for this awesome app.

@PythonFZ
Copy link

Huawei P30, works with NovoPen 6. Great Job! I'm using two Pens, one for Tresiba and one for Fiasp, is there documentation on how to configure the two different Insulin types?

@hansj10
Copy link

hansj10 commented Jul 3, 2022

works like a charm on Pixel 5, Android 12. Thanks for your work ;)

@hupfpfupf
Copy link

Thanks a lot for implementing this awesome feature. A Question: could you maybe add kind of a statistic for insuline-usage to Xdrip? or is there a place to suggest/request features to Xdrip? would be amazing if we could see average units/day and maybe a split of average usage from 12am-11am; 11am to 4pm and 4pm to 12am.

@DavidB766
Copy link

DavidB766 commented Aug 26, 2022 via email

@Navid200
Copy link
Collaborator

@DavidB766 @dsnomr It would be very kind of you if you edit your posts, instead of just replying to emails that you receive from Github, and clean them up.
They contain lots of empty lines and redundant text right now making it hard for anyone to follow the conversation.
Thanks

@dsnomr
Copy link

dsnomr commented Aug 27, 2022

Thanks for the tip, unfortunately I don't know my way around well enough here

@DavidB766
Copy link

DavidB766 commented Aug 27, 2022 via email

@robertherber
Copy link

From what I understand this is for Android - is there any progress on something similar for iOS?

@DavidB766
Copy link

DavidB766 commented Oct 11, 2022 via email

@Navid200
Copy link
Collaborator

@DavidB766
Please delete your post as you have mentioned it has nothing to do with this issue.
Instead, please open a discussions here: https://github.com/NightscoutFoundation/xDrip/discussions
Your question will be answered then.

Please don't send an email response to my request.
If you don't comply, I will ask your post above to be deleted.

@atomphil
Copy link

atomphil commented Nov 3, 2022

I´m using two Novopen 6 with xDrip and import works great.

Would it be possible to open xDrip app by reading the NFC of the pens?

@atomphil
Copy link

Is there a way to change the insulin type of a Novopen?
So far I had two Novopen 6 with Novorapid and Levemir in use. Now I also have Fiasp and would like to use the pen I used with Levemir with Novorapid and the former Novorapid pen with Levemir (because of the colors, I have two silver and one blue).

@Richspiral
Copy link

Richspiral commented Nov 13, 2022

I'm using Samsung note 9 with android 10 and novo pen 6 and this works great for which many thanks!

One minor request: I'm uploading my data to dexcom and then pulling it down to sugarmate. Would it be possible to include an option to upload pen data as well as blood sugar data on the xdrip dexcom server page? Thanks
Screenshot_20221113-133903_xDrip+.jpg

@thedewi
Copy link

thedewi commented Oct 1, 2023

Working really nicely with 23ccbd1-2023.07.16 and two NovoPen 6s (Australia) containing different types of Insulin. Thanks so much for this! Really useful feature!

@Slash137
Copy link

Slash137 commented Oct 9, 2023

I've been testing Nightscout with xDrip and one Fiasp Novopen Echo and sometimes works, but other times it just uploads to xDrip but not to Nightscout

@utzaki
Copy link

utzaki commented Oct 9, 2023

@jamorham I am still fascinated and thankful for this great feature. Technically it is working very well.
Sometimes it's a bit tricky to find the best NFC spot and keep the pen calm in the position until the reading is done.
Maybe the acoustic feedback could be improved to help understanding if the reading was successful or not. My personal experience is, that there is always a lot of beep beep, sometimes high tone, sometimes low tone. But although using that reading several times a day since your modification was deployed, I still do not understand the meaning of the sounds. Maybe just one sound if successful would be simpler and more understandable?

@thedewi
Copy link

thedewi commented Nov 17, 2023

From time to time, this feature fails to release its exclusive use of NFC when xDrip+ goes to the background. When this state fixates, other apps won't respond to nearby NFC devices in any way.

The workaround is to open xDrip+ again, and background it again, which usually releases it. (23ccbd1-2023.07.16 on a Pixel 6 Pro).

@vytux-com
Copy link

So I've been testing this and so far it's been great, but tonight I noticed one quirk, it seems to only download last 4 readings (2 X zeroed ones and two actual readings) so if you don't download the values at least twice a day the rest of the history seems to be lost.

Now these pens are supposed to be able to store 800 values, is there a way to download more data?

@Loquacity
Copy link

I would love to test this as well!

I have a Pixel 7, running Android 14. I use two NovoPen 6, both currently with Levemir (although I would like to change them to Fiasp), although they're marked in xDrip as Lantus.

@Navid200
Copy link
Collaborator

For those of you who have asked for a way to switch the insulin type, I cannot make any changes because I don't have one of these pens.
Let's wait to see if @jamorham has any comments.

But, I suspect there may be a coarse workaround although I have not tested it.
Save your database and settings first.
You can either use the Google drive method: https://navid200.github.io/xDrip/docs/GoogleDriveBackup.html
Or, you can use the legacy database backup: https://navid200.github.io/xDrip/docs/Backup-Database.html
Then, uninstall xDrip. Now, install xDrip. Can you now connect your pen and choose the insulin type you want?

@Teute0815
Copy link

Teute0815 commented Apr 15, 2024

First of all: Thanks for all the work generally and specifically for implementing the scan function for smart pens.

I've been using the pen scan function (Novo Echo) for a few weeks now and have a bug to report and a feature request:

Bug: The values end up in x-drip+ relatively satisfactorily (unfortunately scan errors are quite common before it eventually works). They are displayed correctly in both the main graph and the history. But they don't end up completely in Nightscout. I can't figure out the error (all manual insulin doses, notes, all cgm data, etc. are uploaded correctly). Some days are complete and correct, some are missing one or two values, some almost have none. Backfilling didn't help. This makes it difficult to evaluate the average daily insulin dose for example. Bug known? Any tips?

Feature requests:

  1. The first request for a "quick" workaround arises from the bug above: Is it possible to implement an evaluation/statistics about administered insulin over a selectable period of time (absolute/average) directly in x-drip+?
  2. Some values are simply not recognized correctly (priming<>injection for example) and then have to be changed manually. Unfortunately, this is quite difficult because the values in the graphs are often so close to each other that you just can't get to/select the desired value. An extra option to display the scanned values as a list including an editing option per entry/value (zero value or better yet priming<>injection, deletion, adding a note) would be helpful here.

@jamorham
@Navid200

@utzaki
Copy link

utzaki commented Apr 15, 2024

First of all: Thanks for all the work generally and specifically for implementing the scan function for smart pens.

I've been using the pen scan function (Novo Echo) for a few weeks now and have a bug to report and a feature request:

Bug: The values end up in x-drip+ relatively satisfactorily (unfortunately scan errors are quite common before it eventually works). They are displayed correctly in both the main graph and the history. But they don't end up completely in Nightscout. I can't figure out the error (all manual insulin doses, notes, all cgm data, etc. are uploaded correctly). Some days are complete and correct, some are missing one or two values, some almost have none. Backfilling didn't help. This makes it difficult to evaluate the average daily insulin dose for example. Bug known? Any tips?

I use the same constellation, reading Novopen in xdrip+ and then uploading them via REST API to Nightscout. I never noticed missing insulin doses in Nightscout. Just checked the last days and here everything is fine.

Feature requests:

  1. The first request for a "quick" workaround arises from the bug above: Is it possible to implement an evaluation/statistics about administered insulin over a selectable period of time (absolute/average) directly in x-drip+?

Indeed just adding the average/day insulin in the statistic panel in addition to Range, Median BG, ....GVI would be helpful.

  1. Some values are simply not recognized correctly (priming<>injection for example) and then have to be changed manually. Unfortunately, this is quite difficult because the values in the graphs are often so close to each other that you just can't get to/select the desired value. An extra option to display the scanned values as a list including an editing option per entry/value (zero value or better yet priming<>injection, deletion, adding a note) would be helpful here.

I cannot confirm this behaviour. The priming is shown for some time and then always disappears from xdrip.

@vytux-com
Copy link

vytux-com commented Apr 15, 2024

  1. Some values are simply not recognized correctly (priming<>injection for example) and then have to be changed manually. Unfortunately, this is quite difficult because the values in the graphs are often so close to each other that you just can't get to/select the desired value. An extra option to display the scanned values as a list including an editing option per entry/value (zero value or better yet priming<>injection, deletion, adding a note) would be helpful here.

I cannot confirm this behaviour. The priming is shown for some time and then always disappears from xdrip.

I believe the OP means that sometimes priming values are not recognised as such. For me that happens if I have to prime 2 or more times, only the first priming value is excluded. This would almost always happen at penfill cartage change or if the pen needle is blocked or something.

I don't have the issue of values being too close as all of my actual injections are over 20 units each so priming doses are quite a bit separated, but I can see that it would be an issue if you were injecting lower amounts.

@rossiscool123
Copy link

rossiscool123 commented Jun 10, 2024

Been having issues with xdrip not uploading pen data to nightscout as well.
Version 645e8b4-2024.04.19
Screenshot_2024-06-10-16-40-47-44_2dd2c1bcb8f659cd696bcba2072f751b

@Loquacity
Copy link

  1. Some values are simply not recognized correctly (priming<>injection for example) and then have to be changed manually. Unfortunately, this is quite difficult because the values in the graphs are often so close to each other that you just can't get to/select the desired value. An extra option to display the scanned values as a list including an editing option per entry/value (zero value or better yet priming<>injection, deletion, adding a note) would be helpful here.

I cannot confirm this behaviour. The priming is shown for some time and then always disappears from xdrip.

I believe the OP means that sometimes priming values are not recognised as such. For me that happens if I have to prime 2 or more times, only the first priming value is excluded. This would almost always happen at penfill cartage change or if the pen needle is blocked or something.

I don't have the issue of values being too close as all of my actual injections are over 20 units each so priming doses are quite a bit separated, but I can see that it would be an issue if you were injecting lower amounts.

Can confirm that only the first priming dose is excluded. I've compensated for this by doing a larger priming dose, but that might not be an option for everyone (and doesn't always work, of course, if the needle is blocked or something).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests