stefancodes / hackingdiabetes Goto Github PK
View Code? Open in Web Editor NEWHacking Diabetes repo for team 4 @ Hacking Health 2014 Vancouver
Hacking Diabetes repo for team 4 @ Hacking Health 2014 Vancouver
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.)
Rather than using a hardcoded sensor, make it configurable, and register it as a private sensor if it doesn't exist.
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.
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 only implements support for OS X and Linux. Implements Windows support and send pull request to original author.
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.
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.
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.
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.
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)
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.
Requires defining prediction schema fields on registration, and combining prediction data with the sensor data output
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.