To do some fast development of new Nightscout features, I wanted to work away from Azure. "Easy!" I thought, already sitting at a laptop with GitHub and Node.js installed. Well I'm afraid it wasn't so. With the help of some fab' people (not least @MilosKozak, thank you!), I got there. Here's how:
Prerequisites
This is what I needed to get going, versions are important!!- Node.js
- Git (here?, I used Version 2.7)
- Python (Version 2.x (no higher than 2!), I used 2.7.11 x64)
- Microsoft Visual Studio Express 2013 (must be 2013)
Preparation
I had to make sure both npm (Node Package Manager) and Git were on the user path. I also added some system varibales for Nightscout(Settings > System > About > System Info > Advanced system settings > Evironment Variables...):
User Variable
- PATH = C:\Users\[MyUserName]\AppData\Roaming\npm;C:\Program Files\Git\bin
- API_SECRET = [MyNightscoutAPISecret]
- DEVICESTATUS_ADVANCED = true
- ENABLE = careportal iob cob openaps pump bwg rawbg basal
- MONGO = [MyMongoconnectionString]
- PORT = 80
- PUMP_FIELDS = reservoir battery status
Installation
I had to ensure npm used the correct compiler from Visual Studio 2013:- Open Command Prompt ([Windows] + [R] > "cmd")
- Enter "npm config set msvs_version 2013 --global"
- Create a local copy of cgm-remote-monitor on machine (in my case using GitHub)
- Open Command Prompt ([Windows] + [R] > "cmd")
- Enter "cd [cgm-remote-monitor directory path]"
- Enter "npm install"
Running Nightscout
- From the open Command Prompt, enter "node server"
Developing in an IDE
- I used NTVS (Node Tools for Visual Studio) and followed this awesome video:
No comments:
Post a Comment