Giter VIP home page Giter VIP logo

freeaps's Introduction

FreeAPS X

FreeAPS X - an artificial pancreas system for iOS based on OpenAPS Reference algorithms

FreeAPS X uses original JavaScript files of oref0 and provides a user interface (UI) to control and set up the system

Documentation

Overview & Onboarding Tips on Loop&Learn

OpenAPS documentation

Smartphone requirements

  • All iPhones which support iOS 15 and up.

Supported pumps

To control an insulin pump FreeAPS X uses modified rileylink_ios library, thus supporting the same pump list:

  • Medtronic 515 or 715 (any firmware)
  • Medtronic 522 or 722 (any firmware)
  • Medtronic 523 or 723 (firmware 2.4 or lower)
  • Medtronic Worldwide Veo 554 or 754 (firmware 2.6A or lower)
  • Medtronic Canadian/Australian Veo 554 or 754 (firmware 2.7A or lower)
  • Omnipod "Eros" pods

To control an insulin you need to have a RileyLink, OrangeLink, Pickle, GNARL, Emalink, DiaLink or similar device

Current state of FreeAPS X

FreeAPS X is in an active development state and changes frequently.

You can find a description of versions on the releases page.

Stable versions

A stable version means that it has been tested for a long time and does not contain critical bugs. We consider it ready for everyday use.

Stable version numbers end in .0.

Beta versions

Beta versions are the first to introduce new functionality. They are designed to test and identify issues and bugs.

Beta versions are fairly stable, but may contain occasional bugs.

Beta numbers end with a number greater than 0.

Contribution

Pull requests are accepted on the dev branch.

Bug reports and feature requests are accepted on the Issues page.

Implemented

  • All base functions of oref0
  • All base functions of oref1 (SMB, UAM and others)
  • Autotune
  • Autosens
  • Nightscout BG data source as a CGM (Online)
  • Applications that mimic Nightscout as a CGM (apps like Spike and Diabox) (Offline)
  • xDrip4iOS data source as a CGM via shared app gpoup (Offline)
  • GlucoseDirectApp data source as a CGM via shared app gpoup (Offline)
  • Libre 1 transmitters and Libre 2 direct as a CGM
  • Simple glucose simulator
  • System state upload to Nightscout
  • Remote carbs enter and temporary targets through Nightscout
  • Remote bolusing and insulin pump control
  • Dexcom offline support (beta)
  • Detailed oref preferences description inside the app (beta)
  • User notifications of the system and connected devices state (beta)
  • Apple Watch app (beta)
  • Enlite support (beta)
  • Apple Health support for blood glucose (beta)

Not implemented (plans for future)

  • Open loop mode
  • Profile upload to Nightscout
  • Home screen widget
  • Apple Health support for carbs and insulin

Community

freeaps's People

Contributors

dobbywankenoby avatar itsmojo avatar ivalkou avatar jchenley avatar jon-b-m avatar marionbarker avatar mountrcg avatar paulplant avatar pavlobasiuk avatar purplenoodlesoop avatar sethgagnon avatar trixing avatar zubernuker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeaps's Issues

No Alarm when Reservoir empty

Hey Im on 0.2.2 and just realized my reservoir was empty and no Insulin left. I got not alarm or anything and already reached a bg of 346.

Asking for an in advance notification about reservoir reaching a certain threshold and an alarm when reservoir is empty.

FPU feature request

I reckon this is an opportunity to include built in FPU calculator within freeAPS - X for fat and protein

Feature Request: Restore Defaults for Preferences

This request to have a button to restore all preferences to default is passed on by someone who did a lot of modifications to preferences while playing around with the simulator.

I guess the short term answer is to completely delete the app from the phone when switching from simulator to a real pump. Does it make sense to have a restore preferences to default button followed by confirm button?

Another suggestion from this person was to reorganize the OpenAPS preferences by initial vs advanced. This might help a new user see the elements they are most like to modify first. I wonder if it make sense to group items that are typically left at default / changed only once (like insulin curve, bolus increment) to a rarely changed section, with the ones folks are most likely to adjust while becoming familiar with the algorithm near the top.

mg/dL unit issues

Even if you choose mg/dL under Glucose units within Configuration-> Preferences , mmol/L are still used in the follow places:

  • Main graph
  • Target Ranges (under Configuration)
  • Insulin sensitivities (under Configuration)

This bug is in the 0.1.6 release.

Bolus status reports in FreeAPS X

FreeAPS is using rileylink_ios for pump comms right? I believe the code for determination of whether or not boluses are successfully delivered is included in this code. In the case of iOS Loop, there are reports if a bolus is certain, uncertain or failed in the insulin delivery event history. Getting similar reports in FreeAPS X would be nice.

Thanks!

Relevant localizable strings (certain / uncertain):
https://github.com/ps2/rileylink_ios/blob/carthage-pin/OmniKit/en.lproj/Localizable.strings

Pod suspended (unexpected)

I've noticed on the FreeAPS X main screen that suddenly the Pod was suspended. The error message was "Pod non responding" I've checked the Pod status which actually was responsive. I had to manually suspend and unsuspend the Pod in order to make it work again.
Screen shots and log file are attached.

log 3.txt

IMG_3661
IMG_3662
IMG_3663
IMG_3664
IMG_3665

Incorporate RL Comp Dev Updates

Incorporate RileyLink Compatible Device Updates

This brings in rileylink compatible device communication updates from ps2/rileylink_ios used for Loop v2.2.6 and FreeAPS v2.2 (202).
In addition, this adds the patch for improvements to EmaLink and OrangeLink Pro displays.

Comments

Start with a fresh download from dev.

Note - this worked on Oct 24, 2021 (dev branch commit 1ccbe74)
If changes have dropped in dev since then, don't try this without checking first.
I will attempt to keep up with changes to dev and I am coordinating with Joe Moran.

I am creating this as an issue so it's available for testing before I create a PR.
I have no way of testing with a medtronic pump.

  • I did my best pattern matching update with the patch v02 below but I HAVE NOT TESTED either patch through the Medtronic selection to get to the RileyLink Display

NOTE: I think v02 is the correct patch to use. v01 will not give battery alerts for Medtronic users.

I have tested the RileyLink Compatible Devices listed below, but I'm not using FreeAPS-X and would like someone who is using it to do the live testing.

  • I tested both patch v01 and v02 through the Pod selection to get to the RileyLink Display

The changes I made parallel the changes made in Loop v2.2.6 and FreeAPS v2.2 (202) - suitably modified for the current code found in Dependencies/rileylink_ios in ivalkou/freeaps dev branch.

One new file was added. Patch v01 modifies 20 files, whereas v02 modifies 23 files.

I have tested the following RileyLink Compatible Devices:

  • Standard RileyLink with RL firmware
  • EmaLink Firmware applied to Standard RileyLink hardware
  • OrangeLink Pro
  • EmaLink Standard model

Directions:

The "code" boxes include a copy button if you hover your mouse in the upper right of the box.

  1. Fresh Clone
git clone --branch=dev  --recurse-submodules https://github.com/ivalkou/freeaps
cd freeaps
xed .
  1. Test the Build - make sure it works
    Note - at this point, Ema and Orange displays look just like old-style Riley
  2. Unplug your phone and Quit Xcode
  3. Remove DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData
  1. Download the patch - by clicking on the line below, it will download to your ~/Downloads folder (try v02 first, if that fails, v01 is found at the end of this comment.)
  1. Apply the patch
git apply ~/Downloads/fapsx_patch_ema_orange_v02.txt

Note - there was some whitespace differences, expect to see this message:

../patch/fapsx_patch_ema_orange_v01.txt:226: trailing whitespace.

../patch/fapsx_patch_ema_orange_v01.txt:239: trailing whitespace.

../patch/fapsx_patch_ema_orange_v01.txt:291: trailing whitespace.

../patch/fapsx_patch_ema_orange_v01.txt:298: trailing whitespace.

../patch/fapsx_patch_ema_orange_v01.txt:311: trailing whitespace.

warning: squelched 58 whitespace errors
warning: 63 lines add whitespace errors.
  1. Restart Xcode
xed .

Note - Ignore immediate error - it will go away, let indexing complete.

  1. Build FreeAPSX

OrangeLink and EmaLink have new rows in their display.
If you have an OrangeLink Pro, the Find Device will be present.
If you have an EmaLink, the battery will display.
I believe the communication with OL and Ema will be improved with the modifications added in v2.2.6
Refer to LoopDocs
and the Ema/Orange patch for v2.2.6

If v02 does not work - here's the patch without the Minimed changes.

These 3 extra files are modified to add a battery alert notification through the Minimed code for the v02 patch and are not modified in the v01 patch.
Sending notifications through Omnipod and Medtronic separately is noted as a HACK in Loop v2.2.6 and was inserted into freeaps.

  • Dependencies/rileylink_ios/MinimedKit/PumpManager/MinimedPumpManager.swift
  • Dependencies/rileylink_ios/MinimedKit/PumpManager/MinimedPumpManagerState.swift
  • Dependencies/rileylink_ios/MinimedKitUI/MinimedPumpSettingsViewController.swift

Feature request: enable display of expiration date (and alerts) for provisioning profile inside of FreeAPS X

There is a provisioning profile generated by Xcode/Apple Developer, and that lasts for one year. This decide when the app expires. But users typically don't know when this is, amd itbis NOT 1 year from build date, nor is it related to Dev account expiry date.

In Loop 2.2.6 and FreeAPS (LnL release build 202) you can see the provisioning profile expiration date in the Loop Issue report, and there are also alerts to warn as the date approaches.

This is the commit for Loop adding the expiration date to Issue report:
LoopKit/Loop@a29859c

Such a feature would make FreeAPS X support easier in the long run.

Here is some info for other users about how to find the expiration date in Xcode:

https://www.loopandlearn.org/loop-expiration-date/

Enact Temp Target with repetition

We suggest creating an alternative to establish daily repetition in the creation of Enact Temp Target. In this way, the definition Eating Soon and others could be created and always repeated on certain days and times.

When No Nightscout as a CGM is present

Recalling the suggestion previously presented for activating the app: xDrip4iO5 when same App Group is being used. Adjust in the openCGM () function and definition as follows:

ApplicationQueriesSchemes

FreeAPS X and IOS 15.x ( latest public beta )

Not sure how to provide information on this, but at present ( latest public beta of IOS 15.x ), the app starts up and looks fine, but if you go into Settings, other then flipping 'Closed Loop' off / on, none of the submenus do anything ...

I loaded the exact same build onto a separate 14.x iPhone, and it works as expected.

I am planning on switching to FreeAPS X on Saturday ( next pump ) using my old phone, but Loop is working fine on 15.x, including the setup sub-menus.

Happy to provide more information if folks want to tell me how ... ? Willing to do a zoom / screen share with someone who knows what they are doing to gather more info also ...

Very lengthy loop calculations while "Setting minimum Insulin Peak Time"

I mistakenly had the following configuration:
curve=rapid-acting
usecustompeaktime=true
insulinPeakTime=45
The later is below the minimum insulinPeakTime of Orefs rapid-acting curve.
FAX raises the following:
2021-11-02 19:44:15.900073+0100 FreeAPS[826:128377] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: Setting minimum Insulin Peak Time of 50m for,rapid-acting,insulin every 5 ms from
2021-11-02 19:44:03.263990+0100 until 2021-11-02 19:44:15.979159+0100 delaying every loop calculation considerably

The battery consumption of the iPhone has increased considerably.

Hello,
Since 0.2.0 / master the battery consumption of my IPhone 12 Pro Max has increased significantly, sc about 30%. There are also more errors (red loop) when I use Spike via the internal server. If I get the data from Nightscout, it's better. I didn't have the problems with 0.1.23. I've been using FreeAPX for a few days. Had tested it with a virtual pump for a few days beforehand. Before that, I had FreeAPS. Use the 722 and OrangeLink.

Content Openaps Pill - mg/dl vs mmol

My FreeAPSX unit setting is mmol.

When pill shows only 1 timeframe it always showsBG in mg/dl
When pill shows 2 timeframes it shows old in mg/dl and new in mmol.

Please show BG always
Snag_19ccc087
in units that are chosen in settings

Feature Request: OpenAPS Advanced Meal Assist (AMA)

I am not sure if this is implemented already, but it would be a could stepping stone for those who are using oref0 and a preparing to move to oref1.
https://newer-docs.readthedocs.io/en/latest/docs/walkthrough/phase-4/advanced-features.html#advanced-meal-assist-or-ama

https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html#advanced-meal-assist-ama

Again, perhaps this is implemented already as is now just considered part of the main oref0.

Weblate translation

I have some medical field translation experience, and I really don't want to see libre software subjected
to the kinds of results it produces either.
Happy to help.

SMB increments for omnipod should be 0.05

My son has low basal rate of 0.2 U/hr. He uses Omnipod.

SMB minutes value of:
30 minutes -> 0.10 U
45 minutes -> 0.15 U
60 minutes -> 0.20 U

However, in freeAPS X if you set it to 45 minutes the SMB are rounded to 0.20 units. Possibly because openaps never supported omnipod?

IOB is not displayed without CGM data

IOB is not displayed without CGM data. This is different from other implementations of oref1 (AAPS, and also OpenAPS?), and might be a bug in FreeAPS X?

IOB should be independent of CGM data, and being able to see IOB during sensor warmup is important.

There is a short discussion on the topic here:
https://t.me/freeapsx_eng/7791

Feature request: Save button for general preferences

All menues under Configuration has a save/save to pump button except the Preferences menu.
I often find myself accidentally toggling a setting while scrolling in the menu mask and sometimes that makes me feel insecure about what the setting was before scrolling.

FreeapsX app crashes on swap from Medtronic pump to Omnipod pod

On trying to swap out from MDT pump to Omnipod pod, FreeapsX app crashes at the point of Omnipod insertion. With assistance from Marion Barker and eventually from Joe Moran, it was determined that basal rates that work fine in FreeapsX, in this case 0.925 u/hr basal rate, causes app crash on omnipod insertion if mdt pump is deleted and Omnipod type pump is added. Once Basal rate was changed to be divisible by 0.05 (in this case 0.9) a switch to omnipod could be successfully made. This was tested where the basal rate was changed and also, as an additional precaution, bolus increment was also changed to 0.05 (not 0.025) and the successful switch was accomplished. Unknown at this time if both changes are needed for success. See the documentation attached. Full credit to Marion and Joe for figuring this one out!

20210625_log_prev.txt
20210626_log.txt
podState_Jennifer_Crawford_20210625_1.xlsx
podState_Jennifer_Crawford_20210625_1.csv
podState_Jennifer_Crawford_20210626_1.xlsx
podState_Jennifer_Crawford_20210626_1.csv
Test_Prior_to_Posting_Issue_Report_FAPSX_BasalRate.txt

Feature Request: Bolus Wizard for Meals

For meals, a manual upfront bolus is needed that is neither too small, nor too large. This requires some simple arithmetic that is challenging for children. The current bolus recommended equals some fraction of InsulinReq, but this seems consistently too small for typical meals (30g-60g).

It would be desirable to have a Bolus Wizard similar to AndroidAPS or Loop, e.g.
https://androidaps.readthedocs.io/en/latest/Getting-Started/Screenshots.html

that allows the user to make a reasonable choice and shows the OpenAPS prediction lines.

Feature Request: NS SMB transmission

Would it be possible to to feed NS the SMB's instead of:

{
    "_id" : ObjectId("6178dda5cb510d6a1d76e776"),
    "duration" : 0,
    "bolus" : {
        "_type" : "Bolus",
        "id" : "a4fa258b4911bf47439ef17078d447ef",
        "timestamp" : "2021-10-27T05:03:31.360Z",
        "amount" : 0.25,
        "duration" : 0
    },
    "insulin" : 0.25,
    "eventType" : "Bolus",
    "enteredBy" : "freeaps-x",
    "created_at" : "2021-10-27T05:03:31.360Z",
    "utcOffset" : 0
}

so that they are identified as SMB in this format:

{
    "_id" : ObjectId("61754bd4f706c00004b3be1c"),
    "eventType" : "Correction Bolus",
    "insulin" : 0.75,
    "created_at" : "2021-10-23T21:38:24Z",
    "date" : 1635025104068.0,
    "isSMB" : true,
    "pumpId" : 2021102323382440.0,
    "NSCLIENT_ID" : "1635025135592"
}

IOB curve isn't displayed correctly in NS day to day reports

The IOB curve isn't displayed correctly in NS day to day reports.

Version 0.1.23 RC

20210514_082109

The transition from Loop to FreeAPS X is at around 16.00 on the 12th. It is marked by a profile switch.

With Loop, the IOB trace is as expected. With FAPSX there is nothing the first hours, then next day just a gradually increasing linear slope.

I have disabled display of basal and COB here to make IOB more prominent.

IOB from FAPSX is displayed correctly in the main view of Nightscout.

It is correctly displayed in reports for AAPS users, so not an issue with oref.

Decimal error when editing entry

When editing a bolus entry, deleting the number following decimal point also deletes the decimal.

Example: initial entry
1.6
But desired entry is 1.2 u.

If you tap delete then 2, entry is 12 because both the 6 and decimal point are deleted with a single tap of delete key.

Adding Carbs with stale BG's

Upon entering carbs having a stale BG source FreeAPS keeps waiting/idling at the recommendation screen. One can close that screen and the carbs are added. One could also add a bolus afterwards and even get a recommendation. However if not closing the recommendation screen after entering the carbs it would keep on "turning the wheel".

Split "Initial" by "Advanced" preferences and add config descriptions

Especially for who is starting with FreeAPS X, it would be great to split the Initial by Advanced preferences, as described in LoopAndLearn

In addition, it would be great to add an "i" info icon for each setting with short description and default/recommended value. This is not to replace the wiki, but it would be a great quick reminder in case the settings are reviewed after a while.

I have added a short video on youtube with menu and description from Loop Dev (tidepool merged version) which I consider very useful and might be an inspiration for FreeAPS X too
https://youtu.be/efZ8aUz9_i0

Feature Request: Report Current Bolus Size / Notify Bolus Exceeds Limits

This request has three parts:

  1. For any bolus, it would be nice to have the bolus icon report the size of the bolus currently in process.

  2. If a requested manual bolus exceeds the Delivery Limits: Max Bolus amount, FreeAPS X (can we use FAX for short?) properly reduces the bolus command sent to the pump to the max bolus amount but does not notify user of this fact.

  3. There is come confusion among new FreeAPS X users as to whether maxIOB includes manual boluses. Empirically it does not. The question is - should maxIOB be used to limit manual boluses and if so, would there need to be two values - one to limit temp basal/SMB values and a different one for true maxIOB from manual bolus as well as the automatic features.

ISSUE: Unusual expiration reminder date for pod when changing pod early

Hi, I just changed a pod early, after about 2 days and some hours.

After priming, in the screen with the expiration reminder, the pre-filled Expiration Reminder looks to have carried over the value from the previous pod ("tomorrow at 10:16"). That should probably update to a time closer to 3 days, probably in line with what's shown on the selector below.
See photo.

image

The selector shows a expiration reminder 48 hours from pod activation (June 10, 16:42).

TempBasal during Omnipod change

on 0.1.19 I noticed that the tempbasal scheduled to run during the pod change will run to its end, even after the screaming starts.

5C6BCAFC-6C0A-486A-AEE8-C0DF1A9B96EA
0869CBFE-AC39-42D8-9BAA-FE0E75A75F80

NS interface - Carb deletion

A deletion of a duplicate carb entry in NS will not replicate into FreeAPS X. Here in NS I deleted a 26g carb entry.
Bildschirmfoto 2021-04-02 um 11 41 53
in FreeAPS X the carb entry remains, also after deleting NS and reconfiguring it in settings. App restart in between.
D154406C-8AD1-4A33-9BB1-A783CB534D25_1_105_c

Bug Report: Uncertain Manual Bolus was not Resolved

An uncertain manual bolus was not resolved by FreeAPS X:

  • The pod did not get the request and no bolus was given
  • The log.txt file reported it as an uncertain bolus
  • The bolus was reported as having been delivered in IOB (the "safe" choice)

This was reported to Marion Barker by the user, Sara Goya. Marion and Joe have looked at the pod messages exchanged during this time period and the log.txt messages.

The suggestion is that the pod message exchange optimization be disabled. This optimization is enabled by default in the rileylink_ios code (used by release/v0.2.0 and earlier). Disabling this optimization will reduce the likelihood of having an uncertain bolus.

The instructions for disabling the optimization are provided at the following link:
https://www.loopandlearn.org/freeaps-x#custom

Note:

  • The log file and parsed pod message exchanges have been captured and analyzed
  • A report will be prepared and dropped into this conversation later
  • The optimization should be turned off by the users at their earliest convenience to minimize uncertain bolus situations

Feature Request: Editing carbs like Loop

This is not critical at the moment, but it would be desirable to have in a future release. Low priority IMO compared to offline support of G6 with firefly transmitter or bolus cancellation.

In the spirit of Loop's UI, it would be desirable to be able to edit and modify the amount of carbs. Currently one can only delete the carbs.

NS Feature Request: pump -> reservoir

Am working on extending LoopFollow to be APS aware, and notice that in NS, Loop data includes amount remaining in reservoir, among other things:

Screen Shot 2021-07-31 at 23 27 33

Not so interest in all of the extra, but making reservoir remaining to NS would be nice, all we have now seems to be:

Screen Shot 2021-07-31 at 23 28 33

LoopFollow right now is only looking for Battery and Reservoir ... rest is ignored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.