Giter Club home page Giter Club logo

nightscout-librelink-up's Introduction

Nightscout LibreLink Up Uploader/Sidecar

docker-image

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout. The upload should work with at least Freestyle Libre 2 (FGM) and Libre 3 CGM sensors.

Deploy

Configuration

The script takes the following environment variables

Variable Description Example Required
LINK_UP_USERNAME LibreLink Up Login Email [email protected] X
LINK_UP_PASSWORD LibreLink Up Login Password mypassword X
LINK_UP_CONNECTION LibreLink Up Patient-ID. Can be received from the console output if multiple connections are available. 123456abc-abcd-efgh-7891def
LINK_UP_TIME_INTERVAL The time interval of requesting values from libre link up 5
LINK_UP_REGION Your region. Used to determine the correct LibreLinkUp service (Possible values: AE, AP, AU, CA, DE, EU2, EU2, FR, JP, US) EU
NIGHTSCOUT_URL Hostname of the Nightscout instance (without https://) nightscout.yourdomain.com X
NIGHTSCOUT_API_TOKEN SHA1 Hash of Nightscout access token 162f14de46149447c3338a8286223de407e3b2fa X
NIGHTSCOUT_DISABLE_HTTPS Disables the HTTPS requirement for Nightscout URLs true
NIGHTSCOUT_DEVICE_NAME Sets the device name used in Nightscout nightscout-librelink-up
LOG_LEVEL The setting of verbosity for logging, should be one of info or debug info
SINGLE_SHOT Disables the scheduler and runs the script just once true

Usage

There are different options for using this script.

Variant 1: On Heroku

  • Click on Deploy
  • Login to Heroku if not already happened
  • Provide proper values for the environment variables
  • Important: make sure that yor Nightscout API token is hashed with SHA1
  • Click Deploy to deploy the app

Variant 2: Local

The installation process can be started by running npm install in the root directory.

To start the process simply create a bash script with the set environment variables (start.sh):

#!/bin/bash
export LINK_UP_USERNAME="[email protected]"
export LINK_UP_PASSWORD="mypassword"
export LINK_UP_TIME_INTERVAL="5"
export NIGHTSCOUT_URL="nightscout.yourdomain.com"
# use `shasum` instead of `sha1sum` on Mac
export NIGHTSCOUT_API_TOKEN=$(echo -n "foo-bar-baz" | sha1sum | cut -d ' ' -f 1)
export LOG_LEVEL="info"

npm start

Execute the script and check the console output.

Variant 3: Docker

The easiest way to use this is to use the latest docker image:

docker run -e LINK_UP_USERNAME="[email protected]" \
           -e LINK_UP_PASSWORD="mypassword" \
           -e LINK_UP_TIME_INTERVAL="5" \
           -e LINK_UP_REGION="EU" \
           -e NIGHTSCOUT_URL="nightscout.yourdomain.com" \
           -e NIGHTSCOUT_API_TOKEN="librelinku-123456789abcde" \
           -e LOG_LEVEL="info" \
           timoschlueter/nightscout-librelink-up

Variant 4: Docker Compose

If you are already using a dockerized Nightscout instance, this image can be easily added to your existing docker-compose file. In this example, the region is set for germany ("DE"):

version: '3.7'

services:
  nightscout-libre-link:
    image: timoschlueter/nightscout-librelink-up
    container_name: nightscout-libre-link
    environment:
      LINK_UP_USERNAME: "[email protected]"
      LINK_UP_PASSWORD: "mypassword"
      LINK_UP_TIME_INTERVAL: "5"
      LINK_UP_REGION: "DE"
      NIGHTSCOUT_URL: "nightscout.yourdomain.com"
      NIGHTSCOUT_API_TOKEN: "librelinku-123456789abcde"
      LOG_LEVEL: "info"

ToDo

  • Integration into Nightscout: I have not yet looked into the plugin architecture of Nightscout. Maybe this should be converted into a plugin.

nightscout-librelink-up's People

Contributors

timoschlueter avatar joerg-schoemer avatar sebdei avatar gfeuillen avatar swhitt avatar dependabot[bot] avatar ninelore avatar hanskre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.