Git Product home page Git Product logo

roompi's Introduction

RoomPi

Smart environmental monitoring system for buildings

SDG2 Innovative project 2020-2021

Authors: Victoria M. Gullón y Marcos Gómez

Introduction

RoomPi is a smart environmental monitoring system for use inside buildings. It is developed ontop Raspberry Pi 2B hardware.

Imagen del Sistema RoomPi

System

The system makes use of the following sensors and actuators, as well as other devices:

  • Sensors
    • DHT11 (temperature and humidity)
    • BH1750 (luxmeter light intensity)
    • CCS811 (equivalent CO2)
  • Actuators
    • HD44780 (2-line dot matrix character display)
    • SN74HC595 (8 bit shift register for LED strip)
    • Active buzzer
  • Control
    • 3 buttons
  • Others
    • LM117 voltage regulator

Executable compilation

⚠️ Before attempting to compile you must have the required dependencies installed

The project makes use of the following libraries:

  • wiringPi
  • pthread
  • rt
  • libcurl

When compiling you must specify the libraries used:

gcc src/*.c src/sensors/*.c src/actuators/*. src/libs/*.c src/controllers/*.c -lpthread -lrt -lwiringPi -lcurl -o "roompi-bin"

For cross compilation from Eclipse you will need to install the Raspbian armhf toolchain.

Web subsystem (Docker)

The web subsystem comprises the following elements:

These all run as containerized instances which are orchestrated by the Docker service.

To configure and launch the instances you must install Docker and docker-compose in the host machine and edit the .env file where the desired username and password for Grafana and InfluxDB are specified.

Then you can bring up all instances by executing the following command from the root directory of the project

docker-compose up -d

You can stop all services by executing the next command (to remove the persistent volumes created in the process append -v to the command)

docker-compose down -d

The containers are configured to restart automatically in case they fail as well as start up automatically when the OS boots.

Dependencies

If working directly on the project's source code, you must take into account the following dependencies and libraries:

C Compiler

The C compiler must compile for the arm32v7 architecture used by the BCM2836 IC. To accomplish this you need to install the following dependencies on Linux:

sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev gcc-arm-linux-gnueabihf

C Libraries

To make use of the mentioned libraries in the project you must compile and install them beforehand. To dowload the various libraries you need have git installed.

  • wiringPi
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
  • libcurl
sudo apt-get install -y autotools-dev autoconf libtool
git clone https://github.com/curl/curl
cd curl/
autoreconf -fi
./configure --without-ssl
sudo make install

Libraries for the configuration web app with Flask in Python

To work on the custom web app used to configure the system, you need to install the following dependencies

  • Python 3.8
sudo apt-get install -y checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev build-essential
cd /opt
sudo wget https://python.org/ftp/python/3.8.7/Python-3.8.7.tgz
sudo tar xzf Python-3.8.7.tgz
cd Python-3.8.7
sudo ./configure --enable-optimizations
sudo make altinstall # para evitar reemplazar el binario Python del sistema
python3.8 -V

It is highly recommended that you use a Python virtual environment when developing the project. Python's package manager pip is installed automatically in the virtual environment. Navigate instide the flask-config-roompi directory and run:

  • venv
python3.8 -m venv venv
source venv/bin/activate
  • Flask and other dependencies
pip install -r requirements.txt

jQuery and Bootstrap are used for the web app UI.

roompi's People

Contributors

dependabot[bot] avatar mooncos avatar victoriagullon29 avatar

Stargazers

 avatar

Watchers

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