Sample setup: Samsung S7, DanaR, Dexcom G5 and Sony Smartwatch¶
In this setup, the Samsung Galaxy S7 smartphone is used as control center of the loop. The slightly modified Dexcom App reads glucose values from the Dexcom G5 CGM. AndroidAPS is used to control the Dana R insulin pump from Korean manufacturer SOOIL via bluetooth. Further devices are not required.
As the Dexcom App only offers limited alarm options the open source app xDrip+ is used to define not only high and low alarms but also additional alarms according to individual requirements.
Optionally an Android wear smartwatch can be used (in this sample setup the Sony Smartwatch 3 (SWR50)) to display glucose and AndroidAPS values on your wrist. The watch can even be used to control AndroidAPS (i.e. discreetly set a meal bolus).
The system works offline. This means there is no need for a data connection from the smartphone to the Internet for operation.
Nevertheless, the data is automatically uploaded to Nightscout “in the cloud” when a data connection is established. By doing so you can provide comprehensive reports for the doctor’s visit or share the current values with family members at any time. It is also possible to send data to Nightscout only when using a (predefined) Wi-Fi connection in order to profit from the different Nightscout reports.
- Samsung Galaxy S7
- Alternatives: see list of tested phones and watches for AndroidAPS
- DanaR or Dana RS insulin pump
- Alternatives: see list of possible BG sources
- Optional: Sony Smartwatch 3 (SWR50)
- Alternatives: see list of tested phones and watches for AndroidAPS (OS must be Android Wear)
To be able to create an Android app from the freely available AAPS open source code you need Android Studio on your computer or notebook (Windows, Mac, Linux). A detailed instruction can be found at building the APK.
Please be patient when installing Android Studio as the software downloads a lot of additional data once installed on your computer.
Check smartphone firmware¶
- Menu > Settings > Phone info > Software info: At least “Android-Version 7.0” (successfully tested up to Android version 8.0.0 Oreo - Samsung Experience Version 9.0)
- For firmware update: menu > Preferences > software update
Allow installation from unknown sources¶
Menu > Settings > Device security > Unknown sources > slider to right side (= active)
For security reasons this setting should be set back to inactive once the installation of all apps described here has been completed.
- Menu > Settings > Connections > Bluetooth > slider to right side (= active)
- Menu > Settings > Connections > Location > slider to right side (= active)
Location services (“GPS”) must be activated in order for Bluetooth to work properly.
Install Dexcom App (modified version)¶
The original Dexcom app from the Google Play Store will not work because it does not broadcast the values to other apps. Therefore, a version slightly modified by the community is required. Only this modified Dexcom app can communicate with AAPS. Additionally the modified Dexcom App can be used with all Android smartphones not only the ones in Dexcom’s compatibility list. A mmol/l version and a mg/dl version of the modified Dexcom app are available at https://github.com/dexcomapp/dexcomapp?files=1.
To do this perform the following steps on your smartphone:
- If the original Dexcom app is already installed:
- Stop sensor
- Uninstall app via Menu > Settings > Apps > Dexcom G5 Mobile > Uninstall
- Download modified Dexcom app (check unit mg/dl or mmol/l according to your needs): https://github.com/dexcomapp/dexcomapp?files=1
- Install modified Dexcom app on your smartphone (= select the downloaded APK file)
- Start modified Dexcom app, activate/calibrate the sensor according to the given instructions and wait until the warm-up phase is finished.
- Once the first two calibrations have been entered successfully and the modified Dexcom app shows actual glucose value setup the warnings (hamburger menu on top left side of the screen) as follows:
- Urgent low
3.1mmol/l(cannot be disabled)
- Rise rate
- Fall rate
- Signal loss
- Urgent low
- Follow the instructions to build the APK
- Transfer the generated APK to your phone
- Configure AndroidAPS according to your needs using the setup assistant or manually
- In this sample setup we used (among others)
- BG source:
Dexcom G5 App (patched)– click cock-wheel and activate
Upload BG data to NSand
Send BG data to xDrip+(see BG source)
xDrip+ is another mature open source app that offers countless possibilities. In this setup, contrary to what the developers first wrote the app for, xDrip+ is not used to collect glucose data from the Dexcom G5, but only to output alarms and to display the current glucose value including the curve on the Android home screen in the widget. With xDrip+ the alarms can be set much more individually than with the Dexcom software, AAPS or Nightscout (no limitation in the selection of sounds, different alarms depending on day/night time etc.).
- Download the latest stable APK version of xDrip+ with your smartphone https://xdrip-plus-updates.appspot.com/stable/xdrip-plus-latest.apk - not the version from the Google Play Store!
- Install xDrip+ by selecting the downloaded APK file.
- Start xDrip+ and make the following settings (hamburger menu at top left)
- Settings > Alarms and Alerts > Glucose Level Alert List > Create Alerts (high and low) according to your needs.
- The existing alarms can be changed with a long press on the alarm.
- Settings > Alarms and Alerts > Calibration Alerts: disabled (reminded via the modified Dexcom app)
- Settings > Hardware Data Source > 640G/EverSense
- Settings > Inter-app settings > Accept Calibrations >
- Menu > Start sensor (is only “pro forma” and has nothing to do with the running G5 sensor. This is necessary otherwise an error message will appear regularly.)
Example of an alarm setup¶
The “Urgent low alarm” (below 55 mg/dl resp. 3,1 mmol) is a standard alarm from the modified Dexcom app that cannot be disabled.
Tip for meetings / church visits / cinema etc..:
If “Do not disturb” mode is activated in the Samsung Galaxy S7 (Menu > Settings > Sounds and vibration > Do not disturb: slider to right side (= active)), the phone only vibrates during urgent low alarm and does not issue an acoustic warning. For the other alarms set up via xDrip+ you can select whether the silent mode should be ignored (acoustic sound played) or not.
Disable power saving option¶
On your Samsung Galaxy S7 go to Menu > Settings > Device Maintenance > Battery > Unmonitored Apps > + Add apps: Select the apps AndroidAPS, Dexcom G5 Mobile, xDrip+ and Android Wear (if smartwatch is used) one after the other
Optional: Setup Sony Smartwatch 3 (SWR50)¶
With an Android Wear smartwatch life with diabetes can be made even more inconspicuous. The watch can be used to display the current glucose level, the status of the loop etc. on the wrist. The watch can even be used to control AndroidAPS (i.e. discreetly set a meal bolus). To do this, double tap the CGM value of the AAPSv2 watchface. The SWR50 usually runs for a full day until the battery needs to be recharged (same charger as the Samsung Galaxy S7: microUSB).
Details about the information displayed on the watchface can be found here.
- Install the app “Android Wear” on your smartphone via the Google Play Store and connect the smartwatch according to the instructions there.
- In AAPS choose hamburger menu (top left corner) > Config Builder > General (at the bottom of the list) > Wear > activate on left side, click cock wheel > Wear settings and activate
Controls from Watch
- On your smartwatch: Long press display to change watchface and select
- If necessary restart both devices once.