Pages

Friday 20 May 2016

Nightscout on the 640g: Six Months of (We Are) Not Waiting

A little over a year ago, Janki received her 640g pump and CGM sensors. We were (and are) very grateful. This system, whilst far from perfect, has transformed the management of her diabetes. But, back then, remote access to her pump data seemed like a pipe dream. Nightscout was not available due to the encrypted radio protocol and Medtronic could not give a release date for their MiniMed Connect system on the 640g.

In six months, as a community, we've gone from a proof of principle, to something more elegant, to direct communication with the pump via an Android phone. With Lennart Goedhart's work and its beta release, we now, essentially, have an Open Source MiniMed Connect:

 (NB At present, some of the additional info in the Nightscout grab above is coming from periodic use of the earlier NS solutions for the 640g, but more functionality on the Android app is planned)

For me the message is clear: if the patient community has the technical skills they won't wait to find a way to get access to tools that they feel will be of benefit. #WeAreNotWaiting goes beyond Nightscout. It's a way of thinking that can't be put back in its box and presents a huge challenge to both commercial device companies and Regulatory Authorities.

This is independent of commercial forecasting - our kids have Type 1 now, not next financial year (by the way, in case there was any doubt in commercial-land about whether patients and carers want remote access, around 15,000 people have taken the time to read my blog pages on the even the early Nightscout solutions for the 640g).

It has been produced without Regulatory oversight. And just to be 100% clear, I'm in favour of regulation (my day job is centred around Regulatory frameworks set up to protect patients and staff in my area of healthcare) but the Regulators - as well as each med tech company involved - have to wake up and smell the community coffee. Processes, interpretation and (eventually) legislation has to change (in my humble opinion).

I spent a lot of last year wishing I had access to Janki's data - particularly for overnight and school trouble shooting (or worse). The first iteration of Nightscout on the 640g was not, actually, the post I put up back in November 2015. It was a mechanical rig that would (on a timer) use an actuator to push a side arrow button on the pump. There was a phone camera, with a fish-eye lens clipped on to grab the whole pump screen at short range. That was sent to Dropbox and would display on a remote phone. Did I mention there was Meccano involved? And eye-rolling from Mrs Little D.... Of course if Janki rolled over onto this contraption, the infusion line may well have failed before the Meccano...*

*Seeing this Bigfoot post the other day did, however, bring a huge smile to my face -

So "First Generation" of Nightscout was a bounce via CareLink.



Because of the relatively large dataset size being handled (CareLink could only issue a whole day's CSV report) the scripting was handled on a local PC rather than being buried neatly remotely on Azure, where data charges may have started to kick in. That certainly complicated installation.

I added in other pump information, including basal and bolus information as well as pump alarms:

Tom Collins came on-board as a user of the First Gen system and then quickly put his skills to work building a neat .Net uploader, which took away the need for some of the installation layers - we had reached "Second Generation" :)


And then after months of work by a small group, analysing pump data via the Bayer Contour Next Link 2.4 stick, Lennart made a - the - breakthrough we'd been hoping for: direct communication with the 640g (via a Bayer stick). With his original Python debugging code, it was easy for me to add to and connect to Nightscout, but not ready for prime-time.

For a public release, Lennart led the way again, heavily adapting the original Android Medtronic Uploader to deal with the 640g data he had unlocked directly. This "Third Generation" is what the vast majority of 640g users will have been waiting for.

Over the last six months, I'm very proud to have helped dozens and dozens of families to get remote access to their pump data. It's been fantastically rewarding, as has working with people like Tom to solve issues and think up better solutions. There's still a rich seam of pump data and information to be mined and included in the 640g implementation of Nightscout. The journey's just begun.

12 comments:

  1. Awesome! Need to try this immediately tonight when the pump, extra Bayer, Android phone, the typeone and myself are home. Any instructions yet on any modifications needed for the NS setup when moving from an old Dexcom setup to the 640g version? Or do I just need to change the Android uploader app on the uploader phone? Anything that needs to be setup with the Bayer? E.g. does the extra Bayer need to be registered on the pump first and then registered in the Android Uploader app through the menu? Or the other way round. Would be great to beta test this with some basic steps on how to get it up and running and letting me know where to report issues and bugs?

    Thank you so much Lennart and Matt and everyone involved in this!

    ReplyDelete
    Replies
    1. Thanks Jami! https://github.com/pazaan/640gAndroidUploader/wiki for instructions. Yes, register spare Bayer to pump first, upload to CareLink with it (manually) and then start the app.

      Delete
  2. Wow works like a charm so far. No more tablet pc. So easy and so appreciated

    ReplyDelete
  3. Sorry for the basic questions - do you calibrate the sensor using the CNL meter that's not connected to the phone?
    I require to give fairly regular reports to my endo due to pregnancy and moving my insulin requirements frequently. Do I use the CNL meter that's been connected to the phone to upload pump data to Carelink? And if so, would calibrations from the CNL meter not connected to the phone, transfer Info over from the pump?
    Or should I just be giving my endo the NS data?
    Thanks
    Sarah

    ReplyDelete
  4. Hi Sarah, I'd strongly recommend using a spare Bayer for the phone connection. (You would have to physically disconnect it from the phone to use it in the conventional way to take BG readings). So assuming you had two CNL meters and both are registered to you pump, you could plug either into your PC and use them upload to CareLink. The pump holds all the calibration and BG information ready to send to CareLink. So your endo should be able to get all the usual data via CareLink. NS reports are (imo) better than CareLink but your clinical team may be more relaxed about / familiar with using CareLink

    ReplyDelete
    Replies
    1. Thanks Matt - I was missing the point that the pump holds all the data and the meter is merely just the Bluetooth connection for upload!!

      Delete
  5. Perfect! Many thanks to all you guys involved.

    It worked within 3 minutes at the first try. Although I did have a working nightscout via the PC, so I did not have to setup the Azure and MogolDB part. Also by shere coincidence (or provicence) both T1 and I have a USB OTG capable mobile phone. I can confirm that the reasonably priced Alcatel One Touch Idol 3 (4.7 inch) and my old Sony Xperia Z are working.
    Just now I bought a "Micro USB Host OTG Cable with Micro USB Power" to be able to connect the Bayer and charge the phone at the same time. I can even connect a small powerbank when T1 goes to school in the morning when the phone battery is halve way gone after a good night working. T1 takes a small diabetes backpack with him to school (and everywhere else) anyway. Beware that the cheaper versions are only charging the OTG USB attached device. The cable I bought is supposed to charge both the mobile and the USB-device. But this is still theory. I will confirm (or not) if this works later this week.

    ReplyDelete
  6. "Micro USB Host OTG Cable with Micro USB Power" is this working ?!

    ReplyDelete
    Replies
    1. Unfortunately the "Micro USB Host OTG Cable with Micro USB Power" does work with a usb flashdrive but not with the Bayer.
      I've decided to sacrifise my 3,5 yr old Sony Xperia Z (and buy a new phone :-). The old sony supports USB OTG and I have a charging cradle that charges via pogo pins. The USB-port will be available during charging. However I'll have to tweak the cradle a bit to allow for the USB OTG cable to stick in when mounted in the charging cradle.

      Delete
  7. If the Bayer is fully charged when connected it won't drain the phone battery almost at all, we've been using NS 640g for a couple of weeks and I charge our Samsung S3 overnight and it lasts until 10-11PM through the day, I haven't charged the CNL separately a single time. I don't think there is a charging cable that charges both from the power source, I think the CNL can only be charged from the phones battery. At least with the Dexcom rig this was the case. But I haven't tried to research this. But with the CNL taking so little power it hasn't been an issue. You just have to make sure that the CNL is 100% charged before you initially plug it in, otherwise it will charge itself from the phone's battery.

    ReplyDelete
  8. The "Micro USB Host OTG Cable with Micro USB Power" could have worked. It does for a normal USB flashdrive. See my reply above. You could be right, perhaps the Bayer CNL does not use much battery of the phone. However the battery life of the phone is definitely a lot shorter with nighscout uploader running (btw also my phone when the nightscout webpage is active). Posibly this is due to the phone not being able to go into low energy sleep mode or to the frequent (every 2 min) wakings with upload activity.
    In our case we are especially interested in reading nightscout during bedtime. And it would be perfect to use it all during school and perphaps the rest of the day as well. Our T1D always has a small backpack with him anyway. In that case there is no opportunity to charge the phone without the Bayer CNL. Also it won't last a complete day. The Acer Liquid Zest Plus has USB OTG and a 5000mAh-battery (200 euro) might make it through the day.
    For round the clock nightscout uploads a alternative upload is required. I'll tweak my Sony charching Cradle that works with pogo pins. Other brands might have cradles as well. Also wireless charging might work.

    However, I have not managed to keep the nightscout uploader working for more than 15 minutes away from home. The uploader looses connection to the Bayer CNL. Troubleshooting is difficult, it might be due not re-astablishing the connection to the Bayer CNL after T1D gets back from being out of range. I do hope this can be fixed at sometime.

    ReplyDelete
  9. The biggest issue over had has been the OTG cable disconnecting in the MicroUSB socket. Very frustrating.

    ReplyDelete