Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build Status

Screenshot

dexcom-lambda

AWS SAM (lambda) function to scrape real time glucose values from dexcom every 5 minutes.

How does this work.

This aws lambda function impersonates a share app, and asks for the most recent blood glucose value.

Isnt there already an open source project that can retrieve dexcom date?

Yes! There is! Check it out here: http://www.nightscout.info/
The reason I decided to make this was for a couple reasons:

  • Fun aws lambda project
  • data goes in dynamo instead of mlab, which is what nightscout uses
  • app is serverless, so may be cheaper than running the full nightscout app on heroku.

What will it deploy?

  • 1 AWS Python Lambda Function
  • 1 Dynamo DB Table

I cant tell where the source code is:

  • Navigate to the cron foler, there you should see a file called app.py. That is where the logic lies.

How Can I get Started:

Prereqs:

  • AWS Acct
  • AWS CLI installed
  • AWS SAM CLI
  • Note: If you run aws --version from your terminal, your executable versions should be at least at these versions: aws-cli/1.16.161 Python/3.7.3 Darwin/18.5.0 botocore/1.12.151

How to Deploy:

Command Line

aws s3 mb s3://dev-dexcom-lambda
  • Package and deploy: (Make sure you update your dexcom user name and password)
aws cloudformation package --template-file /Users/danieldiaz/github/dexcom-lambda/.aws-sam/build/template.yaml --s3-bucket dev-dexcom-lambda --output-template-file packaged.yaml
 aws cloudformation deploy --template-file /Users/danieldiaz/github/dexcom-lambda/packaged.yaml --stack-name dev-dexcom-lambda --parameter-overrides DEXCOM_ACCOUNT_NAME=<YOUR-DEXCOM-USERNAME-HERE> DEXCOM_PASSWORD=<YOUR-DEXCOM-PASSWORD-HERE>
  • Done!
  • Navigate to your lambda console to see it executing, or go to the dynamodb table Glucose, to check out the data.

Pycharm

  • make sure you have the aws extension,
  • clone the project, right click on the template,
  • click deploy serverless template,
  • update the two parameters for dexcom username and password,
  • then Done!

Technology GOALS:

  • python
  • aws lambda
  • aws DynamoDB
  • Eventually switch to aws timetream?

Credit

This project is heavily based on the javascript project located here: https://github.com/nightscout/share2nightscout-bridge
BY: Ben West

Random Helpful Links

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.03.html

TODO

  • Add License?
  • Add launchstack url?
  • lower read write capacity units for dynamodb

About

AWS lambda to scrape real time glucose values from dexcom.

Resources

Releases

No releases published

Packages

No packages published

Languages