ignore, totalizer, debug
This commit is contained in:
@ -66,6 +66,7 @@ void loopApplication() {
|
||||
uptime++;
|
||||
}
|
||||
|
||||
static uint32_t totalCnt = 0;
|
||||
static uint32_t lastMillis = 0;
|
||||
if (currentMillis > (lastMillis + (configBlock.valuesPeriod * 1000))) {
|
||||
lastMillis = currentMillis;
|
||||
@ -80,11 +81,12 @@ void loopApplication() {
|
||||
Serial.print(rainCnt);
|
||||
Serial.println();
|
||||
#endif
|
||||
totalCnt += rainCnt;
|
||||
|
||||
// MQTT publishing
|
||||
#define BUF_SIZE 256
|
||||
char buf[BUF_SIZE];
|
||||
snprintf(buf, BUF_SIZE-1, "{\"raincnt\":%ld, \"uptime\":%ld}", rainCnt, uptime);
|
||||
snprintf(buf, BUF_SIZE-1, "{\"raincnt\":%ld, \"totalCnt\":%ld, \"uptime\":%ld}", rainCnt, totalCnt, uptime);
|
||||
mqttClient.publish(configBlock.mqttValuesTopic, buf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user