Compare commits
9 commits
firmware_v
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
86c21ab864 | ||
|
0fe2b80b5c | ||
|
32cd179a69 | ||
|
5b56c8bc86 | ||
|
593220d6cf | ||
|
abb79ebecc | ||
|
c80ac2e6f6 | ||
|
ce7f2b6ec4 | ||
|
483632fbdf |
15 changed files with 8280 additions and 24 deletions
24
.gitmodules
vendored
Normal file
24
.gitmodules
vendored
Normal 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
|
|
@ -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"
|
||||||
|
|
|
@ -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;
|
||||||
|
|
13
Arduino/CanGrow/CanGrow_Version.h
Normal file
13
Arduino/CanGrow/CanGrow_Version.h
Normal 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
|
|
@ -239,6 +239,12 @@ void SysMaintenance() {
|
||||||
} else {
|
} else {
|
||||||
body += "<div class='warnmsg'>💧 Cannot activate, <i>Pump mode</i> is set to <i>Off</i> in 🔆 Grow settings</div>";
|
body += "<div class='warnmsg'>💧 Cannot activate, <i>Pump mode</i> is set to <i>Off</i> in 🔆 Grow settings</div>";
|
||||||
}
|
}
|
||||||
|
} else if(webserver.hasArg("PumpOffManual")) {
|
||||||
|
// stooop
|
||||||
|
setOutput(3, 0);
|
||||||
|
PumpOnManual = false;
|
||||||
|
PumpOnTimePassed = 0;
|
||||||
|
body += "<div class='infomsg'>💧 Pump manual stopped</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,11 +253,10 @@ void SysMaintenance() {
|
||||||
body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>⛅ On</a> <a class='button' href='/system/maintenance?DimmOff=1'>⏹️ Off</a><br><br><br>";
|
body += "Dimm LED <a class='button' href='/system/maintenance?DimmOn=1'>⛅ On</a> <a class='button' href='/system/maintenance?DimmOff=1'>⏹️ Off</a><br><br><br>";
|
||||||
body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>💧 Activate for ";
|
body += "Pump manual <a class='button' href='/system/maintenance?PumpOnManual=1'>💧 Activate for ";
|
||||||
body += PumpOnTime;
|
body += PumpOnTime;
|
||||||
body += "s</a><br>";
|
body += "s</a> ";
|
||||||
|
body += "<a class='button' href='/system/maintenance?PumpOffManual=1'>🛑 Stop manual</a><br>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
body += FPSTR(HTMLfooter);
|
body += FPSTR(HTMLfooter);
|
||||||
webserver.send(200, "text/html", body);
|
webserver.send(200, "text/html", body);
|
||||||
}
|
}
|
||||||
|
@ -378,7 +383,7 @@ void WEBroot() {
|
||||||
body += returnStrDateFromEpoch(GrowStart);
|
body += returnStrDateFromEpoch(GrowStart);
|
||||||
body += "<br>\n";
|
body += "<br>\n";
|
||||||
body += "<b>Harvest date (est.): 🍂 </b> ";
|
body += "<b>Harvest date (est.): 🍂 </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 |
1
Arduino/CanGrow/lib/Adafruit-GFX-Library
Submodule
1
Arduino/CanGrow/lib/Adafruit-GFX-Library
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit d4720987895bc49bdb38beb9d3e288de8bd59078
|
1
Arduino/CanGrow/lib/Adafruit_BME280_Library
Submodule
1
Arduino/CanGrow/lib/Adafruit_BME280_Library
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9412f3d1a2e334a3415d79df706dad02925488aa
|
1
Arduino/CanGrow/lib/Adafruit_SHT31
Submodule
1
Arduino/CanGrow/lib/Adafruit_SHT31
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 5e34a20df62371150f7cb10330919e9393b884b1
|
1
Arduino/CanGrow/lib/Adafruit_SSD1306
Submodule
1
Arduino/CanGrow/lib/Adafruit_SSD1306
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 78d6a130b2045a8b7b76616da81603796757ed47
|
1
Arduino/CanGrow/lib/Adafruit_Sensor
Submodule
1
Arduino/CanGrow/lib/Adafruit_Sensor
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 7b2473b6b24ae340f41685b5f5b2b90ad896db04
|
8204
Arduino/CanGrow/lib/ArduinoJson/ArduinoJson-v7.2.1.h
Normal file
8204
Arduino/CanGrow/lib/ArduinoJson/ArduinoJson-v7.2.1.h
Normal file
File diff suppressed because it is too large
Load diff
1
Arduino/CanGrow/lib/NTPClient
Submodule
1
Arduino/CanGrow/lib/NTPClient
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 61684d4516839b579b81105be3447499c1417908
|
1
Arduino/CanGrow/lib/Time
Submodule
1
Arduino/CanGrow/lib/Time
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a18e50dcea4ee17285d732d39e7bc559482d1d3d
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue