Skip to content

The purpose of GreatSage is to provide an automated greenhouse monitoring system.

Notifications You must be signed in to change notification settings

rickypatel38/GreatSage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Live Data Feed:

https://thingspeak.com/channels/1785291

What Is GreatSage?

The purpose of GreatSage is to provide an automated greenhouse monitoring system. The sensors in this project are utilized in order to provide insight into the conditions of the plant growing environment. The sensors will also provide insight in to the pH, electric conductivity, humidity and liquid temperature of the environment. The power for this equipment will be controlled via a "web-power switch" so that the user can control the greenhouse equipment remotely at any given time. The sensors in this system should provide enough data in order to calculate information such as the Vapor Pressure Deficit (VPD) in the growing environment.

Future Updates

Data Points

  • EC (Electric Conductivity)
  • Ambient Humidity
  • Liquid Temperature
  • pH

Hardware / Sensors

Read up on how the sensors work from the links below. Both pH and EC sensors are converted from EZO pins to USB data there is a github link on the atlas scientific website.

Architecture

How do I get set up?

  • Dependencies: The init.sh script will install all of the required dependencies for this project.

  • Pipenv: Run the Pipenv Install then Pipenv Update commands. From there all dependencies should be installed to run this project.

  • Database configuration: Run the db_init.py file within the "sqlite" folder. This will create your sqlite database with the approriate tables.

  • Deployment instructions: Once all the sensors have been wired run the sensor_main.py file in order to store data from the sensors in to the SQLite DB as a test to see if the sensors are properly connected.

  • A .env file with the variables below is required:

    • DLI_PASS = your webpower switch password for remote control of equipment
    • THINGSPEAK_KEY = apikey for thingspeak
  • Run the api_main.py file in order to run the API Service on 0.0.0.0 (your local area network).

Security

  • ToDo: Input validation on all API Endpoints (regex reccomended).
  • ToDo: More defensive coding for the Web Power Switch
  • ToDo: API Token based authentication.
  • Line 20 in api_main.py as * for CORS please replace the wildcard value with the address of the frontend endpoint which will utilize the API.
  • Unforutnately the temperature sensor requires admin access to read sys/bus/w1/devices/w1_slave. This will need to be re-written. A seperate service running on the OS should call the temperature sensor and store it into the DB.
  • It is bad practice to run the API service on a production environment as admin.

Code Cleanup

  • ToDo: More robust error logging on indidivual sensors.
    • pH Sensor Error Catching / Logging
    • EC Sensor Error Catching / Logging
    • DS18B20 Sensor Error Catching / Logging
    • WebPowerSwitch Error Catching / Logging
    • Create an alerting system that alerts if the Raspberry Pi or a sensor is down.

Features

  • Log when Powerswitch is turned off and on in ThingSpeak.
  • Add a "tags" for the powerswitch number i.e. Switch 1 is "Main Lights"

Contribution guidelines

  • To be created / performed:
  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

Notes When Starting

  • Pipenv install --skip-lock will save a lot of headaches the pipfile.lock is bugged for this project.
  • Sudo raspi-config interface options enable 1 wire support in order to read from ds18b20 sensor.

About

The purpose of GreatSage is to provide an automated greenhouse monitoring system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published