fix uptime calculation

This commit is contained in:
2018-04-27 10:49:00 +02:00
parent cc511464a0
commit 6c78b83de2
3 changed files with 7 additions and 7 deletions

View File

@ -29,7 +29,6 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/pubsubclient}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/pubsubclient}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/libraries/OneWire-master}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/libraries/OneWire-master}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/ds18b20}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/ds18b20}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/onewire}&quot;"/>
</option> </option>
<inputType id="io.sloeber.compiler.cpp.sketch.input.587259888" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/> <inputType id="io.sloeber.compiler.cpp.sketch.input.587259888" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/>
</tool> </tool>
@ -45,7 +44,6 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/pubsubclient}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/pubsubclient}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/libraries/OneWire-master}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/libraries/OneWire-master}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/ds18b20}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/ds18b20}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RainSensor/onewire}&quot;"/>
</option> </option>
<inputType id="io.sloeber.compiler.c.sketch.input.931476786" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/> <inputType id="io.sloeber.compiler.c.sketch.input.931476786" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/>
</tool> </tool>

View File

@ -184,10 +184,10 @@ environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DT
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DTS/value=3600 environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.DTS/value=3600
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/value=1524742685 environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.LOCAL/value=1524816391
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/value=1524735485 environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.UTC/value=1524809191
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/value=3600 environment/project/io.sloeber.core.toolChain.release.1856809793/A.EXTRA.TIME.ZONE/value=3600
@ -466,10 +466,10 @@ environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NA
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NAME/value=NodeMCU 1.0 (ESP-12E Module) environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.BOARD_NAME/value=NodeMCU 1.0 (ESP-12E Module)
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/value=/dev/ttyUSB5 environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.COM_PORT/value=/dev/ttyUSB4
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/value=${eclipse_home}//////////////////////////////////////////// environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.ECLIPSE_LOCATION/value=${eclipse_home}/////////////////////////////////////////////////
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/delimiter=\: environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/delimiter=\:
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/operation=replace environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/operation=replace
environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/value= environment/project/io.sloeber.core.toolChain.release.1856809793/JANTJE.EXTRA.ALL/value=

View File

@ -159,6 +159,7 @@ void loopProduction() {
static uint32_t lastUptimeMillis = 0; static uint32_t lastUptimeMillis = 0;
if (currentMillis > (lastUptimeMillis + 1000)) { if (currentMillis > (lastUptimeMillis + 1000)) {
lastUptimeMillis = currentMillis;
uptime++; uptime++;
} }
@ -174,6 +175,7 @@ void loopProduction() {
interrupts(); interrupts();
#ifdef DEBUG #ifdef DEBUG
Serial.print(rainCnt); Serial.print(rainCnt);
Serial.println();
#endif #endif
// battery voltage // battery voltage
@ -200,7 +202,7 @@ void loopProduction() {
// MQTT publishing // MQTT publishing
#define BUF_SIZE 128 #define BUF_SIZE 256
char buf[BUF_SIZE]; char buf[BUF_SIZE];
snprintf(buf, BUF_SIZE-1, "{\"raincnt\":%ld, \"battery\":%d.%d, \"uptime\":%ld, \"temperature\":%ld.%ld}", rainCnt, b1, b2, uptime, t1, t2); snprintf(buf, BUF_SIZE-1, "{\"raincnt\":%ld, \"battery\":%d.%d, \"uptime\":%ld, \"temperature\":%ld.%ld}", rainCnt, b1, b2, uptime, t1, t2);
client.publish(configBlock.mqttTopic, buf); client.publish(configBlock.mqttTopic, buf);