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

Attempting to set a basal rate above 5.99 results in the pump recieving a rate of 0 #1395

Open
dcacklam opened this issue Apr 14, 2021 · 4 comments

Comments

@dcacklam
Copy link
Contributor

Describe the bug
When OpenAPS attempts to set a basal of 6u/hr or higher, the actual command sent to the pump sets the basal to 0.

To Reproduce
Steps to reproduce the behavior:

  1. Set a maxSafeBasal above 6 (Say, 8 - it doesn't matters)
  2. Allow a condition to exist wherein oref0 calculates a basal-rate above 6 & enacts it on the pump.
  3. Note that despite the log showing a high temp basal above 6 (like 8 or 12), the pump actually has a temp basal of zero.
  4. Note that the pump allows manually input temp basals well above 6.

Expected behavior
Enacting a basal of 6 or above results in the correct basal being enacted on the pump.

Setup Information (please complete the following information):

  • Pump type: Medtronic 722, v. 2.4A 1.1 0B 0B firmware
  • CGM type: Dexcom G5 via Logger/xdripjs
  • Rig type: Edison/Explorer
  • oref0 version: dev-branch, current pull as of 4/14/21 12:02, using 'Go' binaries at install time.

Additional context
This has been an ongoing issue across multiple releases.
While it was supposedly addressed in one part of the code, it does not seem to have been addressed through the whole stack, such that the correct rate is actually sent to the pump.
IIRC the original issue was due to byte-swapping/multi-byte issues.

@scottleibrand
Copy link
Contributor

I remember putting safeguards in place to limit maxSafeBasal to below 6 U/hr, and rely on SMB for anything needed beyond that. But I don't recall if/where we ended up fixing the byte overflow bug that caused it to be unable to set basals over 6. In practical terms it hasn't been much of an issue, because most everyone needing that much insulin has been using SMB.

If you'd like to put together a PR that limits maxSafeBasal to 6 across the board, that might be the easiest workaround for now, unless/until someone wants to really dive into this.

@Foxy7
Copy link
Contributor

Foxy7 commented May 21, 2021

@dcacklam i don't think we've had this issue or at least not noticed it, but we have an almost the identical set up to you. Have you got any logs to look at for this?

My dev pull is following the 5Jan update i think.

I will check our pump firmware tonight, also using a 722 pump.

I read this issue for the first time yday so got up this morning to physically check the pump tbr had been initiated, which it had for around 5 mins.

(We need to get at least 7 units in over 40 mins to 1hr before breakfast to stand any chance of keeping my daughter from hitting 20 mmol/l every day so have created a schedule for school days).

Here's this morning's log from papertrail in case there's any obvious differences?

May 21 06:56:23 MealsDevTBD pump-loop.log "minPredBG 24.6, minGuardBG 9.2, IOBpredBG 17.4, COBpredBG 22.3, UAMpredBG 17.4; Eventual BG 22.3 >= 4.4,  insulinReq 4.12. Microbolusing 2U. adj. req. rate: 11.4 to maxSafeBasal: 8, temp 0.8<8U/hr. "
May 21 06:56:23 MealsDevTBD pump-loop.log COB: [164,166,170,176,183,192,203,215,229,244,261,279,299,320,342,365,390,401]
May 21 06:56:23 MealsDevTBD pump-loop.log UAM: [164,165,166,168,171,174,177,181,185,189,194,199,204,209,214,219,224,228,233,238,242,246,250,254,258,262,266,269,273,276,279,282,285,287,290,293,295,297,299,301,303,305,307,309,310,312,313,314]
May 21 06:56:23 MealsDevTBD pump-loop.log IOB: [164,165,166,168,171,174,177,181,185,189,194,199,204,209,214,219,224,228,233,238,242,246,250,254,258,262,266,269,273,276,279,282,285,287,290,293,295,297,299,301,303,305,307,309,310,312,313,314]
May 21 06:56:23 MealsDevTBD pump-loop.log ZT:  [164,167,171,175,180,185,191,197,203,210,218,226,234,243,253,262,273,283,294,304,315,326,336,347,358,368,378,388,398,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401,401]
May 21 06:56:25 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":27,"temp":"absolute","rate":0.8}
May 21 06:56:27 MealsDevTBD pump-loop.log enact/smb-enacted.json: "Rate: 8 Duration: 30"
May 21 06:56:28 MealsDevTBD pump-loop.log Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
May 21 06:56:30 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":30,"temp":"absolute","rate":8}
May 21 06:56:30 MealsDevTBD pump-loop.log 2021-05-21T05:56:22.412Z
May 21 06:56:30 MealsDevTBD pump-loop.log Checking deliverAt: 2021-05-21T05:56:22.412Z is within 1m of current time: Fri May 21 06:56:30 BST 2021
May 21 06:56:30 MealsDevTBD pump-loop.log and that smb-suggested.json is less than 1m old
May 21 06:56:41 MealsDevTBD pump-loop.log Listening for 10s: .No interfering pump comms detected from other rigs (this is a good thing!)
May 21 06:56:41 MealsDevTBD pump-loop.log Continuing oref0-pump-loop at Fri May 21 06:56:41 BST 2021
May 21 06:56:43 MealsDevTBD pump-loop.log Checking reservoir: reservoir level before: 135.5, suggested: 135.5 and after: 135.5
May 21 06:56:45 MealsDevTBD pump-loop.log Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
May 21 06:56:50 MealsDevTBD pump-loop.log Sending ESC ESC, ESC ESC ESC ESC to exit any open menus before SMBing and bolusing 2 units
May 21 06:56:54 MealsDevTBD pump-loop.log Checking pump status (suspended/bolusing): {"status":"normal","bolusing":true,"suspended":false}
May 21 06:56:54 MealsDevTBD pump-loop.log jq: error: Could not open file monitor/edison-battery.json: No such file or directory
May 21 06:57:13 MealsDevTBD pump-loop.log Settings less than 15 minutes old. Refreshing pumphistory because: enacted, bolused, Pump profile refreshed; Settings refreshed; 
May 21 06:57:13 MealsDevTBD pump-loop.log {"status":"normal","bolusing":true,"suspended":false}
May 21 06:57:13 MealsDevTBD pump-loop.log Your instance of oref0 [0.7.0, dev] is out-of-date by 10 commits: you may want to consider updating.

@dcacklam
Copy link
Contributor Author

dcacklam commented May 21, 2021 via email

@Foxy7
Copy link
Contributor

Foxy7 commented May 24, 2021

Just to confirm, our set up for breakfast time fits both conditions 1) and 2).

Whilst i've not physically observed condition 3) doesn't mean it hasn't happened and might explain why sometimes my count of insulin logged in Nightscout for Total Daily Dose doesn't match that from the pump history.

Our 722 also has v2.4, not sure about the other digits. will double check those.

I'd expect the "temp refreshed" part of the loop to check what tbr is being run on the pump and for that to show as different/mismatch to the previous enact command.

Infrequently we get an issue like this one today, where despite an updated tbr being set, the pumphistory command doesn't pull the right value.

Looking at the logs we get an issue like this about once a day "reason": "Warning: currenttemp rate 1.45 != lastTemp rate 6.4 from pumphistory; canceling temp",

Do you think these two issues could be related?

May 24 06:54:51 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":21,"temp":"absolute","rate":0.7}
May 24 06:54:53 MealsDevTBD pump-loop.log enact/smb-enacted.json: "Rate: 6.4 Duration: 30"
May 24 06:54:54 MealsDevTBD pump-loop.log Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
May 24 06:54:56 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":30,"temp":"absolute","rate":6.4}
May 24 06:54:56 MealsDevTBD pump-loop.log 2021-05-24T05:54:48.374Z
May 24 06:54:56 MealsDevTBD pump-loop.log Checking deliverAt: 2021-05-24T05:54:48.374Z is within 1m of current time: Mon May 24 06:54:56 BST 2021
.
.
.
May 24 07:04:41 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":21,"temp":"absolute","rate":6.4}
May 24 07:04:43 MealsDevTBD pump-loop.log enact/smb-enacted.json: "Rate: 1.49 Duration: 30"
May 24 07:04:44 MealsDevTBD pump-loop.log Checking pump status (suspended/bolusing): {"status":"normal","bolusing":false,"suspended":false}
May 24 07:04:46 MealsDevTBD pump-loop.log Temp refreshed: monitor/temp_basal.json: {"duration":30,"temp":"absolute","rate":1.45}
.
.
.
May 24 07:06:40 MealsDevTBD pump-loop.log currenttemp: { duration: 30, temp: 'absolute', rate: 1.45 } lastTempAge: 11 m tempModulus: 11 m
May 24 07:06:40 MealsDevTBD pump-loop.log 
{
  "temp": "absolute",
  "deliverAt": "2021-05-24T06:06:40.092Z",
  "reason": "Warning: currenttemp rate 1.45 != lastTemp rate 6.4 from pumphistory; canceling temp",
  "duration": 0,
  "rate": 0
}
May 24 07:06:40 MealsDevTBD pump-loop.log Pumphistory/temp mismatch: retrying

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

No branches or pull requests

3 participants