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

Fix decoding of carb ratios >25 #28

Merged
merged 3 commits into from
Jul 11, 2017

Conversation

moomoobloo
Copy link
Contributor

Fix for #27.

I've been using this for a while with a 523, but this should be tested with different pumps.

@Kdisimone
Copy link

I can help test it out! Thanks

@Kdisimone
Copy link

Kdisimone commented Jul 10, 2017

Tried it on my 523, worked great

Tried on my 522, worked great

root@jubilinux:~/myopenaps# cat settings/carb_ratios.json
{
  "units": "grams", 
  "raw": "0x01 0x00 0x1d 0x04 0x1f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00", 
  "first": 1, 
  "schedule": [
    {
      "start": "00:00:00", 
      "r": 29, 
      "ratio": 29, 
      "offset": 0, 
      "i": 0, 
      "x": 0
    }, 
    {
      "start": "02:00:00", 
      "r": 31, 
      "ratio": 31, 
      "offset": 120, 
      "i": 4, 
      "x": 1
    }
  ]

@Kdisimone
Copy link

And 723 is working fine too

root@jubilinux:~/myopenaps# cat settings/carb_ratios.json
{
  "units": "grams", 
  "first": 1, 
  "schedule": [
    {
      "i": 0, 
      "start": "00:00:00", 
      "offset": 0, 
      "ratio": 89.0, 
      "x": 0
    }, 
    {
      "i": 7, 
      "start": "03:30:00", 
      "offset": 210, 
      "ratio": 31.0, 
      "x": 1
    }
  ]

@Kdisimone
Copy link

I have no other models to test however.

@Kdisimone
Copy link

Addendum...looping on 723 has a little hiccup. Hasn't been running for more than 30min though so I'll see if it persists.

Temp refreshed
Temp duration 27m or more
glucose.json newer than pumphistory: Refreshed pumphistory
{"carbs":0,"mealCOB":0,"reason":"Could not parse input data"}
{"iob":0,"activity":0,"bolussnooze":0,"basaliob":0,"netbasalinsulin":0,"hightempinsulin":0,"microBolusInsulin":0,"microBolusIOB":0,"time":"2017-07-10T00:44:03.000Z","lastBolusTime":0}
{"delta":0,"glucose":105,"short_avgdelta":-0.11,"long_avgdelta":-0.7}
{"duration":27,"rate":0.8,"temp":"absolute"}
Basal unchanged: 0.85; target_bg unchanged: 110; sens unchanged: 267 (autosens ratio 1)

@Kdisimone
Copy link

Unfortunately that "could not parse data" still exists on 723

@PieterGit
Copy link

PieterGit commented Jul 10, 2017

@Kdisimone could you test the json files to see what json file cannot be parsed
See: https://github.com/openaps/oref0/blob/dev/bin/oref0-meal.js#L45-L54
It can be pumphistory, profile_data , clock_data or basalprofile_data
AFAICT the settings/carb_ratios.json is fine, and the Could not parse input data is another issue we should tackle. Can you dig down to it, and if it's a different issue, please file a separate oref0 issue for it.

@scottleibrand
Copy link
Contributor

The "could not parse data" issue is a regression I accidentally introduced in oref0 for non-SMB users. The fix for that is going to be openaps/oref0#537

Since that is unrelated to the decocare fix, and everything looks good there, I'm going to merge this to decocare dev.

@Kdisimone
Copy link

resolved with the update to oref0-pump-loop

{"carbs":0,"boluses":0,"mealCOB":0,"currentDeviation":0,"maxDeviation":4,"minDeviationSlope":-0.635}
{"iob":0.494,"activity":0.0098,"bolussnooze":0,"basaliob":-0.05,"netbasalinsulin":-0.05,"hightempinsulin":0,"microBolusInsulin":0,"microBolusIOB":0,"time":"2017-07-11T02:31:43.000Z","lastBolusTime":1499732958000}

@moomoobloo moomoobloo deleted the wip/fix-high-carb-ratio branch July 12, 2017 04:26
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

Successfully merging this pull request may close these issues.

4 participants