Using Loop for offline OpenAPS
Loop is an iOS "app template for building an automated insulin delivery system". Included in Loop is xDripG5, which runs alongside the Dexcom iOS app and intercepts the BLE glucose messages for local use.
These instructions describe how to use Loop as a glucose data source for offline looping using OpenAPS. Note that most of the features of Loop itself (closed loop algorithm, insulin dosing) are not used in this modification; we are using Loop simply as a local bridge for glucose data from the G5 transmitter to the OpenAPS rig. If you have a working version of Loop already installed, it is recommended build this branch as a separate app by using a unique bundle identifier.
- Build (and deploy to your iPhone) a version of Loop using the
lookoutbranch from @thebookins. Follow the instructions in Loop Docs but install Loop as follows:
git clone https://github.com/thebookins/Loop.git git checkout lookout
(alternatively, merge the
lookout changes with your own Loop fork). Depending on the version of XCode you are using, it may be necessary to rebuild the linked frameworks using carthage:
carthage update --platform iOS
If you haven't already done so, install the dev branch of OpenAPS using the setup script with
xdripas the glucose source.
Step 2 will set up xDripAPS on your OpenAPS rig. This is a Python program that exposes a very simplified NightScout instance running on the rig to which we can send glucose data. A couple of changes to xDripAPS are required to get it to accept glucose data from Loop. Pull these changes as follows:
cd rm -r .xDripAPS git clone https://github.com/thebookins/xDripAPS.git $HOME/.xDripAPS cd .xDripAPS git checkout lookout
Setup up Bluetooth tethering between your iPhone and your OpenAPS rig.
Open Loop and the Dexcom app on your iPhone. The Dexcom app will control the G5 transmitter; Loop just listens in.
In Loop, select G5 Transmitter in Settings and enter the G5 Transmitter ID. Do not add the pump serial number as we are using Loop only as a local bridge to get BG data to OpenAPS. (Without a RileyLink, it's impossible to control the pump anyway.)
In Loop, select Nightscout in Settings and enter the local URL for your edison. This will be something like
http://172.20.10.3:5000. Enter your API secret.
All done. Loop will now send glucose data to the edison URL every five minutes, ready to be picked up by oref0.