Fetches data from Dexcom's webservice and puts it in Nightscout.
These are required.
Highly recommend setting these as Custom
type of
Connection String environment variable inside of Azure.
Most people with a pre-existing Nightscout with the API enabled (using
the API_SECRET
) will only need to add two more custom connection
string variables, DEXCOM_PASSWORD
, and DEXCOM_ACCOUNT_NAME
. The
app uses these details to stay connected, bridging the "data streams"
over the web. If the API is not already set up using the
API_SECRET
, then the third variable is also needed, set it to any
long phrase of your choosing, it needs to be longer than 12
characters.
- DEXCOM_ACCOUNT_NAME - Dexcom Share user name
- DEXCOM_PASSWORD - Dexcom Share password
- API_SECRET - (might already be set in Azure) your Nightscout API Secret
These environment variables are optional, you can most likely ignore this section. These features can be used to emulate gap sync.
- maxCount - default:
1
, maximum number of records to process - minutes - default:
1440
, number of minutes to include
This one is completely optional.
- SHARE_INTERVAL - default:
60000 * 2.5
, number of ms to wait between updates. Default is2.5
minutes.
Deprecated:
- NS - Your fully qualified
https://bar.example.com
endpoint with no path. This is similar to your/pebble
endpoint, but without the/pebble
part.
We now look at WEBSITE_HOSTNAME
environment variable, which is set
automatically by Azure.
The output looks something like this when it works:
$ env $(cat shansel.env ) node index.js
Entries [ { sgv: 70,
date: 1426298639000,
dateString: '2015-03-14T02:03:59.000Z',
trend: 4,
device: 'share2',
type: 'sgv' } ]
Nightscout upload error null status 200 []
Using the Share2 app allows an iphone to push data from a Dexcom receiver to Dexcom's webservices. This program fetches a user's data from Dexcom's servers, and stores it in their own Nightscout server.
By default, this program run as node index.js
, will loop forever.
As described by Scott Hanselman, one of my many advisors,
this logs in to Dexcom Share as the data publisher. It re-uses the
token every 5
minutes to fetch the maxCount
latest glucose records
within the last specified minutes
. This information is then sent to
the user's specified Nightscout install, making the data available to
the beloved pebble watch and other equipment owned and operated by the
receiver's owner. It will continue to re-use the same sessionID
until it expires, at which point it should attempt to log in again.
If it can log in again, it will continue to re-use the new token to
fetch data, storing it into Nightscout.
Visit the releases page, download nightscout-sidecar.zip
, and
upload to Azure as a web job. Set the environment variables above as App Settings.
- A working Nightscout web app, and an Azure account.
- Download
nightscout-sidecar.zip
file from the releases page
- See Azure's documentation on how to set up and create web jobs.
- Create a new
Continuous
web job- upload the
nightscout-sidecar.zip
from the releases page
- upload the
Shortly after creating the webjob, it should start, and your Nightscout rig should receive data as usual.
This project is not FDA approved, not recommended for therapy, and not recommended by Dexcom.
We highly recommend using this only on the paid Azure Basic plans. They cost around $50/month. Using this program with Azure Free website causes the usage to exceed the free quotas. Feel free to try it out, but watch out for those quotas. You can partner with family and friends to run up to 20 sites on a single plan. Because you have a paid plan, the service will have paid performance and support, with better terms on uptimes. It may be possible to also host mongo on the same paid account, in which case it the system will fail much less often, because of the Basic support.
See the billing comments for more details and feedback.