Understanding all the ways to monitor your rigs

There are two general groups of ways to monitor your rigs:

  • Online, meaning it requires the rig to have internet connectivity (via a wifi or hotspot/tethered connection)
  • Offline, meaning the rig does not have any internet connectivity

Examples of online and offline monitoring

The main ways of monitoring your rig ONLINE include:

The main ways of monitoring your rig OFFLINE include:

You’ll probably come back to this page later to setup different monitoring options

At this point, if you’re not yet set up on OpenAPS, you won’t quite be ready to set up all of the below options for accessing your rig - because your rig is not built yet! But, just know that there are different “online” and “offline” ways to monitor your rig, so you’ll want to think about your preferences for both situations, and know that the instructions on the rest of this page are here when you’re more familiar and are ready to set up some or all of them.

Accessing your online rig via SSH

See below for different ways to access your rig:

If your computer and rig are on the same wifi network

If your computer and rig are on the same wifi network

For Mac computers

  • Open the Terminal App found in the Utilities folder in Applications.
  • Use the command ssh root@edisonhost.local (or whatever you named your edison host, in the example below, the hostname was edison1). If this is your first time logging in to the rig on the computer, you may get a message about the authenticity of the host and whether you want to add the key fingerprint to the list of known hosts. Go ahead and answer yes. You will be asked for the password for the rig...enter your root password that you setup in Phase 0 (the default was edison). Realize that keystrokes will not appear as you enter the password. A successful login will result in a screen similar to below.

Mac ssh login

  • If you get an error about “could not resolve hostname”, it is likely that your rig is actually connected to a different wifi network than the computer. Try the screen method (directions below) for connecting to your rig.

Mac ssh unknown host

  • If you get an scary looking error about “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!” that is likely because you are attempting to login to a rig that has the same hostname as a previous rig that has been logged into on the computer. (This is why you want to use unique hostnames if you are going to have multiple rigs.) You can delete the history of known hosts for the rig by entering the commands cd .ssh and then rm known_hosts. This will delete the log of known hosts on your computer. There’s no significant downside to removing the known_host log, except that you will need to answer yes to the key fingerprint additions again for the first time you login to old rigs again. After you delete the known hosts, you can use the ssh root@edisonhost.local command to login, as described above.

Mac spoofing error

For Windows computers

  • Open PuTTY program
  • Click the SSH radio button and then enter the IP address of the rig on the “Host Name” line in PuTTY.

Windows IP address for rig

  • If you do not know the IP address of the rig, you can obtain it by first logging on using Serial connection (described below) and using the command ifconfig.

Windows IP address for rig

  • Click the “Open” button in the PuTTY window and, if this is your first time logging into the rig using PuTTY using ssh, you may see a warning regarding the server’s host key. Click yes to add the host key to PuTTY’s cache.

Windows key hostname

  • Login using login name root and password is whatever you changed it to during setup in Phase 0. The default password was edison. As you type the password, no keystrokes will appear on the screen. Successful login will leave you at a prompt for the root user.

Windows IP address for rig

If your computer and rig are on different wifi networks

If your computer and rig are on different wifi networks

Access to the rig will need a cable to connect the UART port on the rig with the USB port on the computer. You will need a cable capable of transmitting data. If you try all of the steps below and are unsuccessful at connecting, try a new cable.

For Mac computers

  • Use the Terminal app on the Mac, or follow these directions for Windows
  • If you’re using a Mac, use the command sudo screen /dev/tty.usbserial-* 115200 to enable “screen” mode. You will be prompted to enter a password. Enter your computer’s password not the rig’s password here.

Mac Screen first password

  • You may see a blank screen. Press RETURN to bring up the edison’s login screen. Login as root and use your root password (you should have changed it from the default of edison during the setup of the rig - if not, please go back and do so now. A successful login will look like below.

Mac Screen successful login

  • If instead, you see a message at the bottom of the screen that says “Sorry, could not find a PTY.” that usually means the system has not cleared a previous screen session. If you only had the rig connected by one cable in the UART port on rig, you can simply unplug the rig from the computer and move to a new USB port on the computer. If you don’t have any “new” USB ports that were not used by the previous login attempt, then close out terminal app, restart the computer, and try again. This will clear the error.

Mac Screen message for busy port

  • If instead you see a message at the bottom of the screen that says “Cannot exec ‘/dev/tty.usbserial-*‘: No such file or directory”, double check that you have your rig and computer connected via the rig’s UART port. Using the OTG port will cause this error message. Or typos in the screen command will have same result. Double check your spelling, or better yet...use copy and paste whenever possible.

Mac Screen message for OTG port

For Windows Users

  • Navigate to your Control Panel and then to Device Manager. Click on the Ports to open your USB serial port. Find the COM port that the rig is connected to. In the screenshot below, COM7. Note: different USB ports will have different numbers. If you regularly plug your rig into the computer and use this connection type, you may need to make sure you update the COM number in the steps below if you are switching between different USB ports.

Windows COM port number

  • Open PuTTY program. Click on the Serial radio button, enter the COM number you got from the previous step into the Serial line number and change the speed to 115200. Click on Open button.

Windows serial setup

  • Enter root for the login and the password is whatever you changed it to during setup in Phase 0. The default password was edison. As you type the password, no keystrokes will appear on the screen. Successful login will leave you at a prompt for the root user as shown below.

Windows serial login success

Accessing your offline rig

Pancreabble - offline connection to Pebble watch

(TO DO Note - Pancreabble instructions for OpenAPS need to be re-worked to reflect the oref0-setup script way of making it work. Below is notes about Pancreabble setup prior to oref0-setup.sh being in existence.)

Pancreabble is a way to monitor your loop locally, by pairing a Pebble smartwatch directly with the Raspberry Pi or Intel Edison.

In other words, whereas the default setup looks like this:

Raspberry Pi/Intel Edison -> network -> Nightscout server -> network -> smartphone
                                                                     -> laptop
                                                                     -> Pebble watch

And by default, your Pebble is paired thus:

               smartphone -> Bluetooth -> Pebble watch

With Pancreabble, the setup looks like this:

Raspberry Pi/Intel Edison -> Bluetooth -> Pebble watch

Using a Pebble watch can be especially helpful during the “open loop” phase: you can send the loop’s recommendations directly to your wrist, making it easy to evaluate the decisions it would make in different contexts during the day (before/after eating, when active, etc.).

See Pancreabble for initial setup instructions.

Once you’ve done the first stages above, you’ll need to do generate a status file that can be passed over to the Pebble Urchin watch face. Fortunately, the core of this is available in oref0.

Go to ~src/oref0/bin and look for peb-urchin-status.sh. This gives you the basic framework to generate output files that can be used with Pancreabble. To use it, you’ll need to install jq using:

apt-get install jq

If you get errors, you may need to run apt-get update ahead of attempting to install jq.

Once jq is installed, the shell script runs and produces the urchin-status.json file which is needed to update the status on the pebble. It can be incorporated into an alias that regularly updates the pebble. You can modify it to produce messages that you want to see there.

When installing the oref0-setup you will need to replace all instances of AA:BB:CC:DD:EE:FF with the Pebble MAC address. This can be found in Settings/System/Information/BT Address. NOTE: Make sure the MAC address is in ALL CAPS.

Once you’ve installed, you will need to pair the watch to your Edison.

Bluetooth setup for Pancreabble

  • Restart the Bluetooth daemon to start up the bluetooth services. (This is normally done automatically by oref0-online once everything is set up, but we want to do things manually this first time):

sudo killall bluetoothd

  • Wait a few seconds, and run it again, until you get bluetoothd: no process found returned. Then start it back up again:

sudo /usr/local/bin/bluetoothd --experimental &

  • Wait at least 10 seconds, and then run:

sudo hciconfig hci0 name $HOSTNAME

  • If you get a Can't change local name on hci0: Network is down (100) error, start over with killall and wait longer between steps.
  • Now launch the Bluetooth control program: bluetoothctl
  • And run: power off
  • then power on
  • and each of the following:
discoverable on

scan on

agent on


On Your Pebble

Settings/BLUETOOTH to make sure Pebble is in pairing mode

from terminal


you might need to do this several times before it pairs

you will see on the edison

Request confirmation [agent] Confirm passkey 123456 (yes/no): yes

  • (WARNING: You must type in yes not just y to pair)

Once paired, type quit to exit.

Currently the peb-urchin-status.sh has 1 notification and 3 different options for urchin messages. in you APS directory there is a file called ‘pancreoptions.json’

"urchin_loop_on": true,  <--- to turn on or off urchin watchface update
"urchin_loop_status": false, <--- Gives a message on urchin watchface that it's running
"urchin_iob": true,   <--- Gives a message on urchin watchface of current IOB
"urchin_temp_rate": false, <--- Gives a message on urchin watchface of current temp basal
"notify_temp_basal": false <--- Notification of temp basal when one shows up in enact/suggested.json

note only one of the messages for the urchin watchface can be true at once

the peb-urchin-status.sh gets called from the crontab and will run automatically. By default the urchin_loop_on, and urchin_iob is set to true. You must manually change notify_temp_basal to true to start getting temp basal notifications. you can edit this file using nano pancreoptions.json from your APS directory.

Hot Button - for Android users


NOTE: The Hotbutton app linked below has disappeared from Google Play. There are several others available if you search “SSH Button”, but the app setup instructions won’t match exactlty.

Hot Button app can be used to monitor and control OpenAPS using SSH commands. It is especially useful for offline setups. Internet connection is not required, it is enough to have the rig connected to your android smartphone using bluetooth tethering.

App Setup

To set up a button you need to long click. Then go to Server Settings. For Server’s IP, add the IP address that your rig has when connected to your phone. Under Server’s Port, add the port number 22. Under Authenication Settings, you need to add your rig’s username, password, and the root password. Be sure that the password for the private key file is blank unless you are setting up a key authentication (which is not necessary). Go back to the previous button setup screen and click “Set as default!”. This will save all your server settings so that you can easily load them onto each new button you make.

Basic commands

For the Command part of the button setup you can write any command which you would run in the ssh session. (If you are running a command that would need to be run with root privileges, be sure to check the box “Execute as root!”) Here are some suggested commands:

To show Automatic Sensitivity ratio, you can set: cat /root/myopenaps/settings/autosens.json To show the last enacted loop, you can set: cat /root/myopenaps/enact/enacted.json To show your rig’s network name, you can set: iwgetid -r To show your rig’s battery status, you can set: cat /root/myopenaps/monitor/edison-battery.json To show your pump’s battery status, you can set: cat /root/myopenaps/monitor/battery.json

After setting up the button, simply click it to execute the command. The results are displayed in the black text area below the buttons. You can change the font size of the text in the box, and you can add more buttons under the main Hot Button menu.

Temporary targets

It is possible to use Hot Button application for setup of temporary targets. This script generates the custom temporary target starting at the time of its execution. You need to edit the path to the openaps folder inside it.

#! /bin/sh


echo "\
[{\"_id\":\"\",\"enteredBy\":\"\",\"eventType\":\"Temporary Target\",\"reason\":\"$REASON\",\"targetTop\":$TARGET,\"targetBottom\":$TARGET,\"duration\":60,\"created_at\":\"$(date --utc +'%Y-%m-%dT%H:%M:%S.000Z')\",\"carbs\":null,\"insulin\":null}] \
" > $OPENAPSROOT/settings/temptargets.json
openaps report invoke settings/profile.json
echo "Temporary target started"

To setup activity mode run: ./set_temp_target.sh "Activity Mode" 130

To setup eating soon mode run: ./set_temp_target.sh "Eating Soon" 80

The script is currently work in progress. The first parameter is probably not needed, it is there to have the same output as Nightscout produces. It is not possible to set different top and bottom target, but this could be easily added in the future. To be able to use the script, the most straigtforward solution is to disable the download of temporary targets from Nightscout. To do that edit your openaps.ini and remove openaps ns-temptargets from ns-loop.

SSH Login Speedup

To speed up the command execution you can add to the /etc/ssh/sshd_config the following line: UseDNS no

Accessing your offline rig via SSH over Bluetooth

Your phone and rig must be BT paired and connected over BT PAN. See https://openaps.readthedocs.io/en/latest/docs/Customize-Iterate/bluetooth-tethering-edison.html for BT PAN configuration. When you first open Termius on your mobile device (JuiceSSH and SimpleSSH are also good choices) it will prompt you to add a new host. Click the + button to add a new host. Turn the toggle on for Use SSH and then fill out the following information:

Alias – use an alias name that let’s you know which rig and which connection point this host is for, for example YourRigName on device BT
Hostname – Enter the IP address of the rig as assigned by your BT PAN
Username – click to the left of the little blue man and type root
Password – Enter your rig’s root password (default is “edison” but you should have changed it during setup)

Click Save in the upper right corner. You should now see the host you just created. If you click on that host, you’ll see a message that it is connecting (first time connections will ask if you want to save the rig to known hosts, cick continue and then you’ll be connected to a terminal app screen. You can now issue commands and edit files just like you can over an SSH connection from your computer.

Accessing your offline rig via SSH when your phone and rig are connected to the same network

Just like the trick for getting internet to your rig through a network that requires you to log in via a portal (a “captive” network), a mobile router (e.g. HooToo) or other brand) can create a network that allows your phone and rig both to be connected, allowing you to then SSH into your rig, just as if they were connected via cellular.

You can then use the same methods to SSH in for the phone or computer (that you’re using to SSH) being on the same network as the rig.

Note: you will want to set your mobile router up in advance, and give it the same network name and password as a network already on your rig; or otherwise make sure to add the network and password to your rig before you travel and want to use this offline.

Generally, the steps for getting online with the HooToo, which you should practice with before you travel:

  • Plug in the HooToo/turn it on.
  • Use your phone or computer and join the HooToo network.
  • If you plan to loop offline and just want to SSH in, you should be able to SSH in and see your logs.

For using the HooToo to join plane or hotel wifi, after you’ve joined the HooToo router network:

  • Open a browser and type in a URL (e.g. cnn.com) and hit enter. This should redirect you to the HooToo log in page.
  • Follow your router’s instructions for how to get to the network page and scan and click to join the right network.
  • Open another tab, type a URL again (e.g. cnn.com) and hit enter. This should take you to the login page (e.g. GoGo or the captive portal of the hotel wifi). Input your credentials or otherwise log in. Once you’re successfully through that step, the router is online and will begin sharing the internet connectivity with the other devices that are joined to the network.

Offline web page from rig - for any phone user

Starting with oref0 0.6.1, you can enable a rig hosted offline webpage that can be accessed over a local LAN. To do this, simply open a web browser and go to your rig’s IP address. In most cases, this will be in the format 192.168.x.x

Successful pump-loop Unsuccessful pump-loop

The box around your current BG will be either green or red, depending on the last time OpenAPS was able to successfully complete a pump-loop. The box functions similarly to the OpenAPS pill in Nightscout. If you tap on it, you will be able to view more info about the current state of your rig and its decision making process.

Offline webpage OpenAPS pill