A Django-based environmental monitoring system for Raspberry Pi that collects sensor data and submits the data to a central EnviroHub API for analysis and visualization.
- BME680 Sensor Integration: Collects temperature, humidity, and air pressure measurements
- MH-Z19 Sensor Integration: Monitors CO2 concentration levels
- Automated Data Collection: Django management commands for scheduled sensor readings
- EnviroHub Client: Automatic batch submission of sensor data to central API
- Batch Processing: Configurable batch sizes (default: 1000 records) for efficient data transfer
- Submission Tracking: Maintains submission status to prevent duplicate uploads
- Error Handling: Comprehensive logging with rotating file handlers
- Git
- Python 3.11+ (Installed in Pi OS Bookworm)
- Virtual environment (e.g.
virtualenv) - Raspberry Pi (Tested on Raspberry Pi 3B+)
- BME680 Sensor (temperature, humidity, and air pressure)
- MH-Z19 Sensor (CO2 concentration)
-
Clone repository
git clone https://github.com/Neluxx/enviro-node-pi.git cd enviro-node-pi -
Setup virtual environment
python -m venv venv --system-site-packages source venv/bin/activate -
Install dependencies
# For development (includes testing tools): pip install -r requirements-dev.txt # For production: pip install -r requirements-prod.txt
-
Configure environment variables
cd enviro_node cp .env.example .env nano .env # Edit .env with your configuration
-
Run database migrations
python manage.py migrate
python manage.py sensor_data_collectorpython manage.py sensor_data_submitterpython manage.py sensor_data_resetterpython manage.py testcoverage run manage.py test
coverage report # Generates report in terminal
coverage html # Generates HTML report in ./htmlcov/pre-commit install
pre-commit run --all-filesSee CHANGELOG for version history and updates.
Please open an issue for support.
See LICENSE for details.