XDripNightScout: Difference between revisions

From DrewWiki
Jump to navigation Jump to search
(use docker, move outdated to old)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== NightScout ==
= NightScout =


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


=== Setup my.env ===
== Setup my.env ==
<pre>
<syntaxhighlight lang=bash>
$ cat my.env  
$ cat my.env  
MONGO_CONNECTION=mongodb://user:password@my_mongodb_host:27071
MONGO_CONNECTION=mongodb://user:password@my_mongodb_host:27071
Line 34: Line 25:


DEVICESTATUS_ADVANCED="true"
DEVICESTATUS_ADVANCED="true"
</pre>
</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 ===
<pre>
<syntaxhighlight lang=bash>
env $(cat my.env) ENABLE="pump careportal iob cob basal" PUMP_FIELDS="reservoir battery" node server.js
env $(cat my.env) ENABLE="pump careportal iob cob basal" PUMP_FIELDS="reservoir battery" node server.js
</pre>  
</syntaxhighlight>  


=== NightScout API ===
=== NightScout API ===
<pre>
<syntaxhighlight lang=bash>
https://drew.invadelabs.com/api/v1/entries
https://drew.invadelabs.com/api/v1/entries
https://drew.invadelabs.com/api/v1/current  
https://drew.invadelabs.com/api/v1/current  


https://[email protected]/api/v1/entries
https://[email protected]/api/v1/entries
</pre>
</syntaxhighlight>


== mmcsv MiniMed Connect to CSV / JSON ==
=== mmcsv MiniMed Connect to CSV / JSON ===
<pre>
<syntaxhighlight lang=bash>
$ git clone https://github.com/LittleDMatt/mmcsv.git
$ git clone https://github.com/LittleDMatt/mmcsv.git
$ vi lib/utils.js
$ vi lib/utils.js
Line 64: Line 72:
Upload to nightscout:
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"
$ 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"
</pre>
</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"