|
15.03.2021., 00:42 | #1 |
PRO
Datum registracije: Apr 2010
Lokacija: Zagreb
Postovi: 4,201
|
Nadziranje dijabetesa
Cloud Upload-> NightScout Rest API
Set following URL:
https://API_SECRET_CODE@YOUR_WEB_PAGE/api/v1
enable synchronization.
AND THAT'S IT.
Ja sam već složio sebi virtualku, na kojem spremam podatke za xdrip-a, pa ukoliko je netko nestručan u ovome, a želi imati složen Nightscout, neka mi se javi, pa ću mu poslati virtualku sa par uputa kako je upogoniti.-->
Bok ekipa,
Ako ste, kao i ja, u doticaju sa dijabetesom, pretpostavljam da ste upoznati sa Libreom koje nudi HZZO za praćenje razine šećera. Uz bluetooth transmitter Miao Miao, taj se uređaj može pretvoriti u kontinuirani mjerač šećera koji šalje podatke direktno na vaš mobitel, gdje možete složiti alarme za visoki i niski šećer i time si iznimno olakšati život i frustracije sa šećerom, pogotovo u trudnoći. Aplikacija koja se koristi za to jest xDrip+. Radi na Androidu bez problema, za iOS ima dosta problema oko postavljanja, stoga je bolje koristiti android u ovom slučaju. Ukoliko želite dodatno pratiti šećer i imati povijesnu sliku, postoji aplikacija Nightscout, koja sprema podatke u bazu podataka, te možete pokazati svom dijabetologu kretanje šećera. Podaci sa xDrip+ će se syncati na Nightscout, koji je dostupan preko web stranice. Web aplikacija Nightscout također podržava alerte preko browsera, tako da možete pratiti šećer voljene osobe (žene, djeteta). E sad, za vas linuxaše, napisao sam upute kako dignuti svoj vlastiti server na kojem vrtjeti Nightscout (VM ili hosting). Napisao sam ga na engleskom, da mogu razumjeti upute i stranci: Code:
Install NightScout on VM: Ubuntu server 20.04 LTS NOTICE: If you do not have your own web page or static IP, you can user no-ip.com to register a web address. PLEASE READ THE INSTRUCTIONS WITH CARE. THERE ARE PLACES IN CONFIGURATION THAT NEED TO BE REPLACED WITH SPECIFIC VALUE. ------------------------------- ------- PREPARING ENV --------- ------------------------------- 1. Download and install mongoDB: sudo apt install mongodb 2. Install Node.js & GIT sudo apt-get install nodejs npm git 3. install nginx sudo apt-get install nginx 4. Install LetsEncrypt sudo apt-get install letsencrypt python3-certbot-nginx ------------------------------- ---- SETUP MONGO DB------------ ------------------------------- 1. enter mongodb: mongo 2. run following commands to create admin user > use admin > db.createUser( { user: "myUserAdmin", pwd: passwordPrompt(), // or cleartext password roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } ) > exit 3. edit mongodb config to enable authentication: sudo nano /etc/mongodb.conf 4. find the auth=true and uncomment it (delete '#'). Save the document 5. restart mongodb service: sudo systemctl restart mongodb ------------------------------- ---- SETUP NIGHTSCOUT --------- ------------------------------- 1. Go to home folder and clone NightScout repository: git clone https://github.com/nightscout/cgm-remote-monitor.git 2. Enter that directory and create a new file. that file will be used as a startup script: cd cgm-remote-monitor vi start.sh 3. Put the following: #!/usr/bin/bash # environment variables export DISPLAY_UNITS="mg/dl" export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout?authSource=admin" export BASE_URL="https://YOUR.WEBPAGE.URL" export PORT=1234 export API_SECRET="PUT SOME PASSWORD HERE" export PUMP_FIELDS="reservoir battery status" export DEVICESTATUS_ADVANCED=true export ENABLE="careportal iob cob openaps pump bwg rawbg basal" export INSECURE_USE_HTTP=true export TIME_FORMAT=24 # start server node server.js 4. Save file. 4.5 RUN npm install: npm install 5. make file executable: chmod a+x start.sh 6. check if it's working: sudo ./start.sh 7. if everything is ok, let's create a service. Create a new file: sudo vi /etc/systemd/system/nightscout.service 8. Paste the following: [Unit] Description=Nightscout Service After=network.target [Service] Type=simple WorkingDirectory=/your/nightscout/path/cgm-remote-monitor ExecStart=/your/nightscout/path/cgm-remote-monitor/start.sh [Install] WantedBy=multi-user.target 9. Save file and reload daemon: sudo systemctl daemon-reload 10. Start the service and enable it sudo systemctl enable nightscout.service sudo systemctl start nightscout.service ------------------------------- ------- SETUP NGINX ----------- ------------------------------- NGINX will be used as a reverse proxy. 1. stop the nginx service: sudo systemctl stop nginx 2. open /etc/nginx/sites-enabled/default file, delete everything in it and paste the following: sudo vi /etc/nginx/sites-enabled/default server { listen 80; server_name YOUR_WEB_ADDRESS_LIKE_cgm.ddns.net; location / { proxy_pass http://127.0.0.1:1234; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 3. save file and start nginx: sudo systemctl start nginx 4. open the following ports on your router: 80 443 ------------------------------- ----- SETUP CERTIFICATES ------ ------------------------------- 1. run certbot to install certificates on your nginx sudo certbot --nginx -d YOUR_WEB_ADDRESS_LIKE_cgm.ddns.net 2. Enter you email address, Agree to Terms and It will ask you if you want to redirect all traffic from HTTP to HTTPS. Select yes (2). This automatically makes some changes to our NGINX default configuration. you can check new configuration by running: cat /etc/nginx/sites-enabled/default 3. it will also automatically install renewal of certificates. ------------------------- --- setup XDRIP------- ------------------------- In your xDrip+ go to Settings --> Cloud Upload-> NightScout Rest API Set following URL: https://API_SECRET_CODE@YOUR_WEB_PAGE/api/v1 enable synchronization. AND THAT'S IT.
__________________
"Who is your daddy and what does he do?" Zadnje izmijenjeno od: Ivo_Strojnica. 28.03.2021. u 23:51. |
|
|
Oglas
|
Oglasni prostor
|
|
|