Compare commits

...

9 commits

15 changed files with 8280 additions and 24 deletions

24
.gitmodules vendored Normal file
View file

@ -0,0 +1,24 @@
[submodule "Arduino/CanGrow/Adafruit-GFX-Library"]
path = Arduino/CanGrow/Adafruit-GFX-Library
url = https://github.com/adafruit/Adafruit-GFX-Library
[submodule "Arduino/CanGrow/lib/Adafruit-GFX-Library"]
path = Arduino/CanGrow/lib/Adafruit-GFX-Library
url = https://github.com/adafruit/Adafruit-GFX-Library
[submodule "Arduino/CanGrow/lib/Adafruit_SSD1306"]
path = Arduino/CanGrow/lib/Adafruit_SSD1306
url = https://github.com/adafruit/Adafruit_SSD1306
[submodule "Arduino/CanGrow/lib/Adafruit_BME280_Library"]
path = Arduino/CanGrow/lib/Adafruit_BME280_Library
url = https://github.com/adafruit/Adafruit_BME280_Library/
[submodule "Arduino/CanGrow/lib/NTPClient"]
path = Arduino/CanGrow/lib/NTPClient
url = https://github.com/arduino-libraries/NTPClient
[submodule "Arduino/CanGrow/lib/Time"]
path = Arduino/CanGrow/lib/Time
url = https://github.com/PaulStoffregen/Time
[submodule "Arduino/CanGrow/lib/Adafruit_SHT31"]
path = Arduino/CanGrow/lib/Adafruit_SHT31
url = https://github.com/adafruit/Adafruit_SHT31/
[submodule "Arduino/CanGrow/lib/Adafruit_Sensor"]
path = Arduino/CanGrow/lib/Adafruit_Sensor
url = https://github.com/adafruit/Adafruit_Sensor

View file

@ -4,20 +4,12 @@
*/ */
// set CANGROW_VER and CANGROW_BUILD if not already done as Compiler Flag
#ifndef CANGROW_VER
#define CANGROW_VER "0.0.0-dev"
#endif
#ifndef CANGROW_BUILD
#define CANGROW_BUILD "1a2b3c4-0000000000000"
#endif
/* /*
* Includes * Includes
* *
*/ */
// Libraries // Libraries internal (Arduino Core / ESP)
// https://github.com/arduino/ArduinoCore-avr/tree/master/libraries/SPI // https://github.com/arduino/ArduinoCore-avr/tree/master/libraries/SPI
#include <SPI.h> #include <SPI.h>
// https://github.com/arduino/ArduinoCore-avr/tree/master/libraries/Wire // https://github.com/arduino/ArduinoCore-avr/tree/master/libraries/Wire
@ -31,32 +23,40 @@
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
// OTA update // OTA update
#include <ESP8266HTTPUpdateServer.h> #include <ESP8266HTTPUpdateServer.h>
// Libraries external
// https://github.com/adafruit/Adafruit-GFX-Library // https://github.com/adafruit/Adafruit-GFX-Library
//include "lib/Adafruit-GFX-Library/Adafruit_GFX.h"
#include <Adafruit_GFX.h> #include <Adafruit_GFX.h>
// https://github.com/adafruit/Adafruit_SSD1306 // https://github.com/adafruit/Adafruit_SSD1306
//include "lib/Adafruit_SSD1306/Adafruit_SSD1306.h"
#include <Adafruit_SSD1306.h> #include <Adafruit_SSD1306.h>
// https://github.com/adafruit/Adafruit_BME280_Library/ // https://github.com/adafruit/Adafruit_Sensor
// include "lib/Adafruit_Sensor/Adafruit_Sensor.h"
#include <Adafruit_Sensor.h> #include <Adafruit_Sensor.h>
// https://github.com/adafruit/Adafruit_BME280_Library
//include "lib/Adafruit_BME280_Library/Adafruit_BME280.h"
#include <Adafruit_BME280.h> #include <Adafruit_BME280.h>
// https://github.com/adafruit/Adafruit_SHT31/
//#include "lib/Adafruit_SHT31/Adafruit_SHT31.h"
#include <Adafruit_SHT31.h>
// https://github.com/bblanchon/ArduinoJson // https://github.com/bblanchon/ArduinoJson
#include <ArduinoJson.h> #include "lib/ArduinoJson/ArduinoJson-v7.2.1.h"
// https://github.com/arduino-libraries/NTPClient // https://github.com/arduino-libraries/NTPClient
//#include "lib/NTPClient/NTPClient.h"
#include <NTPClient.h> #include <NTPClient.h>
// https://github.com/PaulStoffregen/Time // https://github.com/PaulStoffregen/Time
//#include "lib/Time/TimeLib.h"
#include <TimeLib.h> #include <TimeLib.h>
// DHT support dropped // DHT support dropped
// https://github.com/adafruit/DHT-sensor-library // https://github.com/adafruit/DHT-sensor-library
// #include "DHT.h" // #include "DHT.h"
// SHT30/31
// https://github.com/adafruit/Adafruit_SHT31/
#include "Adafruit_SHT31.h"
/* /*
* CanGrow header files * CanGrow header files
*/ */
#include "CanGrow_Version.h"
#include "CanGrow_PinAssignments.h" #include "CanGrow_PinAssignments.h"
#include "CanGrow_Init.h" #include "CanGrow_Init.h"
#include "CanGrow_Logo.h" #include "CanGrow_Logo.h"

View file

@ -736,6 +736,7 @@ void controlPUMP() {
PumpOnManual = false; PumpOnManual = false;
setOutput(3, 0); setOutput(3, 0);
//digitalWrite(PinPUMP, LOW); //digitalWrite(PinPUMP, LOW);
PumpLastOn = timeClient.getEpochTime();
EEPROM.put(237, PumpLastOn); EEPROM.put(237, PumpLastOn);
EEPROM.commit(); //write to EEPROM EEPROM.commit(); //write to EEPROM
PumpOnTimePassed = 0; PumpOnTimePassed = 0;

View file

@ -0,0 +1,13 @@
/*
*
*
* Version
*
*
*/
#define CANGROW_VER "0.1.4"
// CANGROW_BUILD default dummy value if not set as Compiler Flag
#ifndef CANGROW_BUILD
#define CANGROW_BUILD "1a2b3c4-0000000000000"
#endif

View file

@ -239,6 +239,12 @@ void SysMaintenance() {
} else { } else {
body += "<div class='warnmsg'>&#x1F4A7; Cannot activate, <i>Pump mode</i> is set to <i>Off</i> in &#128262; Grow settings</div>"; body += "<div class='warnmsg'>&#x1F4A7; Cannot activate, <i>Pump mode</i> is set to <i>Off</i> in &#128262; Grow settings</div>";
} }
} else if(webserver.hasArg("PumpOffManual")) {
// stooop
setOutput(3, 0);
PumpOnManual = false;
PumpOnTimePassed = 0;
body += "<div class='infomsg'>&#x1F4A7; Pump manual stopped</div>";
} }
@ -247,9 +253,8 @@ void SysMaintenance() {
body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>&#x26C5; On</a>&nbsp;&nbsp;<a class='button' href='/system/maintenance?DimmOff=1'>&#x23F9;&#xFE0F; Off</a><br><br><br>"; body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>&#x26C5; On</a>&nbsp;&nbsp;<a class='button' href='/system/maintenance?DimmOff=1'>&#x23F9;&#xFE0F; Off</a><br><br><br>";
body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>&#x1F4A7; Activate for "; body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>&#x1F4A7; Activate for ";
body += PumpOnTime; body += PumpOnTime;
body += "s</a><br>"; body += "s</a>&nbsp;&nbsp;";
body += "<a class='button' href='/system/maintenance?PumpOffManual=1'>&#x1F6D1; Stop manual</a><br>";
body += FPSTR(HTMLfooter); body += FPSTR(HTMLfooter);
@ -378,7 +383,7 @@ void WEBroot() {
body += returnStrDateFromEpoch(GrowStart); body += returnStrDateFromEpoch(GrowStart);
body += "<br>\n"; body += "<br>\n";
body += "<b>Harvest date (est.): &#x1F342; </b> "; body += "<b>Harvest date (est.): &#x1F342; </b> ";
body += returnStrDateFromEpoch(GrowStart + (60 * 60 * 24 * (DaysVeg + DaysVeg) ) ); body += returnStrDateFromEpoch(GrowStart + (60 * 60 * 24 * (DaysVeg + DaysBloom) ) );
body += "<br>\n"; body += "<br>\n";
body += "<b>Day of Grow: </b> "; body += "<b>Day of Grow: </b> ";
if(DayNight == true) { if(DayNight == true) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 372 KiB

@ -0,0 +1 @@
Subproject commit d4720987895bc49bdb38beb9d3e288de8bd59078

@ -0,0 +1 @@
Subproject commit 9412f3d1a2e334a3415d79df706dad02925488aa

@ -0,0 +1 @@
Subproject commit 5e34a20df62371150f7cb10330919e9393b884b1

@ -0,0 +1 @@
Subproject commit 78d6a130b2045a8b7b76616da81603796757ed47

@ -0,0 +1 @@
Subproject commit 7b2473b6b24ae340f41685b5f5b2b90ad896db04

File diff suppressed because it is too large Load diff

@ -0,0 +1 @@
Subproject commit 61684d4516839b579b81105be3447499c1417908

@ -0,0 +1 @@
Subproject commit a18e50dcea4ee17285d732d39e7bc559482d1d3d

View file

@ -3,7 +3,8 @@
test -z $TTY && TTY="/dev/ttyUSB0" test -z $TTY && TTY="/dev/ttyUSB0"
test -z $IP && IP="192.168.4.20" test -z $IP && IP="192.168.4.20"
test -z $VER && VER="0.1.3"
VER="$(grep "define CANGROW_VER" Arduino/CanGrow/CanGrow_Version.h | cut -d \" -f2 |sed -e 's/\"//g')"
BUILD="$(git rev-parse --short HEAD)-$(date '+%Y%m%d%H%M%S')" BUILD="$(git rev-parse --short HEAD)-$(date '+%Y%m%d%H%M%S')"
ACLI="$HOME/.local/bin/arduino-cli" ACLI="$HOME/.local/bin/arduino-cli"
@ -74,7 +75,8 @@ case $1 in
check_acli check_acli
echo ":: Building firmware $VER $BUILD, target dir: $(pwd)/build/" echo ":: Building firmware $VER $BUILD, target dir: $(pwd)/build/"
test -d build || mkdir build test -d build || mkdir build
${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_VER=\"${VER}\" -DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1 ${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1
#${ACLI_CMD} --no-color compile -b ${BOARD} "Arduino/CanGrow/CanGrow.ino" --build-property "build.extra_flags=-DCANGROW_VER=\"${VER}\" -DCANGROW_BUILD=\"${BUILD}\"" --output-dir build/ || exit 1
cp build/CanGrow.ino.bin build/CanGrow_v${VER}_${BUILD}.bin cp build/CanGrow.ino.bin build/CanGrow_v${VER}_${BUILD}.bin
;; ;;
u|upload) u|upload)