Skip to content

Commit

Permalink
Fixed typo for watering element.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHLee committed May 21, 2023
1 parent 872a560 commit e70fcad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions equipment/water_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
print("Running water pump in pulse mode with " + cs.structs["control_params"]["moisture_feedback"] + "%" + " power...")
relays.actuate_slow_pwm(pin, intensity = float(cs.structs["control_params"]["moisture_feedback"]), wattage=cs.structs["hardware_config"]["equipment_wattage"]["water_pump"], log="water_pump_kwh") #trigger appropriate response
else:
print("Running water pump for " + cs.structs["control_params"]["watering_duration"] + " second(s) every " + cs.structs["control_params"]["watering_interval"] + " day(s)...")
print("Running water pump for " + cs.structs["control_params"]["watering_duration"] + " minute(s) every " + cs.structs["control_params"]["watering_interval"] + " day(s)...")
if (time.time() - float(cs.structs["control_params"]["last_watering_run_time"])) > (float(cs.structs["control_params"]["watering_interval"])*60*60*24): #convert setting (days) to base units (seconds): days*(60*60*24)
cs.write_state("/home/pi/oasis-grow/configs/control_params.json", "last_watering_run_time", str(time.time()), db_writer = dbt.patch_firebase)
relays.actuate_interval_sleep(pin, duration = float(cs.structs["control_params"]["watering_duration"]), sleep = float(cs.structs["control_params"]["watering_interval"]), duration_units="seconds", sleep_units="days", wattage=cs.structs["hardware_config"]["equipment_wattage"]["water_pump"], log="water_pump_kwh")
relays.actuate_interval_sleep(pin, duration = float(cs.structs["control_params"]["watering_duration"]), sleep = float(cs.structs["control_params"]["watering_interval"]), duration_units="minutes", sleep_units="days", wattage=cs.structs["hardware_config"]["equipment_wattage"]["water_pump"], log="water_pump_kwh")
cs.load_state()
time.sleep(1)
except KeyboardInterrupt:
Expand Down
10 changes: 5 additions & 5 deletions minions/Arduino_CSMS/Arduino_CSMS.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const double OpenAirReading = 614; //calibration data 1 Dry Cloth: 614, Open Air:
const double WaterReading = 445; //calibration data 2 Wet Cloth: 445, Submerged: 442
const double OpenAirReading = 606; //calibration data 1 Dry Cloth: 614, Open Air:
const double WaterReading = 430; //calibration data 2 Wet Cloth: 445, Submerged: 442
double MoistureLevel = 0;
double SoilMoisturePercentage = 0;

Expand All @@ -9,9 +9,9 @@ void setup() {

void loop() {
MoistureLevel = analogRead(A0); //update based on the analog Pin selected
Serial.println(MoistureLevel); // Calibration
//Serial.println(MoistureLevel); // Calibration


/*
SoilMoisturePercentage = map(MoistureLevel, OpenAirReading, WaterReading, 0, 100); //map translates raw reading from voltage to moisture

if (SoilMoisturePercentage >= 100)
Expand All @@ -31,7 +31,7 @@ void loop() {

Serial.print("}"); //close the json and issue new line
Serial.println();
*/


delay(1000);
}
2 changes: 1 addition & 1 deletion minions/Arduino_DHT22_12xLEDs/Arduino_DHT22_12xLEDs.ino
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void loop() {
}
}

//Serial.println(led_mode);
Serial.println(led_mode);

delay(20);
}
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
pyserial
protobuf==3.20.*
jwt
python-jwt>=3.3.4
requests>=2.20.0
requests<=2.20.0
Pyrebase
pickle5
Pillow
Expand Down
2 changes: 1 addition & 1 deletion setup_scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ maturin build --release
echo "Installing Python3 Root Dependencies for OS..."
sudo apt-get -y install python3-rpi.gpio #GPIO Pin Access
sudo apt install python3-opencv -y #Image Processing with GPU
sudo pip3 install click==8.0.4 streamlit==0.62.0 pickle5 pyrebase #Network Setup
sudo pip3 install click==8.0.4 streamlit==0.62.0 pickle5 pyrebase protobuf==3.20.*
sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel #Raspi LED Driver (replace with WSB)
sudo python3 -m pip install --force-reinstall adafruit-blinka #Raspi LED Driver

0 comments on commit e70fcad

Please sign in to comment.