GithubHelp home page GithubHelp logo

iostream72 / remote-ventilator-monitor-pi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-ventilator-remote-monitoring/remote-ventilator-monitor-pi

0.0 0.0 0.0 24 KB

App for Raspberry Pi

License: GNU General Public License v3.0

Python 96.05% Shell 3.95%

remote-ventilator-monitor-pi's Introduction

Remote Ventilator Monitor - Raspberry Pi App

This git repo is for the code on the Raspberry Pi

Architecture Overview

Heroku Cloud Server & Web Browser Repo Raspberry Pi (Network Adapter) Repo Ventilator (Arduino) Repo
Ruby on Rails Flask Arduino Board
Javascript Python C++

Goal

Create a lightweight Raspberry Pi application to serve as a network adapter to relay data from Arduino-Based ventilators to a central monitoring dashboard (javascript web-browser application).

Caution

This software is currently only a concept - it is neither approved nor intended to be used in any medical setting.

Why Raspberry Pi?

Many of the rapidly manufacturable ventiltor designs utilize and arduino-based control system which does not have a network interface. The raspberry pi provides this network interface, serving as an API endpoint which can connect to central monitoring dashboard (javascript web-browser application). Raspberry pi's are cheap, easy to program, available in large quantities, locally sourceable, and reliable (by consumer hardwarwe standards).

Current State of the App

As of 3-April-2020: Currently, the app is in demo/testing mode only. The server consists of a python flask app. A typical data request from the dashboard is handled like this:

  1. The flask app receives a request from the javascript dashboard application
  2. The flask app sends a request to the ventilator (Arduino) for data via the USB serial cable
  3. The flask app receives the data back from the ventilator (Arduino)
  4. The flask app sends the data to the javascript dashboard application

What Hardware do I need Development & Testing?

  1. Obtain a Raspberry Pi board. Many raspberry pi's will work, but the Raspberry Pi 3 Model B+ is widely available for an affordable price (~$ USD). These products are widely avialable, so shop around. Newark is the main US distributor and currently has about 56,000 Raspberry Pi 4 Model B's in stock for ~$55 USD each.
  2. Obtain a power supply and a The Rasperry Pi is power hungry, especially when you have an arduino plugged in, so be sure to pick up a beefy power supply if you don't already have one. Be sure to pick up the correct power supply for your board - the Raspberry Pi Model 4's now use a USB-C power supply instead of the old boards, which use a USB micro power supply.
  3. If you'll be using a display monitor with your pi (recommended - easier than headless mode) you will need the appropriate HDMI cable. Please note that the Raspberry Pi 4 now uses a mini-HDMI instead of a full size HDMI video cable.
  4. Obtain an SD card - buy a high quality one with a good amount of memory. The Sandick Ultra Plus microSDHC UHS-I 32 GB seems to work nicely.
  5. Obtain an SD card reader if you don't already have one.

How do I set up my Raspberry Pi for Development & Testing?

Eventually we'll have pre-deployed images ready for download and quick install onto your SD card. For now, there is a lot of manual work:

  1. Download the SD Card Formatter tool to your desktop computer and format your SD card.
  2. Download the Raspberry Pi Imager for your desktop computer operating system.
  3. Open the Raspberry Pi Imager and install the Rasbian Lite Image onto your SD card
  4. Insert your SD card into your pi, connect your desktop monitor, keyboard, and mouse, and plug your pi into your power supply
  5. When the pi boots, enter the default username: pi and password: raspberry
  6. Either plug your raspberry pi into your local ethernet network or add your wifi credentials to the wpa_supplicant.conf file.
  7. The default hostname of the pi is raspberrypi which will make your pi accessible on your local network via the url http://www.raspberrypi.local. Here, we will change the host name to ventilator-1 so the pi will be accessible on our LAN via the url http://www.ventilator-1.local. Change the host name of your raspberry pi using the nano (new to nano?): sudo nano /etc/hostname -> change the host name to ventilator-1 or similar. Use a different host name for each pi.
  8. Edit the /etc/host file sudo nano /etc/hosts and change raspberrypi to ventilator-1
  9. Update the apt package manager sudo apt-get update
  10. Install git sudo apt-get install git
  11. Install the python 3 package manager sudo apt-get install python3-pip
  12. Install our application dependencies sudo pip3 install flask flask-cors pyserial
  13. Clone this git repo: git clone https://github.com/Open-Ventilator-Remote-Monitoring/remote-ventilator-monitor-pi.git
  14. cd remote-ventilator-monitor-pi
  15. Start the server using the start script: ./start.sh (You may need to run chmod 777 start.sh first).
  16. Open a web browser on your desktop (connected to the same network as your pi) and visit the url http://ventilator-1.local You should see the index info page.
  17. After you connect your properly programmed Arduino via a USB cable, you should be able to visit http://ventilator-1.local/api/ventilator and view JSON result of the latest ventilator stats. Refresh the page to query the Arduino again and get different values.

Having a problem? Leave a message on the Slack Channel and we'll help you out.

remote-ventilator-monitor-pi's People

Contributors

samcervantes 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.