JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
327 stars 320 forks source link

Heartbeat Missing for Trio #555

Closed MikePlante1 closed 1 month ago

MikePlante1 commented 1 month ago

All my tests were in-vivo, I kept my G6 connected to the official Dexcom app and checked "Read from Dexcom app" in xDrip4iOS' Bluetooth menu. I then used xDrip4iOS as the cgm source in Trio.

MikePlante1 commented 1 month ago

Not sure why I couldn’t get heartbeat to work before, but it’s working now.

paulplant commented 1 month ago

Hi @MikePlante1 , so you can confirm that Trio receives correctly a heartbeat using the current xDrip4iOS 5.3.1 and the current share-client without needing any other changes?

To be honest, I wasn't sure how to answer your first post as it didn't make sense to me (from a functionality point of view) that you could change the heartbeat of the share-client but changing app group settings in xDrip4iOS.

Please let me know if you can test some more (I'm travelling and very limited for free time) and if it is actually working well or if we need to look into things more.

PS. Does this mean that the Trio Dana branch can work without background audio when using xDrip4iOS as the CGM source?

MikePlante1 commented 1 month ago

So, my initial test and issue report was not the best. I was just going off of the xDrip4iOS module in Trio and not actually testing heartbeat. For my initial 4 tests, I marked them based on this:

✅ Heartbeat confirmed in Trio ❌ Heartbeat confirmed in Trio
IMG_5080 IMG_5089

But the following day, I tried the same test that failed the first time, and this time it succeeded in displaying the heartbeat/cgm in Trio.


To actually test the heartbeat functionality, I setup the following on my real phone (iPhone 15 ProMax + iOS 17.5.1)

Trio app being used for my management:

Trio app being used for the test:

xDrip4iOS:

Readings populated properly in Trio from xDrip4iOS from Official Dexcom G6 app and Live Activities from both apps displayed properly. I then closed (minimized, not force closed) both apps and let them run without opening them and went to bed. 7 hours later, I opened my phone and both Live Activities were displayed properly on the lockscreen, proving that the heartbeat from Dexcom G6 was properly forwarded to the Trio app from xDrip4iOS.

Later in testing, I also noted that sometimes the xDrip4iOS module will display a heartbeat/CGM address even when no CGMs were paired to xDrip4iOS. And I also see that the CGM address displayed above is the only CGM address that's ever displayed and it never changed for me. I seem to remember it changing every 5 minutes before, but maybe I don't remember that properly.


This leads me to believe that the heartbeat does get transferred properly to the Trio app and keeps it awake. It also seems like maybe there's a display issue regarding CGM address in Trio. If Trio is kept open properly from xDrip4iOS with a simulator pump, I would expect it to be kept open with a heartbeat-less pump like Dana.


I will do another test tonight where I build xDrip4iOS and Trio-dev+PR314 to a different iPhone, use xDrip4iOS in Follower HeartBeat mode via Nightscout, and see if that keeps Trio awake in the background properly using xDrip4iOS as a cgm source and a simulator for the pump.

paulplant commented 1 month ago

Should be fixed with #557