Coder Social home page Coder Social logo

hackingdiabetes's People

Watchers

 avatar  avatar  avatar  avatar  avatar

hackingdiabetes's Issues

add a wotkit output node to node-red

This way we can centralize the real time data processing and connectivity to our upstream servers into node-red.

(We'll keep the direct connection to wotkit with auto registration still as in #11.)

Implement Dexcom Agent

Implement a Raspberry Pi-ready Dexcom agent that could be distributed. That is, it's configurable and can run as a service - started when the system boots and not dependent on a user logging in.

The agent's purpose is to get data from the Dexcom G4 and send it to Node Red.

The agent is implemented in Python and uses dexcom_reader to poll a Dexcom G4 continuous blood glucose receiver.

It internally manages which records need to be fetched from a Dexcom device when it polls the hardware. This is important because the Dexcom G4 USB interface isn't very fast - parsing all the records stored on the device, even though small, was parsing about 1000 records/sec. That's not good enough when your device has 10,000 records and you poll it every minute. I think this can be implemented the same way Mike did in the hackathon - have the agent write the timestamp to a text file.

A config file will store key value pairs, so JSON or XML are fine - whatever is easiest in Python. Some config options I can think of:
ReceiverPollInterval: number of seconds to wait before polling the Dexcom G4 again. Default 60.
ResultWebService: URI of the web service that will receive the event data. Default is the local Node Red server + flow that we bundle with the product.
MaxEventsPerRequest: Maximum number of BG events to include in a single request to the web service. This is mostly relevant when the agent is run for the first time and has a lot of data to seed the web service. Default 100.

The agent's lifecycle is a simple loop:

Connect to the Dexcom G4 over USB.
Request all blood glucose readings on the device since the last connection.
Create a JSON payload with the readings and send to the web service
Sleep for a minute, then do it again.

Display for Pi?

I'm thinking it would be good to have some sort of display for feedback on the Pi. Perhaps some interesting use of LEDs (e.g. in a glowing bunny) or an LCD screen of some sort. Something cheap to keep the cost down of course.

dexcom_reader: fix iterator index bug

The dexcom_reader project we're basing our code on contains a bug that we fixed but should be performed in the dexcom_reader fork, and then a pull request sent back to the original author.

Web based agent GUI

It would be great to have a GUI for the agent itself IMHO.

I'm thinking web page(s) served up by a lightweight web server on the pi could be a great way of providing a UI for the agent for configuration and status.

It could display information about the state of the dexcon connection and the agent: e.g. whether it is connected, data on the pi, last time data was uploaded to the web service (WoTKit or other), alerts sent, and other dexcon/agent information need to make sure its all working.

The target for this would be non developers who need to manage the agent who are not familiar with command line and ssh. I think this would mainly be used for configuration, but perhaps the page(s) could serve as a simple monitoring interface for home users managing their kids. This would assume it is connected to the same wifi network, or on an ad hoc wifi network connected directly to their iPhone or laptop. People may not want or need to use a remote monitoring service like WoTKit while they are at home or in the same area. I'm thinking of a simple web server running on the pi, implemented in python or node, similar in concept (but more user friendly) than a web server used to manage your home wifi router.

dexcom_reader: merge hackathon date search

Larissa and I worked on a function that performed a Dexcom BG event lookup based on a timestamp, because iterating through the entire contents of a Dexcom device was laggy.

Clean it up and send pull request back to original author.

Implement Dexcom sim

I need a simple Python simulator that simulates the Dexcom Agent when I don't have a physical device.

Options:
interval: seconds between new readings being sent
targetwebservice: URI of the web service we're sending to. Default is the local Node Red web service
minallowablebg: The smallest blood glucose reading the simulator can generate
maxallowablebg: The largest blood glucose reading the simulator can generate

When the sim runs, it generates a random BG level between min and max and sends it to the web service. The JSON payload needs to match what Dexcom Agent sends.

Document installation process

Come up with proper documentation for users to get started with the project.

We need:
Building from source (incl dependency install - get requirements.txt updated!)

Building the SD image (documentation for us)

Flashing the SD image onto a Rasp Pi

Additional user setup (as we develop the UI)

Add Flask to project

Install Flask on the local pi

Addable to requirements.txt?

I don't know. Install it and then figure out what you should be doing.

Setup local DB

Setup a local DB (SQLite?) on the Pi.

Write some brief developer documentation on how to work with it in the primitive way we need.

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.