Wh accumulator does not survive several reboots

[edited] Tosh, part way through looking at this the log rotated and I’d forgotten to copy it. It doesn’t add up (literally)! Also note Emoncms log is in UTC, emonhub & graphs in BST.

The Wh accumulator did not survive several quick reboots (emonTX CT channel stopped reporting after reboot).

Not sure how it does try to recover - does it look back on previous data? Should it simply discard zeros? @TrystanLea

Actually, I have just realised that the Pulse sensor is still sending the right number so why has the Wh accumulator reset???

Pulse emonhub

2020-07-02 09:07:51,807 DEBUG    Dummy-5    pulse2 : pulse received -  count: 13654
2020-07-02 09:07:51,896 DEBUG    pulse2     Data to Post: last_time: 1593677264  time_now: 1593677271 - add 2
2020-07-02 09:07:51,900 DEBUG    pulse2     12382 NEW FRAME :
2020-07-02 09:07:51,903 DEBUG    pulse2     12382 Timestamp : 1593677271.896727
2020-07-02 09:07:51,906 DEBUG    pulse2     12382 From Node : 3
2020-07-02 09:07:51,911 DEBUG    pulse2     12382    Values : [13654]
2020-07-02 09:07:51,914 DEBUG    pulse2     12382 Sent to channel(start)' : ToEmonCMS
2020-07-02 09:07:51,917 DEBUG    pulse2     12382 Sent to channel(end)' : ToEmonCMS
2020-07-02 09:07:52,098 DEBUG    MQTT2      Publishing: emon/3/Pulse 13654
2020-07-02 09:07:52,110 DEBUG    MQTT3      Publishing: emon/3/Pulse 13654
2020-07-02 09:07:52,113 DEBUG    MQTT       Publishing: emon/3/Pulse 13654

emoncms log

2020-07-02 08:08:57.952|INFO|emoncms_mqtt.php|emon/3/Pulse 13663
2020-07-02 08:08:57.952|ERROR|emoncms_mqtt.php|MQTT original topic emon/3/Pulse
2020-07-02 08:08:57.953|ERROR|emoncms_mqtt.php|MQTT new topic 3/Pulse
2020-07-02 08:08:57.953|ERROR|emoncms_mqtt.php|MQTT route_len 2
2020-07-02 08:08:57.953|ERROR|emoncms_mqtt.php|MQTT nodeid 3
2020-07-02 08:08:57.968|INFO|feed_model.php|insert_data() feedid=18 updatetime=1593677337 feedtime=1593677337 value=423 arg=join
2020-07-02 08:08:58.005|INFO|feed_model.php|insert_data() feedid=19 updatetime=1593677337 feedtime=1593677337 value=0.422 arg=join

emoncms log across reboot / failure

2020-07-02 06:16:57.844|INFO|emoncms_mqtt.php|emon/3/Pulse 12659
2020-07-02 06:16:57.856|INFO|feed_model.php|insert_data() feedid=18 updatetime=1593670617 feedtime=1593670617 value=29497 arg=join
2020-07-02 06:16:57.867|INFO|feed_model.php|insert_data() feedid=19 updatetime=1593670617 feedtime=1593670617 value=29.464 arg=join
2020-07-02 07:03:30.882|INFO|demandshaper_run.php|Starting demandshaper service
2020-07-02 07:03:31.119|INFO|emoncms_mqtt.php|Starting MQTT Input script
2020-07-02 07:03:31.162|INFO|feedwriter.php|Starting feedwriter script
2020-07-02 07:03:31.676|INFO|feedwriter.php|Buffered feed writer daemon started with sleep 20s...
2020-07-02 07:03:31.712|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2020-07-02 07:03:32.004|WARN|emoncms_mqtt.php|Not connected, retrying connection
2020-07-02 07:03:32.032|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0
2020-07-02 07:03:32.033|INFO|emoncms_mqtt.php|Subscribed to: emon/# ID - 1
2020-07-02 07:03:32.045|INFO|emoncms_mqtt.php|Callback subscribed to topic:
2020-07-02 07:03:38.196|INFO|emoncms_mqtt.php|MQTT Valid JSON found
2020-07-02 07:03:38.196|INFO|emoncms_mqtt.php|Valid time in seconds used 1593673417.8948
2020-07-02 07:03:38.197|INFO|emoncms_mqtt.php|emon/Serial_PiZ {"MSG": 8, "Vrms": 245.56, "P2": 415, "E2": 9, "pulse": 1, "time": 1593673417.894757}
2020-07-02 07:03:43.208|INFO|emoncms_mqtt.php|emon/3/Pulse 13182
2020-07-02 07:03:43.300|INFO|emoncms_mqtt.php|emon/3/Pulse 13183
2020-07-02 07:03:43.408|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'PHPFina'.
2020-07-02 07:03:43.409|INFO|PHPFina.php|lastvalue() 18
2020-07-02 07:03:43.425|INFO|feed_model.php|insert_data() feedid=18 updatetime=1593673423 feedtime=1593673423 value=297 arg=join
2020-07-02 07:03:43.441|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2020-07-02 07:03:43.461|INFO|PHPFina.php|lastvalue() 19
2020-07-02 07:03:43.468|INFO|feed_model.php|insert_data() feedid=19 updatetime=1593673423 feedtime=1593673423 value=0.2960000038147 arg=join
2020-07-02 07:03:43.484|INFO|emoncms_mqtt.php|emon/3/Pulse 13184
2020-07-02 07:03:43.502|INFO|feed_model.php|insert_data() feedid=18 updatetime=1593673423 feedtime=1593673423 value=297 arg=join
2020-07-02 07:03:43.518|INFO|feed_model.php|insert_data() feedid=19 updatetime=1593673423 feedtime=1593673423 value=0.2960000038147 arg=join

You can see the pulses sent increase but the accumulator resets

There were 40s of zeros recorded - interestingly, no missing data despite the Pi reboots. Data sent via MQTT from Pulse sensor Pi to the Broker on this Pi.

Another observation - I multiply the output from the Wh accumulator by 0.001 and pass it to the kWh accumulator

image

More ‘zeros’ recorded for the kWh feed than the Wh feed.