Giter Site home page Giter Site logo

jersearls / cpap-filler Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 295 KB

Python project to scrape CPAP usage data and call an arduino to fill a CPAP water reservoir.

License: MIT License

Python 32.96% Shell 0.11% C 47.02% C++ 3.65% Objective-C 2.49% XSLT 13.78%

cpap-filler's Introduction

cpap-filler

Python project to scrape CPAP usage data and call an arduino to fill a CPAP water reservoir.

This project utilizes a particle photon device that has been flashed with this code repository and requires a peristaltic pump controlled by pin D3.

This project also assumes the CPAP machine used is the Resmed Airsense 10.

Installation

This project uses Pipenv to manage dependencies.

  • To install dependencies, first install Pipenv with the brew install pipenv command

  • With pipenv installed run pipenv install from the root of the project

  • Fill variables as shown in .env.example file into an empty .env file at the project root

Working with CPAP Filler

Local Execution

To run the program locally, execute the following bash script from the root of the project:

./bin/run

Running on a Local CRON

env EDITOR=vim crontab -e

Cron command to run filler at 1:30pm every day

30 13 * * * <path_to_repo>/cpap-filler/bin/run

Note for Mojave Users

Crontab needs access to user libraries to execute dependencies. This access was revoked in MacOS Mojave. Click here to learn how to implement a fix.

Deploy to AWS Lambda

To create a deployable zip file of the project that can be uploaded to AWS Lambda, execute the following bash script from the root of the project:

./bin/build_and_deploy

The /tmp folder created by the script contains the deployable zip file.

Pump Calibration

Before using the machine you will need to calibrate the pump output.

A script is included to facilitate this.

Place the pump above a graduated cylinder.

From the root directory run the following command and answer the prompts:

pipenv run python calibrate/calibrate.py

The script will output a mL/s value. This value will be added to the local .env file automatically after running calibration.

CPAP Device Water Consumption

The Airsense 10 water reservoir holds 380mL at MAX line. Each quarter tick mark is placed at 95mL increments.

At a humidity level of 4, the machine uses roughly one quarter tank per 7 hours.

Testing has shown consumption at approximately 15 mL/hr.

This variable is subject to change with varying humidity and weather.

It is stored as an environmental variable in the .env file.

cpap-filler's People

Contributors

jersearls avatar

Watchers

James Cloos 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.