Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spontaneous reboots #370

Closed
janumix opened this issue Oct 17, 2021 · 16 comments
Closed

spontaneous reboots #370

janumix opened this issue Oct 17, 2021 · 16 comments

Comments

@janumix
Copy link

janumix commented Oct 17, 2021

Hi

I observe reboots that results with incorrect readings.
A few lines from log:
2021-10-17T01:51:22: task_autodoFlow - next round - Round #51 2021-10-17T01:51:22: FlowControll.doFlow - ClassFlowMakeImage 2021-10-17T01:51:38: Time zone set to CET-1CEST,M3.5.0,M10.5.0/3 2021-10-17T01:51:38: ============================================================================================= .... 2021-10-17T08:16:43: task_autodoFlow - next round - Round #78 2021-10-17T08:16:43: FlowControll.doFlow - ClassFlowMakeImage 2021-10-17T08:17:00: Time zone set to CET-1CEST,M3.5.0,M10.5.0/3 2021-10-17T08:17:00: ============================================================================================= ... 2021-10-17T08:27:04: task_autodoFlow - next round - Round #3 2021-10-17T08:27:04: FlowControll.doFlow - ClassFlowMakeImage 2021-10-17T08:27:22: Time zone set to CET-1CEST,M3.5.0,M10.5.0/3 2021-10-17T08:27:22: ============================================================================================= ... 2021-10-17T21:22:49: task_autodoFlow - next round - Round #67 2021-10-17T21:22:49: FlowControll.doFlow - ClassFlowMakeImage 2021-10-17T21:22:57: FlowControll.doFlow - ClassFlowAlignment 2021-10-17T21:23:23: FlowControll.doFlow - ClassFlowCNNGeneral 2021-10-17T21:23:51: Time zone set to CET-1CEST,M3.5.0,M10.5.0/3 2021-10-17T21:23:51: =============================================================================================
Incorrect readings looks like:
Value: 10206190
Previous value: 10206190
Raw value: 10205190

Raw value is correct (as on image) but for unknown reasons all further values sent to MQTT are higher by 1000 (sometimes 1100). It seems that this behavior is related to spontaneous reboot.

Info:
master - v8.5.0 - 2021-10-07
MaxRateValue=1000

BR

@jomjol
Copy link
Owner

jomjol commented Oct 18, 2021

Hi,
the ESP32 is not very stable, so reboots after a view runs are "normal". Even with a lot of effort, this cannot be removed currently. I never observerd, that this results in wrong readings, as the previous value is correctly stored on the SD-card. I assume, that there was a wrong reading just before the reboot. Please check you log file, if this could have happened.

@janumix
Copy link
Author

janumix commented Oct 20, 2021

Hi,
I checked logs for abnormal Raw values after restarts and it seems it didn't happened. Looks like SD storage write and restore after reboot works fine - no discontinuity I found.
It's quite hard to find it in logs because all the time counter increases.
As soon as I catch it again, I'll post image together with full log.

@janumix
Copy link
Author

janumix commented Oct 22, 2021

Here is an image and log:

20211022_112947
log.txt

@janumix
Copy link
Author

janumix commented Oct 22, 2021

a few minutes later:
Screenshot_20211022-121217_Chrome
log2.txt

@friedpa
Copy link

friedpa commented Oct 22, 2021

You must avoid reflections, I can clearly see those at the digits....

@jomjol
Copy link
Owner

jomjol commented Oct 22, 2021

Did you modify the software or which software version are you using? The content of the json content in the MQTT-protocoll is looking different compared to my current version:

Your logfile:

2021-10-22T11:21:29: sent publish successful in MQTTPublish, msg_id=34970, domoticz/in, {"idx":177,"nvalue":0,"svalue":"10218690"}

My software:

2021-10-22T00:05:04: sent publish successful in MQTTPublish, msg_id=54607, strom_photovoltaik/main/json, {"value":85980.30,"error":"no error","rate":0.000000,"timestamp":"2021-10-22T00:03:06"}

@janumix
Copy link
Author

janumix commented Oct 22, 2021

I'll correct reflections but in fact the main issue is that Raw value normally shows proper value but Value/Previous value are higher from it, for some reasons.

Yes, you are right. As you proposed in #344 I did small changes and hard-coded Domoticz MQTT format (ClassFlowMQTT.cpp).

@janumix
Copy link
Author

janumix commented Oct 25, 2021

Maybe it's worth to mentiom the most inportant part of my configuration:
PreValueUse: true
AllowNegativeRates: false
CheckDigitIncreaseConsistency: true
DecimalShift: 1
MaxRateValue: 1000

Screenshot_20211025-102244_Chrome

@jomjol
Copy link
Owner

jomjol commented Oct 25, 2021

Well, out of the log file I cannot get informations. You could add the raw value etc. to follow the internal logic.
Regarding your settings I would disable CheckDigitIncreaseConsistency.
This is intended to be used in case of analog values providing the last digits.

@janumix
Copy link
Author

janumix commented Oct 25, 2021

Sure.
Here is another shot and a log. Please, find that last digit (except of permanent 0) seems to be always the same in Previous/Value as in Raw value.

Screenshot_20211025_203726

log.txt

@janumix
Copy link
Author

janumix commented Oct 25, 2021

Switching CheckDigitIncreaseConsistency off results with Negative reading Error - that's obvious.
Screenshot_20211025_205400

@jomjol
Copy link
Owner

jomjol commented Oct 25, 2021

I don't get the problem currently. Checking your logfile shows a consistently increasing number:
grafik

Should be fine, or?

That negative rate is due to a misreading somewhere in the previous because it looks like the previous value was a 4.
This is really hard to debug on remote. Just have a look in the logic in the postprocessing procedure, maybe you can find a hint there?

@janumix
Copy link
Author

janumix commented Oct 25, 2021

Yes, indeed - it's very hard to find even a moment when these bad values are occur. I also analysed values and that spontaneous reboots was my idea :)
I'll try to catch the moment.
Could you point me where exactly post-processing is (what file) ?

@jomjol
Copy link
Owner

jomjol commented Oct 26, 2021

The major postprocessing routine is in: https://github.com/jomjol/AI-on-the-edge-device/blob/master/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

It is the function bool ClassFlowPostProcessing::doFlow(string zwtime) - starting in line 561

@jomjol
Copy link
Owner

jomjol commented Oct 29, 2021

Please reopen in case of questions

@BIIINO
Copy link

BIIINO commented Mar 23, 2022

Hi @janumix please, can you share your ClassFlowMQTT.cpp which is compatible with domoticz MQTT ? Thank in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants