/xdrip-js

Primary LanguageJavaScript

xdrip-js

Join the chat at https://gitter.im/thebookins/xdrip-js Build Status

Please note this project is neither created nor backed by Dexcom, Inc. This software is not intended for use in therapy.

Prerequisites

Update node version. Please see wiki page for instructions https://github.com/thebookins/xdrip-js/wiki

Installation

cd ~/src
git clone https://github.com/thebookins/xdrip-js.git
cd xdrip-js
sudo npm install

Testing

npm test

Example usage

sudo node example <######> where <######> is the 6-character serial number of the transmitter.

To see verbose output, use sudo DEBUG=* node example <######>, or replace the * with a comma separated list of the modules you would like to debug. E.g. sudo DEBUG=smp,transmitter,bluetooth-manager node example <######>.

bluetoothctl is used to accept the incoming pairing request. From a command prompt, enter bluetoothctl and then enter the following commands (some may not be necessary depending on your configuration):

  • agent off
  • agent KeyboardDisplay
  • default-agent
  • pairable on
  • power on

When the transmitter is found, type 'yes' to accept the pairing request: pairing

To view the current status of the transmitter, open a browser and navigate to http://<local IP address>:3000. E.g. http://localhost:3000 or http://192.168.1.3:3000. This will vary depending on your local network setup. app

One-shot mode additional installation steps

If you want xdrip-js to connect to the transmitter, wait for the first bg, then exit, you will need to follow these additional installation steps. This mode is useful if you have an issue with disconnecting sensors. Doing it one-shot at a time seems to make it more reliable in this case.

sudo apt-get install bluez-tools
cd ~/src/xdrip-js
chmod 755 xdrip-get-entries.sh post-ns.sh post-xdripAPS.sh

Add cron job entry (replace "40SNU6" with your g5 transmitter id) ...

* * * * * cd /root/src/xdrip-js && ps aux | grep -v grep | grep -q 'xdrip-get-entries' || ./xdrip-get-entries.sh 40SNU6 | tee -a /var/log/openaps/xdrip-js-loop.log