To provide a way to measure and record environmental data in a greenhouse and
be able to present that data in a meaningful web application that allows for
insightful interpretation of the data. The projects first iteration was to implement
a web application that displays four primary units of measurement: temperature, humidity, pressure
and light. As well as configuring and putting together the rasberry PIs for each individual
room in the greenhouse, building scripts to send measurement data to the backend server, etc.
Future iterations may include controlling function within the opening of shades
or even changing the temperature of the greenhouse itself.
Within the Docs folder is a collection of the Greenwatch's project documentation including various UML diagrams as well as other documents that were used for the development of the project itself. Reference this folder for any questions you have about the purpose, architecture, or even the code itself.
To get the application running in a test/development environment all you need is a machine with python 3.6 or higher and pip installed as the primary package manager. Also, you will want to use git to clone the repo and follow the below steps.
- clone the repo into a directory of your choice and tunnel into the root of the project
- git clone https://github.com/gramcracker40/GreenWatch.git
- cd GreenWatch
if you would like to do it with a virtual environment build it now and activate pip install virtualenv virtualenv venv 'source ./venv/Scripts/activate' Windows 'source ./venv/bin/activate' Bash
- we will now install all packages needed to run the application, run this command
pip install -r requirements.txt
All packages should be downloaded.
5. Next, go to /.flaskenv and open the contents.
Below lines detail the configuration you need in .flaskenv to run the app locally.
Make the changes to reflect the lines below and save the file.
FLASK_DEBUG=1
PRODUCTION=0
SERVER_IP="127.0.0.1:5000"
- Now in the root directory of the repo type the below command into a terminal
flask run
You now are running Greenwatch and will be brought to the login page of the server when you go to the 127.0.0.1:5000 in your browser.
If you are going to do the docker options, It is expected of you to have used
docker and have it installed ready to use.
-
simply from the root access type the below commands
docker-compose --file docker-compose.yml build
docker-compose --file docker-compose.yml up -
If you would like to change any details about the database simply go to
/.flaskenv and you would find all variables needed to configure the connection
string to the postgresql database.
-
go to /.flaskenv and change these values
FLASK_DEBUG=0
PRODUCTION=1
SERVER_IP="Public ip of server (ex: 40.122.52.52)" -
simply from the root access type the below commands
docker-compose --file docker-compose.prod.yml build
docker-compose --file docker-compose.prod.yml up -
you now have three seperate containers all working in conjunction with one another
firstly, the python flask app using gunicorn as the WSGI server on alpine linux
secondly, the postgreSQL database you configured in /.flaskenv
thirdly, the nginx web server running on port 80
The UserInterface folder includes all of the static html files, the javascript files that
manipulate DOM to create dynamic html files, and the css files that style the login page. There are also javascript utility scripts that include
functions that are repeatedly used accross multiple files. The javascript files making the API fetch requests are also stored within the [UserInterface]
(https://github.com/gramcracker40/GreenWatch/tree/main/UserInterface) folder.
Backend Contains the code of the [Agents]
(https://github.com/gramcracker40/GreenWatch/tree/main/Backend/Agents), that run on the Raspberry Pi to take sensor data, and the [GreenhouseServer]
(https://github.com/gramcracker40/GreenWatch/tree/main/Backend/GreenhouseServer) that acts as a proxy to push the agent data from the greenhouse to
whatever remote server is running the Greenwatch application.
Hardware Contains information about the hardware used to take
the measurement data and any setup processes we used to get them to where they needed to be in order to work with Greenwatch.
- Garrett Mathers: Project Lead & Backend
- Kolten Pulliam: Frontend & API
- Derrick Pollock: Frontend & GUI
- Edwin Mondragon: Hardware
- June Portillo: Misc.