General-purpose Nightscout setup, for Dexcom Share, MiniMed Connect, xDrip+, or Spike

15 Feb
Guides > Setup Guides > General-purpose Nightscout setup, for Dexcom Share, MiniMed Connect, xDrip+, or Spike

The following directions will guide you through setting up a new Nightscout site.

If your data will be coming from the Dexcom Share service — if you are running the official Dexcom app on the CGM-wearer’s phone — note all of the special “bridge” instructions in green.

If your data will be coming from the MiniMed CareLink service — if you have a Guardian Connect system paired with the MiniMed Connect app on an iPhone — note all of the special “mmconnect” instructions in purple.

If your data will be coming from a third-party uploader app, like xDrip+ or Spike, note the instructions for setting these up in the xDrip+ and Spike users section near the end.

IMPORTANT NOTES:

  • If possible, go through this setup process on a desktop/laptop — many of the screens are harder to read and navigate on mobile devices. Also, these instructions are much easier to read on a larger screen.
  • For those familiar with Azure setups: Heroku automatically creates an mLab database for you during the setup process; you do not need to set up mLab separately. (If you want to use a different mLab database, you can replace the MONGODB_URI string in your Heroku config variables.)

To create your Nightscout website on Heroku:

  1. Create a GitHub account.
    • Choose the free plan. You can skip the survey questions in the second step.
    • Verify your account via the email they sent.
    • Once you’re verified and logged in, go to the main Nightscout repository here.
    • Make your own copy of the project by “forking” it: Click on the Fork button in the upper right.
    • After a moment, you will have your own fork of the project. Bookmark this page, as you’ll come back to it from time to time.
  2. Create a Heroku account. Heroku is currently the recommended platform for hosting your Nightscout site. You can run a single Nightscout site 24/7 with a free Heroku account.
    • Enter your account details. “Role” and “Primary development language” can be anything, but “Hobbyist” and “Node.js” are the most appropriate choices.
    • Verify your account via the link in the verification email, and set your password.
  3. Go to back to your GitHub account, and make sure you’re in your cgm-remote-monitor repository.
  4. In the repository, scroll down to where the Readme file is displayed, and click the purple Deploy to Heroku button.
    • Scroll down to where you see the full Readme displayed; do not click the README.md link in the file list. You’ll get a “No app.json located in the repo URL provided” error on deploying if you click the wrong purple button.
    • If you’re doing this process on a phone or tablet, you may not see the Readme displayed on scrolling — have your browser load the Desktop version of the page first.
  5. On the Heroku screen that opens, fill in the information requested:
    • App name: Your site will have a URL like “your-app-name.herokuapp.com”. This is where you choose the “your-app-name” part.
    • Region: No matter where you are, this setting doesn’t impact you; leave it on United States.
    • Config Vars: Most of these are populated with defaults that will be fine for a typical setup. All of them can be edited later on. There are a few you’ll want to note during this setup though:
      • API_SECRET: This is required. Enter a passphrase you will use for your site. It must be at least 12 characters.
      • BG_HIGH, BG_LOW, BG_TARGET_TOP, and BG_TARGET_BOTTOM: The thresholds at which your site will alert you. HIGH and LOW are your “urgent” thresholds; TARGET_TOP and TARGET_BOTTOM are the top and bottom of your “good” range.
        • All of these values must be entered in mg/dl amounts, even if you use mmol/L. Multiply by 18 to convert — if you want a BG_TARGET_TOP of 10.0 mmol/L, enter “180” (10 x 18).
      • BRIDGE_PASSWORD, BRIDGE_USER_NAME, and BRIDGE_SERVER: If your data is coming from the Dexcom Share service, you are making a “bridge”. Enter your Dexcom account name and password here — the same credentials you use to sign into the Dexcom app on the phone, and the Clarity service.
        • If you are outside the US, set BRIDGE_SERVER to “EU” (in capitals, without the quotation marks. If you are inside the US, leave it as-is.
      • DISPLAY_UNITS: Units will be mg/dl by default. If you want mmol/L, enter “mmol” here (not “mmol/L”).
      • ENABLE: This is the variable that turns on all the features you want to use. There are many plugins available, and you can always add or remove them later.
        • This field must be just a list of plugin names separated by spaces. No quotation marks, commas, or anything else.
        • A good starting set is:
          careportal basal
          (careportal is the plugin that lets you manually add events to your graph, like insulin doses, carbs eaten, temp basals, etc. The basal plugin shows your current basal rate in a little “pill” on the main page.)
        • If you also want to track pump site changes and sensor changes:
          careportal basal cage sage
          (“cage” stands for “cannula age”; “sage” = “sensor age”)
        • If you’re doing a Dexcom Share bridge:
          careportal basal bridge
        • If you’re doing a MiniMed Connect bridge:
          careportal basal mmconnect
        • There’s a list of all of the plugins and what they do here. (The ones you can choose to enable are under “Advanced Plugins” there.)
      • MMCONNECT_USER_NAME, MMCONNECT_PASSWORD, and MMCONNECT_SERVER: If your data is coming from the MiniMed CareLink service, you are making a “bridge”. Enter your CareLink account name and password here — the same credentials you use to sign into the MiniMed Connect app on your phone.
        • If you are outside the US, the CareLink bridge won’t currently work. A fix is in the works; this guide will be updated once it’s in place. If you’re comfortable with deploying branches manually, this branch reportedly supports EU CareLink accounts.
      • MONGO_COLLECTION: This field is required, but should remain as-is (as “entries”).
  6. Click the Deploy app button at the bottom of the page.
    • Heroku will begin deployment, going through a list of automated steps at the bottom of the page.
    • During the “Configure environment” step, you will be asked to add a credit card to the account. All Heroku accounts need a credit card on file to verify the account and allow for paid add-ons. You will never be charged without explicitly opting in to extra levels of service, and for a typical Nightscout site you won’t ever need anything extra.
    • After adding your card, you’ll be back at the deployment page. Click the Deploy app button again, and it’ll complete this time.
      Be patient. This can take a few minutes.
  7. Once it has successfully deployed, click the View button to open your new site.
  8. You will get a warning message about your profile — it just needs to be set up. Continue to the Profile Editor page.
    • Find the Timezone picker, and choose your zone. Make sure not to pick one of the generic zones (like “PST”), but rather one with a country or region prefix (like “Canada/Pacific”).
    • You can make other changes on this page now if you want, but you don’t need to.
    • You can’t save your changes yet — click the Authenticate link at the bottom, and enter your API_SECRET from before. (Check the “Store hash on this computer” box if you want it to remember your authentication and not ask again.)
    • Now click the Save button. You might get a warning message about the profile format, which you can ignore.
    • Now go back to your main Nightscout page by typing in your site URL into the address bar. Your URL is the App name you chose earlier, plus “.herokuapp.com” (your-app-name.herokuapp.com).
  9. If you are using a Dexcom Share bridge or a MiniMed Connect bridge, note the additional steps below.

Dexcom Share bridge users

In order for your site to stay active 24/7, you’ll need to set up a free Uptime Robot (the constant pings from this status-checking service will keep your Nightscout app awake).

  • Create a new account, and verify it with the email you get.
  • Log in, and click the + Add New Monitor button.
  • Choose HTTP(s) for the Monitor Type, pick any Friendly Name, and enter your site URL as the URL (http://your-app-name.herokuapp.com). Leave the rest as-is, and click Create Monitor.

Important note: In order for the bridge to work, you need to have Sharing active in your Dexcom app on the CGM-wearer’s phone. You do not need to have any followers (though it has been reported that adding a follower will sometimes be required to get the sharing service started — in particular with the non-official version of the Dexcom app that some use).

If you’ve completed everything and still aren’t seeing CGM data on your site after a few minutes, double-check these things:

  • Sharing is enabled in the Dexcom Mobile app, and that device has an internet connection.
  • Your ENABLE line contains the word “bridge” (without the quotation marks).
  • Your BRIDGE_USER_NAME and BRIDGE_PASSWORD lines contain the same credentials as the ones you’re signed into the Dexcom Mobile app with.
  • If you’re outside the US, you’ve manually added a BRIDGE_SERVER line, and have it set to “EU” (in uppercase).

MiniMed Connect bridge users

In order for your site to stay active 24/7, you’ll need to set up a free Uptime Robot (the constant pings from this status-checking service will keep your Nightscout app awake).

  • Create a new account, and verify it with the email you get.
  • Log in, and click the + Add New Monitor button.
  • Choose HTTP(s) for the Monitor Type, pick any Friendly Name, and enter your site URL as the URL (http://your-app-name.herokuapp.com). Leave the rest as-is, and click Create Monitor.

If you’ve completed everything and still aren’t seeing CGM data on your site after a few minutes, double-check these things:

  • Your ENABLE line contains the word “mmconnect” (without the quotation marks).
  • Your MMCONNECT_USER_NAME and MMCONNECT_PASSWORD lines contain the same credentials as the ones you’re signed into the MiniMed Connect app with.
  • If you’re outside the US, you’ve manually added an MMCONNECT_SERVER line, and have it set to “EU” (in uppercase).

Configuring the site

To make additions or changes to any of your default settings, go to your Heroku dashboard. Go into your app, go to the  “Settings” section, and then click the “Reveal Config Vars” button to show all the site variables. Bookmark this page; you’ll likely come back to it often to make changes.

When you visit your site in a browser, all of the settings will be set with defaults based on what you have entered in your Config Vars in Heroku. You can change most of those settings in the main settings pane for your page:

…but those changes will only affect that particular web browser.

For example, if your ALARM_LOW is set to “on” in your Heroku Config Vars, then your Low alarm will be enabled by default in every new browser window that loads your site. But you can manually uncheck the Low alarm in any one of those browsers, and it will remain off in there only.

If you want particular plugins to be checked by default, and not just enabled, create a SHOW_PLUGINS variable in Heroku and list them in there, just like you did in the ENABLE line.

xDrip+ and Spike users

After your Nightscout site is up and running, you’ll need to enter your URL and your API_SECRET into your receiver app.

Your API_SECRET was created during the setup process above — if you’ve forgotten it, head back to your Config Vars section in Heroku.

xDrip+ users:

Go to Settings > Cloud Upload > Nightscout Sync (REST-API), and then enter your “Base URL” by combining your API_SECRET and your site URL like this:

https://API_SECRET@your-app-name.herokuapp.com/api/v1/

(Note the /api/v1/ at the end, and the https:// at the beginning.)

Spike users:

Go to Settings > Share, scroll down to “Nightscout” and enable it, then enter your URL like this:

your-app-name.herokuapp.com

and then your API_SECRET in the next field.

Deploying a different branch

If you need to deploy a different branch to your existing Heroku site:

  1. Get to your app’s dashboard in Heroku.
  2. Go to the “Deploy” tab.
  3. If your app doesn’t appear to be connected to Github:
    • Click “GitHub” next to “Deployment Method.”
    • Enter your GitHub user name in the first box next to “Connect to GitHub” and enter “cgm-remote-monitor” in the next box.
    • Click “Search.”
    • Select your repository and click “Connect.”
  4. If your app shows that it is connected to GitHub:
    • At the bottom of the screen, under the heading “Deploy a GitHub branch,” select the branch (e.g., “dev”) from the drop-down list.
    • Click “Deploy Branch.”
    • Wait for the deployment to fully finish.