Remote Control Overview
🚧 Documentation Under Construction 🚧
Remote Control Overview¶
LoopFollow remote commands are sent directly using the Apple Push Notification System (APNS) for all Open-Source Automated Insulin Delivery systems that support this feature. At this time, the Loop app and the open beta version of the Trio app (0.5.x or newer) support direct APNS from LoopFollow.
Loop
Remote Control with LoopFollow 3.2
With the release of LoopFollow 3.2, the remote control features accessible from LoopFollow match those available from the LoopCaregiver app.
You must update to LoopFollow 3.2 or newer and configure remote settings in the LoopFollow app to use these features.
Changes for LoopFollow Remote Control of the Loop App¶
- With LoopFollow 3.2 and newer
- Loop remote commands from LoopFollow include Meal, Bolus and Override control
- LoopFollow no longer requires the Nightscout site be configured with the APNS credentials
- Read access for the Nightscout URL is sufficient
- Loop remote commands from LoopFollow include Meal, Bolus and Override control
- With LoopFollow 3.1 and older
- Loop remote commands are limited to Overrides, require the Nightscout site be configured with the APNS credentials and require a token with
careportal
access
- Loop remote commands are limited to Overrides, require the Nightscout site be configured with the APNS credentials and require a token with
With Trio 0.2.x, LoopFollow only supports temp targets and requires a token with
careportal
access. Once updated to Trio 0.5.x or newer, the full Trio Remote Control options are available.
Remote Control Updates in Development
The instructions in this section depend on the version of the Trio app and the LoopFollow app.
- With LoopFollow 3.2 or newer:
- Remote commands are sent directly through APNS for both the Loop app and the Trio open beta version
- If you are using Trio 0.2.x, remote commands are routed via Nightscout and are limited to modifying
Temp Targets
- If you are using Trio 0.2.x, remote commands are routed via Nightscout and are limited to modifying
- Remote commands are sent directly through APNS for both the Loop app and the Trio open beta version
- With LoopFollow 3.1 and earlier:
- Using the Loop app:
- remote commands are routed via Nightscout
- Only Overrides can be modified using LoopFollow and only if Nightscout site has the APNS keys embedded
- Using the Trio app
- If you are using Trio 0.5.x or newer, remote commands are sent directly through APNS
- If you are using Trio 0.2.x, remote commands are routed via Nightscout
- Using the Loop app:
Using APNS directly from LoopFollow provides faster feedback about commanding.
With LoopFollow 3.2, APNS keys will not need to be embedded in the Nightscout site for remote control of the Loop app from LoopFollow, which may simplify configuration for those who use a paid service for Nightscout.
LoopFollow Remote Control¶
- LoopFollow Remote Control sends messages to the loopers phone using APNS
- Requires LoopFollow 3.2 or newer to use with the Loop app (version 3.x)
- Requires Trio 0.5 or newer for the Trio app
- Commands go via APNS to the Loop/Trio phone
- An immediate success or failure for sending the message to APNS is recieved
- There still could be a communication failure between APNS and the looper's phone or the command could be rejected by the looper's app
- The results show up in Nightscout after being uploaded from the Loop/Trio phone
- The results are plotted or displayed in LoopFollow after being downloaded from the Nightscout URL as a new treatment
- APNS keys do not need to be embedded in the Nightscout site
- This simplifies configuration of Nightscout, especially for those who use a paid service for Nightscout
- For those following a looper using Trio 0.2.x, the only option for the Remote Setting is Nightscout, which uses Careportal
- With this selection, the LoopFollow phone sends commands to Nightscout, which then sends commands to the Trio phone
- For that reason, the Nightscout display will be updated first
- If there is an issue sending the careportal request from Nightscout, it might not make it to the Trio phone
- After the next download from Nightscout, the display will update if commands do or do not make it through the full round trip
LoopFollow Remote Options¶
With the release of LoopFollow 3.2, remote options for the Loop app are updated.
The graphic below shows the Remote Settings screen for LoopFollow. You must first enter a Nightscout URL before any remote options are offered and then only the option suitable for that Nightscout site can be selected.
- When following someone running Loop, the options are None or Loop Remote Control
- When following someone running Trio, the options are None or:
- Trio 0.5.x and newer: Trio Remote Control
- Trio 0.2.x: Nightscout Remote Control
Critical Configuration Information¶
If you plan to use LoopFollow Remote Control with a looper using the Loop app version 3.x or the Trio app version 0.5 or newer, continue to the next section for instructions to find or create your keys Apple Push Notifications System (APNS).
If your looper is using Trio 0.2.x, use this link for configuration:
Apple Push Notifications System (APNS)¶
One Set of APNS Credentials
If you support multiple people, you only need one APNS key for a given Developer ID.
- You can follow someone who is using the Trio app and another person who is using the Loop app.
- You enter the same APNS credentials for each instance of LoopFollow that you are using for your multiple loopers
- The looper's app (Loop or Trio) must be built with the Developer ID used to create the APNS key.
Existing APNS¶
If you previously configured remote control with the Loop app, you already have an Apple Push Notification System (APNS) Key ID and Key. These were added to the config vars in your Nightscout site.
- For Loop, these keys must be added to Nightscout for you to use the Careportal feature
- For Trio, these keys do not need to be added to Nightscout to use the Careportal feature
If you do not have existing APNS Keys, skip ahead to New APNS.
When you configured APNS for the Loop app and saved information in your Nightscout config vars, they used the names in the table below. The same APNS Key ID and Key are what you need to add to the LoopFollow app when configuring for Remote Control with APNS.
Config Var | Format of Config Var Value |
---|---|
LOOP_APNS_KEY_ID |
AAAAAAAAAA |
LOOP_APNS_KEY |
-----BEGIN PRIVATE KEY----- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA -----END PRIVATE KEY----- |
LOOP_DEVELOPER_TEAM_ID |
AAAAAAAAAA |
Note that the LOOP_DEVELOPER_TEAM_ID
is the Apple Developer ID used to build the Loop app.
- When using LoopFollow 3.2 or newer, the addition of those
config
variables in Nightscout is only required to support sending remote commands to the Loop app from NightscoutCareportal
and from LoopCaregiver. - With LoopFollow 3.2 and newer versions, the LoopFollow Remote Control features are available for both the Loop and Trio apps when the APNS credentials are entered in the LoopFollow app, along with other specific credentials for each app.
If you are configuring for Trio remote control with LoopFollow, you do not need to enter the Apple Developer ID explicitly because it is included in the information Trio uploads to Nightscout.
New APNS¶
When using Trio, you do not need to add the config vars to Nightscout that are required for Loop remote control from Nightscout Careportal
and LoopCaregiver. If you already have them, it doesn't hurt anything, but you do not need to add them to use remote control with Trio.
With LoopFollow 3.2 and newer, the config vars will not need to be embedded in Nightscout for Loop Remote Control from LoopFollow, although they are still needed to issue remote commands with the Nightscout Careportal and the LoopCaregiver app.
If you do not have APNS credentials, you need to create a key and grant it access to the  Apple Push Notification Service (APNS).
Note - these directions are copied from LoopDocs so it suggests you name the key Nightscout. It is probably best to stick with that naming for APNS keys whether you are using Loop or Trio.
Reminder
This only works with the paid Apple Developer ID.
Apple changed the APN system
Apple changed the way APN are created. Your old ones should still work, but if they don't, create new ones and update all the places where they are used.
When creating new APN keys, you have the option for "Sandbox", "Production" or "Sandbox & Production". Be sure to choose "Sandbox & Production".
- To get started, go to the
Keys
section under Apple Developer'sCertificates, Identifiers & Profiles
and login with the Apple ID associated with your developer team that you used to build the Trio app. - If not already open in your browser (compare with the below screenshot),
- Click on
Keys
(located in the left-hand column). - Either click on the blue
Create a key
button OR the plus button () to add a key.
- Click on
- In the form that appears, do the following:
- Click the checkbox for enabling
Apple Push Notifications service (APNs)
- Enter a name for the key such as
Nightscout
(you can name it however you want, just make sure you know what the key is for by the name you choose). - Then click the
Configure
button to the right of the name - Choose
Sandbox & Production
and thenSave
- Tap on the
Continue
button, upper right
- Click the checkbox for enabling
- In the screen that follows, click the blue
Register
button. - In the screen that follows, click the blue
Download
button.
This step will download a file with a name that starts withAuthKey
and ends with.p8
. - Find your
AuthKey
downloaded file in your downloads folder. It's a good idea to store this file where you can find it again if you need it. The next task is to rename the file so you can open it. Highlight the filename and choose rename, then add ".txt" after ".p8". In other words, modifyAuthKey_AAAAAAAAAA.p8
toAuthKey_AAAAAAAAAA.p8.txt
and click onUse .txt
when questioned. -
Double-click to open the
AuthKey_AAAAAAAAAA.p8.txt
file. It will look similar to the screenshot below. You need to highlight ALL OF THE CONTENTS of that file and copy it and then paste it both into your Secrets Reference file and into the row for LoopFollow APNS Key. Yes, allllll of the contents.
So, the easiest way is to:- Click inside that file
- Highlight all the text, and then
- Copy all the text to the clipboard (Cf. screenshot below).
- On a Mac, press Cmd+A to select all, then press Cmd+C to copy the selection.
- On a PC, press Ctrl+A to select all, then press Ctrl+C to copy the selection.
-
The APNS Key ID is the 10-character name embedded in the filename:
AuthKey_AAAAAAAAAA.p8.txt
. You can also see it if you return to Apple Developer'sCertificates, Identifiers & Profiles
as highlighted in this graphic. You copy that APNS Key ID and then paste it both into your Secrets Reference file and into the row for LoopFollow APNS Key ID
Next Step¶
Depending on the selection you made, continue to one of these pages for more information on how to configure LoopFollow for your desired remote control option.
- Loop Remote Control
- Trio Remote Control
- Nightscout Remote Control (
Trio 0.2.x only
)