GithubHelp home page GithubHelp logo

danthompson41 / live-sleep-analyzer-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hospital-sleep-tracker/live-sleep-analyzer

0.0 3.0 0.0 2.81 MB

Arduino 12.36% Shell 2.22% Python 85.42%

live-sleep-analyzer-1's Introduction

Hospital Sleep Tracker

This project is funded by Enabling Engineering team at Northeastern University.

Installation

On a Raspberry Pi

The Raspbian distribution of the Raspberry Pi can be used as a host system to log sleep for later analysis. Future plans might use the Pi as a central hub to wirelessly track sleep from multiple patients simultaneously. Installation is pretty simple: first clone the repo into the pi's home directory, then add the following line to the bottom of etc/rc.local (above the exit 0):

/home/pi/live-sleep-analyzer/initialize_sleeptracker.sh &

Then don't forget to set the FTP Credentials

In a Developer Environment

In order to interface with the USB device, you will need the following dependencies on your machine:

  • libusb
  • virtualenv
  • python
  • and of course, Git

After cloning the repo, create and activate a virtualenv for your python libraries

git clone [email protected]:hospital-sleep-tracker/live-sleep-analyzer.git
cd live-sleep-analyzer/
virtualenv ~/Virtualenvs/hospital-sleep-tracker
source ~/Virtualenvs/hospital-sleep-tracker/bin/activate
pip install -r requirements.txt

Then don't forget to set the FTP Credentials

FTP Credentials

To enable automatic uploading of logfiles to the server, you will need to create a file with the login credentials. We don't keep this on github for security.

cp sample_credentials.py credentials.py

Then change the IP address, username, and password in credentials.py to the correct values.


Usage

Data Collection: Logging Live Sleep from Teensy onto Pi via Serial

Primarily run on the Raspberry Pi, this script is useful for pure sleep-data collection. No graphs, analysis, or flashy features. The script searches for a USB connected serial device and begins tracking data into a timestamped logfile. A new logfile can be started simply by disconnecting and reconnecting the USB device. **WARNING: This script may interfere with other connected USB devices. It is recommended to remove any and all unnecessary USB devices before starting the script. **

Usage

python sleep-logger.py [-h]

Data Source:

Serial (Teensy) (future wifi support?)

Supported Operations
  • Save to logfile
  • Real-time graphing (short-term)
  • Session graphing (long-term)
  • Real-time analysis
  • Session analysis (after-the-fact)

After-the-fact Analysis: Analyzing Data from Existing Logfile

Useful for testing machine-learning algorithms on existing sleep logfiles. These algorithms are shared by the Nurse Station use case (below).

Usage

python post-analyze.py [-h] FILENAME

Data Source:

Sleep File

Supported Operations
  • Save to logfile
  • Real-time graphing (short-term)
  • Session graphing (long-term)
  • Real-time analysis
  • Session analysis (after-the-fact)

Nurse Station: Graphically Analyzing Real-time Data

Useful for testing the actual use case of this product. This simulates the system a nurse or caretaker would be using to monitor the sleep of a patient. This includes live graphs of the patient's sleep movements and information on their current sleep cycle. A logfile is created with sleep data from the current session. This is a sort of 'combination' of the other two use cases.

Usage

python realtime-analysis.py [-h]

Data Source:

Serial (Teensy)

  • Save to logfile
  • Realtime graphing (short-term)
  • Session graphing (long-term)
  • Realtime analysis
  • Session analysis (after-the-fact)

live-sleep-analyzer-1's People

Contributors

ozdanborne avatar djosborne avatar

Watchers

James Cloos avatar Daniel Thompson avatar  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.