XDripNightScout: Difference between revisions

From DrewWiki
Jump to navigation Jump to search
No edit summary
(use docker, move outdated to old)
 
Line 1: Line 1:
== NightScout ==
= NightScout =


=== Install NVM ===
= docker =
NightScout install NVM
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
docker build -t drewderivative/cgm-remote-monitor:0.0.1 .
$ nvm install 0.10.42
docker run --name cgm-remote-monitor --env-file ./my.env -p 1337:1337 cgm-remote-monitor:0.0.1
$ nvm use 0.10.42
</syntaxhighlight>
</syntaxhighlight>


=== Clone and Build ===
== Setup my.env ==
<syntaxhighlight lang=bash>
$ git clone https://github.com/nightscout/cgm-remote-monitor.git
$ cd cgm-remote-monitor
$ npm install
</syntaxhighlight>
 
=== Setup my.env ===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
$ cat my.env  
$ cat my.env  
Line 35: Line 26:
DEVICESTATUS_ADVANCED="true"
DEVICESTATUS_ADVANCED="true"
</syntaxhighlight>
</syntaxhighlight>
= Old =
=== Install NVM ===
NightScout install NVM
<syntaxhighlight lang=bash>
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
$ nvm install 0.10.42
$ nvm use 0.10.42
</syntaxhighlight>
=== Clone and Build ===
<syntaxhighlight lang=bash>
$ git clone https://github.com/nightscout/cgm-remote-monitor.git
$ cd cgm-remote-monitor
$ npm install
</syntaxhighlight>


=== Start NightScout ===
=== Start NightScout ===
Line 49: Line 57:
</syntaxhighlight>
</syntaxhighlight>


== mmcsv MiniMed Connect to CSV / JSON ==
=== mmcsv MiniMed Connect to CSV / JSON ===
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
$ git clone https://github.com/LittleDMatt/mmcsv.git
$ git clone https://github.com/LittleDMatt/mmcsv.git
Line 65: Line 73:
$ curl -vs -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "api-secret:my_api_secret" --data-binary @bla.json "http://192.168.1.124:1337/api/v1/treatments"
$ curl -vs -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "api-secret:my_api_secret" --data-binary @bla.json "http://192.168.1.124:1337/api/v1/treatments"
</syntaxhighlight>
</syntaxhighlight>
== xDrip ==
== xDripPebble ==

Latest revision as of 23:55, 5 March 2018

NightScout

docker

docker build -t drewderivative/cgm-remote-monitor:0.0.1 .
docker run --name cgm-remote-monitor --env-file ./my.env -p 1337:1337 cgm-remote-monitor:0.0.1

Setup my.env

$ cat my.env 
MONGO_CONNECTION=mongodb://user:password@my_mongodb_host:27071
MONGO_COLLECTION=entries
DISPLAY_UNITS=mg/dl
API_SECRET=my_api_secret
CUSTOM_TITLE=Drew
THEME=colors

#TREATMENTS_AUTH=on

ALARM_URGENT_HIGH=off
ALARM_HIGH=off
ALARM_LOW=off
ALARM_URGENT_LOW=off

DEVICESTATUS_ADVANCED="true"

Old

Install NVM

NightScout install NVM

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
$ nvm install 0.10.42
$ nvm use 0.10.42

Clone and Build

$ git clone https://github.com/nightscout/cgm-remote-monitor.git
$ cd cgm-remote-monitor
$ npm install


Start NightScout

env $(cat my.env) ENABLE="pump careportal iob cob basal" PUMP_FIELDS="reservoir battery" node server.js

NightScout API

https://drew.invadelabs.com/api/v1/entries
https://drew.invadelabs.com/api/v1/current 

https://[email protected]/api/v1/entries

mmcsv MiniMed Connect to CSV / JSON

$ git clone https://github.com/LittleDMatt/mmcsv.git
$ vi lib/utils.js
 change to US time stamp
// changed date format from MM/DD/YYTHH:mm:ss
var CARELINK_TIME = 'MM/DD/YYTHH:mm:ss';
var OUTPUT_TIME_MASK = 'YYYY-MM-DDTHH:mm:ss';

$ bin/mmcsv fetch --username $CARELINK_USERNAME --password $CARELINK_PASSWORD$ --days 30 > ~/this.csv

$ bin/mmcsv parse ~/this.csv > ~/bla.json

Upload to nightscout:
$ curl -vs -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "api-secret:my_api_secret" --data-binary @bla.json "http://192.168.1.124:1337/api/v1/treatments"