Skip to content

Instantly share code, notes, and snippets.


Scott Leibrand scottleibrand

View GitHub Profile
scottleibrand / master patch test
Last active May 10, 2021 — forked from danamlewis/master patch test
Clearer instructions for 0.6.3 patch fixes
View master patch test

1. Run an edited bootstrap

(Assuming you already have flashed jubilinux recently) Copy and paste this bootstrap script instead of the current one in the docs:

dmesg -D
echo Scanning for wifi networks:
scottleibrand / pumpprofile-1u-50-10.json
Created Aug 13, 2018
Generic autotune pumpprofile.json
View pumpprofile-1u-50-10.json
"carb_ratios": {
"schedule": [
"x": 0,
"i": 0,
"offset": 0,
"ratio": 10,
"r": 10,
"start": "00:00:00"
scottleibrand / advanced-meal-assist.json
Created Mar 23, 2016
Example of openaps devices, reports, and aliases you'll need to modify to run the advanced-meal-assist branch of oref0.
View advanced-meal-assist.json
"extra": {
"fields": "pumphistory profile clock carbs glucose basal",
"cmd": "oref0",
"args": "meal"
"type": "device",
"name": "meal",
"meal": {
cd && test -d src/oref0 && cd src/oref0 && git pull && git checkout dev && git pull
npm install && sudo npm install -g && sudo npm link && sudo npm link oref0
openaps device add meal process --require "pumphistory profile clock" oref0 meal
openaps device remove get-profile
openaps device add get-profile process --require "settings bg_targets isf basal_profile max_iob carb_ratios" oref0 get-profile
openaps device remove determine-basal
openaps device add determine-basal process --require "iob temp_basal glucose profile offline meal" oref0 determine-basal
openaps report add monitor/meal.json text meal shell monitor/pumphistory-zoned.json settings/profile.json monitor/clock-zoned.json
openaps report remove settings/carb_ratios.json
openaps report add settings/carb_ratios.json JSON pump read_carb_ratios

#Proposed oref0 Meal Assist algorithm

Currently the oref0 OpenAPS implementation is designed to completely ignore carbs, on the assumption that carb entry will not be reliable, either in frequency or accuracy. However, when carb information is available from Bolus Wizard entries or from Nightscout, it seems we can do better than that, by using carb information as just one signal to decide whether it's safe to high-temp when the oref0 bolus snooze algorithm would otherwise choose to do nothing (and require the user to manually administer the remainder of their meal bolus as needed.

Below are some design goals and a proposed algorithm that should accomplish this. Feedback welcome!

#Design goals:

  • Assist with partial meal boluses if user enters carb amount
  • High-temp early but safely while BG is still rising
  • Do not require any assumptions about carb absorption profile
scottleibrand / gist:da84b4bf799592d19214
Created Oct 18, 2015
required non-zero non-null fields in output of decocare commands
View gist:da84b4bf799592d19214
read_bg_targets: units, targets: { high, low }
read_carb_ratios: units: "grams", schedule: { ratio }
read_insulin_sensitivies: action_type, sensitivities: { sensitivity }
read_selected_basal_profile: { rate }
read_settings: maxBasal, insulin_action_curve
read_temp_basal: temp
View iob-cob.diff
diff --git a/env.js b/env.js
index c063c22..9e2c0eb 100644
--- a/env.js
+++ b/env.js
@@ -43,6 +43,7 @@ function config ( ) {
env.treatments_collection = readENV('MONGO_TREATMENTS_COLLECTION', 'treatments');
env.profile_collection = readENV('MONGO_PROFILE_COLLECTION', 'profile');
env.devicestatus_collection = readENV('MONGO_DEVICESTATUS_COLLECTION', 'devicestatus');
+ env.pumphistory_collection = readENV('MONGO_PUMPHISTORY_COLLECTION', 'pump');
git clone -b bewest/dev
git clone
git clone
(cd decoding-carelink
sudo python develop
View latest.json
"date": 1416967408000.0,
"timestamp": "2014-11-25T18:03:28",
"_type": "TempBasalDuration",
"duration (min)": 0,
"_description": "TempBasalDuration 2014-11-25T18:03:28 head[2], body[0] op[0x16]"
"_type": "BasalProfileStart",
find records since 2014-11-28T15:58:01
response: ReadHistoryData:size[1024]:[page][0]:data[1024]:
0000   0x07 0x00 0x00 0x07 0x5e 0xba 0x8e 0x00    ....^...
0008   0x00 0x00 0x6e 0xba 0x8e 0x05 0x00 0x00    ..n.....
0010   0x00 0x00 0x00 0x00 0x00 0x07 0x5e 0x03    ......^.
0018   0x8a 0x30 0x03 0xd4 0x34 0x00 0x00 0x00    .0..4...
0020   0x00 0x00 0x00 0x00 0x00 0x03 0xd4 0x00    ........