Merge branch 'master' of github.com:0110/PlantCtrl

This commit is contained in:
Empire 2023-07-20 20:11:58 +02:00
commit 6d5f68fab5
5 changed files with 21 additions and 8 deletions

View File

@ -80,14 +80,24 @@
/** \addtogroup Configuration /** \addtogroup Configuration
* @{ * @{
*/ */
#define FIRMWARE_VERSION "2.71 HW0.10b"
#define TIMED_LIGHT_PIN CUSTOM1_PIN5
#define FLOWMETER_PIN CUSTOM1_PIN1
#ifdef FLOWMETER_PIN #ifdef FLOWMETER_PIN
#define FLOWMETER_PULSES_PER_ML 2.2 #define FLOWMETER_PULSES_PER_ML 2.2
#define FIRMWARE_FEATURE1 "Flow"
#else
#define FIRMWARE_FEATURE1 ""
#endif #endif
#ifdef TIMED_LIGHT_PIN
#define FIRMWARE_FEATURE2 "Light"
#else
#define FIRMWARE_FEATURE2 ""
#endif
#define FIRMWARE_BASENAME "PlantControl"
#define FIRMWARE_NAME FIRMWARE_BASENAME FIRMWARE_FEATURE1 FIRMWARE_FEATURE2
#define FIRMWARE_VERSION "2.71 HW0.10b"
#define MOIST_SENSOR_MAX_FRQ 5200 // 60kHz (500Hz margin) #define MOIST_SENSOR_MAX_FRQ 5200 // 60kHz (500Hz margin)
#define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin) #define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin)

View File

@ -20,6 +20,9 @@ build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
-DPLANT4_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE -DPLANT4_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT5_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE -DPLANT5_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DPLANT6_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE -DPLANT6_SENSORTYPE=FREQUENCY_MOD_RESISTANCE_PROBE
-DTIMED_LIGHT_PIN=CUSTOM1_PIN5
-DFLOWMETER_PIN=CUSTOM1_PIN1
board_build.partitions = defaultWithSmallerSpiffs.csv board_build.partitions = defaultWithSmallerSpiffs.csv
;#https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html ;#https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

View File

@ -230,8 +230,8 @@ void Plant::activatePump(void)
ledcWrite(this->mPlantId, desiredPowerLevelPercent * PWM_BITS); ledcWrite(this->mPlantId, desiredPowerLevelPercent * PWM_BITS);
if (this->mConnected) if (this->mConnected)
{ {
const String OFF = String("ON"); const String ON = String("ON");
this->mPlant->setProperty("switch").send(OFF); this->mPlant->setProperty("switch").send(ON);
this->mPlant->setProperty("lastPump").send(String(getCurrentTime())); this->mPlant->setProperty("lastPump").send(String(getCurrentTime()));
} }
} }

View File

@ -704,7 +704,7 @@ void pumpActiveLoop()
} }
bool mqttUpdateTick = false; bool mqttUpdateTick = false;
if (lastSendPumpUpdate + 1000 < millis()) if (lastSendPumpUpdate + 3000 < millis())
{ {
lastSendPumpUpdate = millis(); lastSendPumpUpdate = millis();
mqttUpdateTick = true; mqttUpdateTick = true;
@ -808,7 +808,7 @@ void safeSetup()
} }
/************************* Start Homie Framework ***************/ /************************* Start Homie Framework ***************/
Homie_setFirmware("PlantControl", FIRMWARE_VERSION); Homie_setFirmware(FIRMWARE_NAME, FIRMWARE_VERSION);
Homie.disableLedFeedback(); Homie.disableLedFeedback();
Homie_setBrand("PlantControl"); Homie_setBrand("PlantControl");
// Set default values // Set default values