Software used to monitor climate variables when growing vegetables and plants.
Find a file
2023-05-23 00:00:00 +00:00
app feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
docs Suitable readme 2020-03-25 04:52:59 +01:00
systemd Test / dev CI/CD 2019-11-15 00:14:21 +01:00
.gitignore Removed .idea dir 2020-09-09 00:18:06 +02:00
.gitlab-ci.yml Test / dev CI/CD 2019-11-15 00:14:21 +01:00
ancs.py feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2019-10-26 21:48:20 +02:00
conftest.py feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
LICENSE Suitable readme 2020-03-25 04:52:59 +01:00
MANIFEST.in feat!: add suport for REST API; fixed double metrics collector fired by WZ in debug mode; added basics for EZO pH calibration 2023-05-15 00:00:00 +00:00
pytest.ini test: setup for pytest and base tweaks for py39 2023-05-18 00:00:00 +00:00
README.md feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
requirements-dev.txt feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
requirements.txt feat: working pytest configuration; unit test for bme280; fixed invalid altitude readings; improved handling some instance / class params; fixed BME280 issues due to upgraded library 2023-05-23 00:00:00 +00:00
setup.py test: setup for pytest and base tweaks for py39 2023-05-18 00:00:00 +00:00
tox.ini test: setup for pytest and base tweaks for py39 2023-05-18 00:00:00 +00:00
uwsgi.ini feat!: add suport for REST API; fixed double metrics collector fired by WZ in debug mode; added basics for EZO pH calibration 2023-05-15 00:00:00 +00:00
wsgi.py feat!: add suport for REST API; fixed double metrics collector fired by WZ in debug mode; added basics for EZO pH calibration 2023-05-15 00:00:00 +00:00

GitHub

ANCS

Software used to monitor climate variables when growing vegetables and plants.

As of yet it is in an early but working beta if you have the same sensors as my own setup, which consists of:

Disclaimer

This list is given so you can compare what you have to what's implemented, I am in no way affiliated to this particular shop (I just like being able to order everything I need on a single webshop, and they offer the T3).

The documentation is currently not my point of focus but it will get better in time.

How it works

The app is to be run by uWSGI and registers available sensors via a system of drop-ins. Each drop-in allows for the app to perform periodic calls to take measures (or perform any type of task really) and expose them using Prometheus.

Prometheus is then queried by Grafana which in turns displays nice graphs for monitoring like so:

Installation

Requirements

Tested on Python 3.9.2. Latest pip version. Rustc >= 1.48

sudo apt install -y libgpiod-dev i2c-tools
sudo raspi-config nonint do_i2c 0

python3 -m virtualenv venv
source venv/bin/activate
python3 -m pip install -r requirements-dev.txt # or requirements.txt

WARNING

Under construction, more will come later.

Usage

Environment variables

Project variables

  • SEA_LEVEL_PRESSURE: specify the pressure at your location to obtain more accurate readings from the BME280 chip,

Flask variables:

  • FLASK_ENV: development or production, used to alter Flask's env,
  • FLASK_APP: should be ancs.py:app by default in dev mode,
  • FLASK_DEBUG: enable debug mode,
  • LOG_LEVEL: log level for the debugger

Running tests python3 -m pytest .

Running in dev mode SEA_LEVEL_PRESSURE=1017 FLASK_APP="ancs.py:app" FLASK_ENV=development FLASK_DEBUG=0 LOG_LEVEL=DEBUG python3 -u -m flask run --host=0.0.0.0 --port=8000

If you can find your way around this yourself, install python3, all required dependencies, and fire uWSGI like so: LOG_LEVEL=DEBUG uwsgi uwsgi.ini

The --enable-threads is mandatory, else the background watcher will not start.