How to set up Nightscout with Dexcom
Updated: Sep 16
Setting up your Nightscout can be a little tricky. This tutorial walks you through setting up your account with all Dexcom CGMs on Android and iOS. If you're curious about Nightscout because you want to connect your Dexcom with Diabits - fear not! We integrate with Dexcom directly.
What is Nightscout?
Nightscout is an open source DIY project that allows you to view your Medtronic, Dexcom, or Freestyle Libre data from any web browser for free. Nightscout sends your blood sugar data into the cloud, so you can view it remotely and use it in many interesting ways.
Nightscout was developed by a tech-savvy group of parents of children with type 1 diabetes as a solution for remote monitoring. Parents can use Nightscout to monitor their child’s blood sugars in real-time, reducing stress throughout the day.
What do you need?
To connect a Dexcom CGM with Nightscout, you will need a Dexcom CGM and an Android or iOS smartphone.
We’ll first walk you through the general setup requirements and then go into the details specific to Medtronic devices. Its highly recommended you go through this process on a laptop or desktop computer rather than a mobile device.
1. Create a Github Account
First thing you’ll want to do is create a GitHub account. Select the free individual plan, and verify your email.
Next, you’ll want to navigate to this Nightscout GitHub repository. Click on the “Fork” button to make a copy of the repository so you can use it for yourself.
Once you have your own forked copy of the repository, you should notice that the page URL is now github.com/your_github_name/cgm-remote-monitor. Bookmark this page so you can easily go back to it.
2. Create a Heroku account
Heroku is the easiest way to host your Nightscout website for free. Using this platform means you will be able to see your real time CGM data in the cloud.
Sign up for Heroku. Make sure to select Hobbyist in the role field and Node.js as the development language. Verify your account by clicking on the link they send to your email address.
3. Connecting your Github and Heroku accounts
Go back to your forked version of the Nightscout repository that you bookmarked. If you didn’t bookmark the page (tsk tsk!), you can also access your forked version of the repository by clicking on your profile and then navigating to “Your Repositories”.
Scroll down to README.md and click on the purple button “Deploy to Heroku”.
This will take you to Heroku, where you should be already signed in. Fill in the following required information:
App name: Choose your app name! It will appear in your Heroku URL like your-app-name.herokuapp.com
Region: Leave this on United States even if you are located in another country. This setting will not affect your Nightscout.
Config_vars are the configuration settings to your Nightscout and we’ll be changing and filling out some of them. Each setting has a description underneath it. You can always change these at a later time if need be.
API_SECRET: This is your password. It must be at least 12 characters long. Record this somewhere as you’ll need it later!
BG_HIGH & BG_LOW: These are your high and low thresholds. When your blood glucose is outside of this range, you’ll get an alert (only if ALARM_URGENT_HIGH and ALARM_URGENT_LOW are turned on).
DISPLAY_UNITS: Choose if you want blood glucose units in mmol/L or mg/dL.
BRIDGE_SERVER: If you’re anywhere outside of the US, set this to “EU”. Otherwise, leave it as “US”.
BRIDGE_PASSWORD: Enter your Dexcom password. This will be the same as you use to log in to the Dexcom app.
BRIDGE_USER_NAME: Enter your Dexcom username. This will be the same as you use to log in to the Dexcom app.
ENABLE: Enter “careport basal bridge”.
Once you’re done with the above, click “Deploy App” at the bottom and enter your credit card information on the next screen. Don’t worry! This is a free service and you won’t be charged. This is just for account verification purposes. This can take up to 10 minutes.
If you get an error message after saving your billing information, click on “Deploy App” again and it should work.
4. Setting up your Nightscout account
At this stage, you should see a notice that your app was successfully deployed. Click on “View” at the bottom of your Heroku page. This will take you to your Nightscout account.
Choose your timezone.
At the bottom of the page, click on “Authenticate”. Enter your API_SECRET (the password you created earlier). Then, click “Save”.
Once saved, remove “/profile” in the URL displayed at the top of your browser and press ‘enter’ on your keyboard.
You’ll be redirected to your Nighscout homepage. It will be empty right now, but don’t worry. We will be connecting your CGM data in the following steps.
5. Connecting your Dexcom
Follow the iOS or Android instructions, depending on what you use.
Enable Dexcom Share in your Dexcom app.
You will need to create a free Uptime Robot account. This makes sure that your Nightscout account stays active 24/7 and will be continuously updated. Once you’re on uptimerobot.com, click sign up and select the Free Plan.
Once you have verified your email, log into Uptime Robot and select “+ Add New Monitor”.
This will take you to the settings menu. Enter as follows:
Monitor Type: Select "HTTP(S)" in the drop down menu.
Friendly Name: Enter whichever name you choose!
URL (or IP): Enter your Nightscout URL
Monitoring Interval: Select the frequency your CGM updates. It should be 5 minutes
Click on “Create Monitor” and you’re done! Scroll down to get an idea of what you can do with Nightscout.
Newer versions of Android will allow you to connect to Nightscout directly using Dexcom Share, a feature available on your device’s Dexcom app. If you’re running an older version of Android, or are using a Dexcom G4 without Share, you will need to download and install xDrip or xDrip+. These downloads are not from the Google Play store, and so you’ll need to give your phone’s browser permission to install unknown apps when prompted.
The following instructions are taken from here.
Note: If your phone is running Marshmallow (Android 6), you must manually enable location permissions in your phone’s system settings - (Settings>apps>xdrip>Permissions).
Ensure Dexcom Share is enabled in your Dexcom app. Then, open xDrip or xDrip+ (whichever you downloaded) and tap on the 3 bars on the top left.
Then, tap Hardware Data Source and select DexcomShare. Enter your 10-character Dexcom receiver serial number or use the option to scan the Share barcode.
Your serial number is located on the back of your Dexcom receiver and starts with 2 letters.
Return to the menu (the 3 bars on the top left corner) and tap Bluetooth Scan.
This will automatically start scanning for Bluetooth devices.
Tap on “DEXCOMRX”. If this is your first time connecting with Share, you may be returned to the xDrip app and asked to start your sensor. To do this, enter the menu and tap Start Sensor. Enter the approximate time and date your Dexcom sensor was started.
Now that your xDrip is successfully paired with the Dexom receiver, the Dexcom receiver will show a solid, not flashing, Bluetooth icon on the top left corner.
In xDrip, go to the menu and tap System Status and check that Connection Status says “Connected”.
Return to settings and check “Run Collection Service in foreground”.
Now, all you need to do is connect xDrip to Nightscout.
Navigate to Settings and tap Data Sync.
Select API Uploader (REST) as the upload method and enter your Nightscout URL. For me, this is https://test-nightscout-rachael.herokuapp.com.
Congratulations! You've successfully connected Nightscout with your Dexcom!
What you can do with Nightscout
Nightscout is also compatible with Diabits, our free diabetes management app that offers blood sugar predictions using machine learning. Creating a Diabits account and connecting it to your Nightscout is fast and easy. For more information on how to connect your Diabits account with Nightscout, click here.