12static const uint8_t
Version = 9;
21static const uint8_t MovingAverageDepth = 10;
47 AeroponicsModuleSettings(
bool SerialReportDate =
true,
bool SerialReportMemory =
true,
bool SerialReportJSONFriendly =
true,
bool SerialReportJSON =
true,
bool SerialReportWireless =
true) : SerialReportDate(SerialReportDate), SerialReportMemory(SerialReportMemory), SerialReportJSONFriendly(SerialReportJSONFriendly), SerialReportJSON(SerialReportJSON), SerialReportWireless(SerialReportWireless) {}
58 AeroponicsSettings(uint8_t SpraySolenoidPin = 0,
bool SpraySolenoidNegativeLogic =
false, uint16_t SpraySolenoidClosingDelay = 0, uint16_t TankDrainingTimeout = 0,
bool SprayEnabled =
true,
float Duration = 0.0, uint16_t DayInterval = 0, uint16_t NightInterval = 0,
float MinPressure = 0.0,
float MaxPressure = 0.0) : SpraySolenoidPin(SpraySolenoidPin), SpraySolenoidNegativeLogic(SpraySolenoidNegativeLogic), SpraySolenoidClosingDelay(SpraySolenoidClosingDelay), TankDrainingTimeout(TankDrainingTimeout), SprayEnabled(SprayEnabled), Duration(Duration), DayInterval(DayInterval), NightInterval(NightInterval), MinPressure(MinPressure), MaxPressure(MaxPressure) {}
70 struct AeroponicsSettings AeroT1 = {.
SpraySolenoidPin = 5, .SpraySolenoidNegativeLogic =
true, .SpraySolenoidClosingDelay = 600, .TankDrainingTimeout = 180, .SprayEnabled =
true, .Duration = 1.0, .DayInterval = 6, .NightInterval = 10, .MinPressure = 5.0, .MaxPressure = 7.0};
85 struct SoundSettings Sound1 = {.Pin = 2, .Enabled =
true};
103 struct PressurePumpSettings AeroPump1 = {.
PumpPin = 3, .PumpPinNegativeLogic =
false, .BypassSolenoidPin = 4, .BypassSolenoidNegativeLogic =
true, .BypassSolenoidMaxOpenTime = 180, .BypassSolenoidClosingDelay = 600, .PumpEnabled =
true, .Speed = 70, .SpeedLimitLow = 30, .SpeedLimitHigh = 100, .PumpTimeOut = 420, .PrimingTime = 10, .BlowOffTime = 3};
105 struct WeightSensorSettings
114 uint8_t CompatibilityVersion =
Version;
Settings * loadSettings(bool ResetEEPROM=false)
Load settings from EEPROM.
void restoreDefaults()
Load sketch default settings into EEPROM.
char CurrentTime[MaxWordLength]
Buffer for storing current time in text format.
char LongMessage[MaxLongTextLength]
Temp storage for assembling long messages (REST API, MQTT reporting)
char ShortMessage[MaxShotTextLength]
Temp storage for assembling short text messages (Log entries, Error messages,etc)
void saveSettings(Settings *ToSave)
Store settings in EEPROM - Only updates changed bits.
bool & Debug
True - Turns on extra debug messages on the Serial Output.
bool & Metric
True - Use metric units, False - Use imperial units.
constexpr uint8_t Version
Default Settings for each component within the module. Loaded when the Arduino starts.
constexpr uint16_t WirelessMessageTimeout
(ms) One package should be exchanged within this timeout (Including retries and delays)
constexpr uint8_t WirelessPayloadSize
Size of the wireless packages exchanged with the Main module. Max 32 bytes are supported on nRF24L01+...
constexpr uint8_t WirelessCEPin
nRF24l01+ wireless transmitter CE pin - Pre-connected on RF-Nano
constexpr uint8_t MaxShotTextLength
Default char * buffer length for storing mutiple words. Memory intense!
constexpr uint8_t QueueDepth
Limits the maximum number of active modules. Memory intense!
constexpr uint8_t MaxWordLength
Default char * buffer length for storing a word + null terminator. Memory intense!
constexpr uint16_t MaxLongTextLength
Default char * buffer length for storing a long text. Memory intense!
constexpr uint16_t WirelessReceiveTimeout
(ms) If no packages are received from the Main module over this limit, try reseting the nRF24L01+ wir...
constexpr uint8_t WirelessCSNPin
< nRF24L01+ wireless receiver
constexpr uint8_t WirelessChannel[6]
This needs to be unique and match with the Name of the HempyModule_Web object in the MainModule_Web....
bool SerialReportJSON
Enable/disable sending JSON formatted reports to the Serial output.
bool SerialReportJSONFriendly
Enable/disable sending Text formatted reports to the Serial output.
bool SerialReportMemory
Enable/disable reporting the remaining free memory to the Serial output.
bool SerialReportDate
Enable/disable reporting the current time to the Serial output.
bool SerialReportWireless
Enable/disable sending wireless package exchange reports to the Serial output.
AeroponicsModuleSettings(bool SerialReportDate=true, bool SerialReportMemory=true, bool SerialReportJSONFriendly=true, bool SerialReportJSON=true, bool SerialReportWireless=true)
< Aeroponics_Tank default settings
uint16_t DayInterval
Spray every X minutes - When the lights are ON.
uint16_t NightInterval
Spray every X minutes - When the lights are OFF.
uint16_t TankDrainingTimeout
(sec) How long does it take to fully drain the pressure tank by opening the spray and bypass solenoid...
bool SprayEnabled
Enable/disable spraying cycle.
uint16_t SpraySolenoidClosingDelay
(ms) Time required for the solenoid to close. To avoid draining the tank the bypass valve is not allo...
uint8_t SpraySolenoidPin
Relay controlling DC power to the solenoid.
AeroponicsSettings(uint8_t SpraySolenoidPin=0, bool SpraySolenoidNegativeLogic=false, uint16_t SpraySolenoidClosingDelay=0, uint16_t TankDrainingTimeout=0, bool SprayEnabled=true, float Duration=0.0, uint16_t DayInterval=0, uint16_t NightInterval=0, float MinPressure=0.0, float MaxPressure=0.0)
float Duration
Spray time in seconds (Actual duration is ~0.5sec longer due to thread + solenoid delay)
bool SpraySolenoidNegativeLogic
true - Relay turns on to LOW signal, false - Relay turns on to HIGH signal
float MinPressure
Turn on pump below this pressure.
float MaxPressure
Turn off pump above this pressure.
< PressurePump default settings
uint16_t BypassSolenoidMaxOpenTime
(sec) Max time the bypass can stay open
bool PumpPinNegativeLogic
true - Relay turns on to LOW signal, false - Relay turns on to HIGH signal
bool BypassSolenoidNegativeLogic
true - Relay turns on to LOW signal, false - Relay turns on to HIGH signal
uint16_t PrimingTime
(Sec) For how long to keep the bypass solenoid on when starting the pump - Remove air bubbles from pu...
uint8_t PumpPin
Pump relay pin.
bool PumpEnabled
Enable/disable pump. false= Block running the pump.
uint16_t BlowOffTime
(Sec) For how long to open the bypass solenoid on after turning the pump off - Release pressure from ...
uint8_t SpeedLimitHigh
Maximum allowed speed to prevent over-revving.
uint8_t BypassSolenoidPin
Bypass solenoid relay pin.
uint8_t SpeedLimitLow
Duty cycle limit, does not allow lowering the speed too much. Avoids stalling the motor.
uint8_t Speed
Duty cycle of the PWM Motor speed.
uint16_t BypassSolenoidClosingDelay
(ms) How long it takes for the solenoid to close
uint16_t PumpTimeOut
(Sec) Max pump run time
< PressureSensor default settings
float Offset
Pressure sensor calibration: voltage reading at 0 pressure.
uint8_t Pin
Pressure sensor Pin: Signal(yellow)
float Ratio
Pressure sensor voltage to pressure ratio.
< WeightSensor default settings
uint8_t DTPin
Weight sensor DT pin.