15#include "StaticThreadController.h"
20#include "src/Modules/ReservoirModule.h"
21#include "src/WirelessCommands_Reservoir.h"
49 logToSerials(F(
"Reservoir module initializing"),
true, 0);
52 struct ReservoirModuleCommand BlankCommand = {ReservoirMessages::ReservoirModuleCommand1};
53 memcpy(
ReceivedMessage, &BlankCommand,
sizeof(
struct ReservoirModuleCommand));
55 setSyncInterval(3600);
76 logToSerials(F(
"Setup ready, starting loops:"),
true, 0);
81 logToSerials(F(
"(re)Initializing wireless transceiver"),
false, 0);
138 if (timeStatus() != timeSet && ((ReservoirCommonTemplate *)
ReceivedMessage)->SequenceID == ReservoirMessages::ReservoirModuleCommand1)
165 time_t ReceivedTime = ((ReservoirModuleCommand *)
ReceivedMessage)->Time;
166 if (ReceivedTime > 0)
168 setTime(ReceivedTime);
void logToSerials(const __FlashStringHelper *ToPrint, bool BreakLine, uint8_t Indent)
< Logging
Settings * loadSettings(bool ResetEEPROM)
Load settings from EEPROM.
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 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....
RF24 Wireless(WirelessCEPin, WirelessCSNPin)
ReservoirModule * ReservoirMod1
char CurrentTime[MaxWordLength]
Buffer for storing current time in text format.
char LongMessage[MaxLongTextLength]
Temp storage for assembling long messages (REST API, MQTT reporting)
uint32_t ReceivedMessageTimestamp
char ShortMessage[MaxShotTextLength]
Temp storage for assembling short text messages (Log entries, Error messages,etc)
void InitializeWireless()
Settings * ModuleSettings
HardwareSerial & ArduinoSerial
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Co...
struct ReservoirModuleSettings Res1
bool Metric
Switch between Imperial/Metric units. If changed update the default temp and pressure values below to...
bool Debug
Logs debug messages to serial and web outputs.