Controller for a smart garden written in Python
- Install pip (Raspberry Pi:
sudo apt install python3-pip
, Arch Linux:sudo pacman -S python-pip
) - Install pipenv (Raspberry Pi:
sudo apt install pipenv
, Arch Linux:sudo pacman -S python-pipenv
) - If you are testing on the Raspberry Pi, run
export PIPENV_PYPI_MIRROR=https://www.piwheels.org/simple
- Run
pipenv install --skip-lock
- Run the program with
pipenv run python src/main.py
A Firebase API config needs to be put in ~/green-garden/config.py
for the controller to work. The IoT controller uses the normal Web API key.
More information on what config.py
needs to contain can be found here: https://github.com/nhorvath/Pyrebase4
Every Green Garden has a unique serial number that users can register in the app. The serial number is stored in the home directory (~/green-garden/serial.txt
).
- To generate a new serial number:
pipenv run python src/main.py --new-serial
- To set the serial number:
pipenv run python src/main.py --set-serial (new serial number)
Generating a new serial number requires a secret password. Users can't change the serial number of their smart garden without the permission of the project group/product owner.
Arduino receives the following:
- 1 - 1000 - (Moisture sensor threshold)
- 1500 - (There is NOT enough water in the tank)
- 2500 - (There is enough water in the tank)