AI-on-the-edge-device
AI-on-the-edge-device copied to clipboard
AutoTimer flow does not start when LogLevel is ERROR or WARNING
The Problem
This one was hard to debug and seems a little crazy, but I did double check multiple times.
In the config file, when Debug.Logfile=1 (ERROR) or Debug.Logfile=2 (WARNING), the autotimer flow never starts. The device does not run any readings, as if AutoTimer.AutoStart=false even though it is true.
As soon as I change it to 3 (INFO) or 4 (DEBUG) and reboot, the auto timer flow starts working. Change it back to 1 or 2 and reboot, the flow stops.
There is not much to see in the log file in WARNING mode, making it hard to root cause. Autotimer never starts.
Version
Release: v13.0.5 (Commit: e23c89a)
Logfile
[ 4] 2022-12-10T15:36:43 <INF> [MAIN] =================================================
[ 4] 2022-12-10T15:36:43 <INF> [MAIN] ==================== Startup ====================
[ 4] 2022-12-10T15:36:43 <INF> [MAIN] =================================================
[ 4] 2022-12-10T15:36:43 <INF> [MAIN] Branch: 'HEAD', Revision: e23c89a, Date/Time: 2022-12-06 19:34, Web UI: Release: v13.0.5 (Commit: e23c89a)
[ 4] 2022-12-10T15:36:43 <INF> [MAIN] Reset reason: Via esp_restart
[ 7] 2022-12-10T15:36:46 <INF> [MAIN] =================================================
[ 7] 2022-12-10T15:36:46 <INF> [MAIN] ================== Main Started =================
[ 7] 2022-12-10T15:36:46 <INF> [MAIN] =================================================
[ 9] 2022-12-10T15:36:48 <INF> [MAIN] Initialization completed successfully!
Expected Behavior
No response
Screenshots
No response
Additional Context
[MakeImage]
;LogImageLocation = /log/source
WaitBeforeTakingPicture = 5
LogfileRetentionInDays = 7
Brightness = 0
Contrast = 0
Saturation = 0
LEDIntensity = 50
ImageQuality = 12
ImageSize = VGA
FixedExposure = false
[Alignment]
InitialRotate = -3
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
AlignmentAlgo = fast
FlipImageSize = false
/config/ref0.jpg 499 199
/config/ref1.jpg 279 278
[Digits]
Model = /config/dig-cont_0600_s3.tflite
CNNGoodThreshold = 0.5
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
main.e5 78 98 57 94 0
main.e4 144 97 56 94 0
main.e3 211 95 63 97 0
main.e2 285 94 65 99 0
main.e1 359 90 70 105 0
main.e0 442 87 70 109 0
main.e-1 521 87 89 127 0
;[Analog]
Model = /config/ana-cont_11.3.0_s2.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
[PostProcessing]
main.DecimalShift = -1
;main.AnalogDigitalTransitionStart =
PreValueUse = true
PreValueAgeStartup = 1440
AllowNegativeRates = false
main.MaxRateValue = 5
main.MaxRateType = RateChange
;main.ExtendedResolution = false
;main.IgnoreLeadingNaN = true
ErrorMessage = true
CheckDigitIncreaseConsistency = false
[MQTT]
Uri = REDACTED
MainTopic = ai-house-water-meter
ClientID = esp32cam_2
user = mqtt
password = REDACTED
;SetRetainFlag = true
HomeassistantDiscovery = true
MeterType = water_gal
;[InfluxDB]
;Uri = undefined
;Database =
;Measurement = undefined
;user = undefined
;password = undefined
;[GPIO]
;IO0 = input disabled 10 false false
;IO1 = input disabled 10 false false
;IO3 = input disabled 10 false false
;IO4 = built-in-led disabled 10 false false
;IO12 = input-pullup disabled 10 false false
;IO13 = input-pullup disabled 10 false false
LEDType = WS2812
LEDNumbers = 2
LEDColor = 150 150 150
[AutoTimer]
AutoStart = true
Intervall = 3
[DataLogging]
DataLogActive = false
DataLogRetentionInDays = 3
[Debug]
Logfile = 2
LogfileRetentionInDays = 2
[System]
TimeZone = CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00
;TimeServer = undefined
;AutoAdjustSummertime = false
Hostname = ai-house-water-meter
SetupMode = false
I also saw that it sometimes does not start the auto flow, but I doubt it is because of the log level! There must be another coincidence for this!
Yeah it does feel like a coincidence. But I tested across ~10 reboots just changing the log level settings each time, and that was the behavior I noticed.
I just tried it with the latest rolling. For me it work fine in all log levels! I don't think there was a relevant change for this since 13.0.5, but you could try with the latest rolling: https://github.com/jomjol/AI-on-the-edge-device/actions/workflows/build.yaml?query=branch%3Arolling
I retested - this time changed the settings and rebooted 3 times. It works now on WARNING level.
I really don't know why. I did a quick skim of the code and nothing suspicious popped up in the flow loop.
Closing this out unless somewhere else can reproduce.