30#define PROJECT_PATH (__FILE__)
34#define BRANCH_NAME ("N/A")
37#define COMMIT_HASH ("N/A")
42 DBUGLN(F(
"----------------------------------"));
43 DBUG(F(
"Sketch ID: "));
46 DBUG(F(
"From branch '"));
48 DBUG(F(
"', commit "));
59 DBUGLN(F(
"ADC mode: free-running"));
61 DBUGLN(F(
"Electrical settings"));
64 DBUG(F(
"\tf_powerCal for L"));
69 DBUG(F(
"\tf_voltageCal, for Vrms_L"));
75 DBUG(F(
"\tf_phaseCal for all phases = "));
78 DBUG(F(
"\tExport rate (Watts) = "));
81 DBUG(F(
"\tzero-crossing persistence (sample sets) = "));
86 DBUG(F(
"Temperature capability "));
93 DBUGLN(F(
"is NOT present"));
96 DBUG(F(
"Dual-tariff capability "));
104 DBUGLN(F(
"is NOT present"));
107 DBUG(F(
"Load rotation feature "));
114 DBUGLN(F(
"is NOT present"));
117 DBUG(F(
"Relay diversion feature "));
126 DBUGLN(F(
"is NOT present"));
129 DBUG(F(
"RF capability "));
131 DBUG(F(
"IS present, Freq = "));
132 if (
FREQ == RF12_433MHZ)
134 else if (
FREQ == RF12_868MHZ)
138 DBUGLN(F(
"is NOT present"));
141 DBUG(F(
"Datalogging capability "));
145 DBUGLN(F(
"is NOT present"));
159 Serial.print(F(
"P:"));
165 Serial.print(F(
",P"));
166 Serial.print(idx + 1);
167 Serial.print(F(
":"));
168 Serial.print(
tx_data.power_L[idx]);
173 Serial.print(F(
",L"));
174 Serial.print(idx + 1);
175 Serial.print(F(
":"));
189 Serial.print(F(
",T"));
190 Serial.print(idx + 1);
191 Serial.print(F(
":"));
192 Serial.print(
tx_data.temperature_x100[idx] * 0.01F);
199 Serial.print(F(
",T:"));
200 Serial.print(bOffPeak ?
"low" :
"high");
202 Serial.println(F(
""));
214 Serial.print(F(
", P:"));
219 Serial.print(F(
", P"));
220 Serial.print(phase + 1);
221 Serial.print(F(
":"));
222 Serial.print(
tx_data.power_L[phase]);
226 Serial.print(F(
", V"));
227 Serial.print(phase + 1);
228 Serial.print(F(
":"));
229 Serial.print((
float)
tx_data.Vrms_L_x100[phase] * 0.01F);
242 Serial.print(F(
", T"));
243 Serial.print(idx + 1);
244 Serial.print(F(
":"));
245 Serial.print((
float)
tx_data.temperature_x100[idx] * 0.01F);
249 Serial.println(F(
")"));
261 Serial.print(F(
", P:"));
266 Serial.print(F(
"/"));
272 Serial.print(F(
", P"));
273 Serial.print(phase + 1);
274 Serial.print(F(
":"));
275 Serial.print(
tx_data.power_L[phase]);
279 Serial.print(F(
", V"));
280 Serial.print(phase + 1);
281 Serial.print(F(
":"));
282 Serial.print((
float)
tx_data.Vrms_L_x100[phase] * 0.01F);
295 Serial.print(F(
", T"));
296 Serial.print(idx + 1);
297 Serial.print(F(
":"));
298 Serial.print((
float)
tx_data.temperature_x100[idx] * 0.01F);
302 Serial.print(F(
", (minSampleSets/MC "));
304 Serial.print(F(
", #ofSampleSets "));
309 Serial.print(F(
", NoED "));
313 Serial.println(F(
")"));
323 static bool startup{
true };
344#if defined SERIALPRINT && !defined EMONESP
357 DBUGLN(F(
"Load Priorities: "));
374 extern int __heap_start, *__brkval;
376 return (
int)&v - (__brkval == 0 ? (int)&__heap_start : (
int)__brkval);
Calibration values definition.
constexpr float f_phaseCal
constexpr float f_voltageCal[NO_OF_PHASES]
constexpr float f_powerCal[NO_OF_PHASES]
static auto get_average()
Get the current average.
void printConfiguration() const
Print the configuration of each relay.
constexpr auto get_size() const
Get the number of sensors.
constexpr bool RELAY_DIVERSION
constexpr int networkGroup
constexpr TemperatureSensing temperatureSensing
constexpr RelayEngine relays
constexpr bool DUAL_TARIFF
constexpr bool EMONESP_CONTROL
constexpr uint8_t NO_OF_DUMPLOADS
constexpr int16_t REQUIRED_EXPORT_IN_WATTS
constexpr float invDATALOG_PERIOD_IN_MAINS_CYCLES
constexpr float invSUPPLY_FREQUENCY
constexpr uint8_t NO_OF_PHASES
constexpr int16_t DEVICE_DISCONNECTED_RAW
constexpr int16_t OUTOFRANGE_TEMPERATURE
Classes/types needed for dual-tariff support.
void printDualTariffConfiguration()
Print the settings for off-peak period.
void printParamsForSelectedOutputMode()
Print the settings used for the selected output mode.
Public functions/variables of processing engine.
volatile uint8_t copyOf_lowestNoOfSampleSetsPerMainsCycle
constexpr uint8_t PERSISTENCE_FOR_POLARITY_CHANGE
uint8_t loadPrioritiesAndState[NO_OF_DUMPLOADS]
volatile float copyOf_energyInBucket_main
volatile uint16_t copyOf_sampleSetsDuringThisDatalogPeriod
volatile uint32_t absenceOfDivertedEnergyCount
PayloadTx_struct< NO_OF_PHASES > tx_data
volatile uint16_t copyOf_countLoadON[NO_OF_DUMPLOADS]
void printForSerialJson()
Prints data logs to the Serial output in Json format.
void printConfiguration()
Print the configuration during start.
int freeRam()
Get the available RAM during setup.
void printForEmonESP(const bool bOffPeak)
Write on Serial in EmonESP format.
void sendResults(bool bOffPeak)
Prints data logs to the Serial output in text or json format.
void printForSerialText()
Prints data logs to the Serial output in text format.
void logLoadPriorities()
Prints the load priorities to the Serial output.
Some utility functions for the RF chip.
void send_rf_data()
Send the logging data through RF.
Some utility functions for temperature sensor(s)
constexpr bool TEMP_SENSOR_PRESENT