Simple Flask app to run on Raspberry and display different sensors
- Raspberry Pi
- Microswitch
- DHT22 Temperature and Humidity sensor
sudo apt-get update && sudo apt-get upgrade -y
# Required for docker-compose and git
sudo apt-get install -y git python3-pip
# Install docker
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
# Install docker-compose
sudo pip3 install docker-compose
git clone https://github.com/ilirb/sensor_monitor.git
cd sensor_monitor
docker-compose up
# to run in background and start on boot
docker-compose up -d
# to update
docker-compose pull && docker-compose up -d
# to stop and remove
docker-compose stop
docker-compose down
docker run -p 5000:5000 --privileged ilirb/sensor-monitor:latest
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git supervisor authbind python3 python3-pip python3-venv
git clone https://github.com/ilirb/sensor_monitor
cd sensor_monitor
# On non Rasbperry Pi machine (dev)
pip3 install -r requirements.txt
# On Raspberry Pi
pip3 install -r requirements.txt -r requirements-RPi.txt
This is required to allow listening on port 80 without sudo
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown pi /etc/authbind/byport/80
This makes sensor_monitor run as a service and on boot
sudo ln -s $PWD/sensor_monitor.conf /etc/supervisor/conf.d/sensor_monitor.conf
sudo supervisorctl reread
sudo service supervisor restart
authbind gunicorn --bind 0.0.0.0:80 run:app
Edit application/config.py
and adjust pins to sensors/devices connected to Raspberry Pi GPIO
Sensor logic resides in application/devices.py
- Add multiplatform docker builds (armv7,armv8,arm64)
- Notifications
- Alerts (IFTTT like)
- InfluxDB
- Web authentication
- Web configuration (Sensors, notifications, etc)