Git Product home page Git Product logo

homeiot's Introduction

homeIoT

Containerized, automated, and AWS-assisted solution for air quality monitoring at home.

Air quality monitoring. Collect CO2, humidity, temperature data using Sensirion SCD41 sensor and upload the data to AWS RDS database (MySQL engine). This is containerized (Docker) and run on Raspberry Pi B+ model (32bit, ARMv6 CPU). Interactive visualization of data on R Shiny app (dashboard).

Automated depolyment (using CI/CD): on git push, a new Docker image will be generated and saved in GitHub Packages. Any changes made to the Shiny app will automatically be deployed to an AWS EC2 instance (where the app is hosted) and update the web app.

diagram

This repository is under development and more features will follow.

Installation

Development

Prerequisite: conda Clone the repository to your work directory.

git clone [email protected]:leejheth/homeIoT.git
cd homeIoT

Set up the environment. This will create a new conda environment and install all dependencies in it.

make setup

Activate the newly create environment.

conda activate iot-env

Start measurement and data streaming.

python measure.py

Run Docker image on Raspberry Pi

  • Install Raspberry Pi OS Lite on micro SD card on your PC and insert the card to Raspberry Pi. In advanced setting, configure WLAN credentials and enable ssh connection.
  • Set static IP address on your Raspberry Pi, so it is always accessible via ssh connection with the same private IP address.
  • Install Docker
sudo apt-get update
sudo apt-get upgrade
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Verify if the docker installation is successful using the following command.

docker run hello-world

Pull docker image from Docker Hub.

docker image pull leejih/pi-co2-sensor:3.1

In your current directory, create a folder named conf and a file named 'mysql.txt' to store MySQL-related credentials.

mkdir conf
touch conf/mysql.txt

Run docker container.

docker run --mount type=bind,source="$(pwd)"/conf,target=/home/conf --device=/dev/ttyUSB0 -d here_comes_image_ID

Dashboard deployment

To deploy the Shiny app on the server, e.g. on a AWS EC2 instance, there is a great tutorial here.

The current repository employs a CI/CD pipeline (.github/workflows/cicd.yml) to create a docker image (to be run on Raspberry Pi) and to automatically deploy the Shiny app on AWS EC2.

References

homeiot's People

Contributors

leejheth avatar

Watchers

Kostas Georgiou 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.