Closed theslash closed 3 years ago
This is the log output when I do the check:
08:13:53.527 -> handler_editflow uri: /editflow.html?task=test_align&host=http://192.168.1.57
08:13:56.333 -> Vor ft->FindTemplate(_temp1); /sdcard/config/ref0.jpg
08:13:56.333 -> Anzahl 5292, avgDifSum -115904.000000d, avg -21.901739, SAD_neu: 1.313647d, _SAD_old: 1.193412, _SAD_crit:0.120235
08:13:59.329 -> [0;31mE (697815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:13:59.329 -> [0;31mE (697815) task_wdt: - IDLE0 (CPU 0)[0m
08:13:59.329 -> [0;31mE (697815) task_wdt: Tasks currently running:[0m
08:13:59.329 -> [0;31mE (697815) task_wdt: CPU 0: httpd[0m
08:13:59.329 -> [0;31mE (697815) task_wdt: CPU 1: IDLE1[0m
08:14:02.304 -> [0;31mE (700815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:02.339 -> [0;31mE (700815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:02.339 -> [0;31mE (700815) task_wdt: Tasks currently running:[0m
08:14:02.339 -> [0;31mE (700815) task_wdt: CPU 0: httpd[0m
08:14:02.339 -> [0;31mE (700815) task_wdt: CPU 1: IDLE1[0m
08:14:05.303 -> [0;31mE (703815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:05.336 -> [0;31mE (703815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:05.336 -> [0;31mE (703815) task_wdt: Tasks currently running:[0m
08:14:05.336 -> [0;31mE (703815) task_wdt: CPU 0: httpd[0m
08:14:05.370 -> [0;31mE (703815) task_wdt: CPU 1: IDLE1[0m
08:14:08.333 -> [0;31mE (706815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:08.333 -> [0;31mE (706815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:08.333 -> [0;31mE (706815) task_wdt: Tasks currently running:[0m
08:14:08.333 -> [0;31mE (706815) task_wdt: CPU 0: httpd[0m
08:14:08.333 -> [0;31mE (706815) task_wdt: CPU 1: IDLE1[0m
08:14:11.302 -> [0;31mE (709815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:11.335 -> [0;31mE (709815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:11.335 -> [0;31mE (709815) task_wdt: Tasks currently running:[0m
08:14:11.335 -> [0;31mE (709815) task_wdt: CPU 0: httpd[0m
08:14:11.368 -> [0;31mE (709815) task_wdt: CPU 1: IDLE1[0m
08:14:14.323 -> [0;31mE (712815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:14.323 -> [0;31mE (712815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:14.323 -> [0;31mE (712815) task_wdt: Tasks currently running:[0m
08:14:14.323 -> [0;31mE (712815) task_wdt: CPU 0: httpd[0m
08:14:14.356 -> [0;31mE (712815) task_wdt: CPU 1: IDLE1[0m
08:14:17.314 -> [0;31mE (715815) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:17.314 -> [0;31mE (715815) task_wdt: - IDLE0 (CPU 0)[0m
08:14:17.348 -> [0;31mE (715815) task_wdt: Tasks currently running:[0m
08:14:17.348 -> [0;31mE (715815) task_wdt: CPU 0: httpd[0m
08:14:17.348 -> [0;31mE (715815) task_wdt: CPU 1: IDLE1[0m
08:14:18.406 -> Anzahl 5292, avgDifSum -171970.000000d, avg -32.496220, SAD_neu: 1.222944d, _SAD_old: 1.193412, _SAD_crit:0.029532
08:14:18.406 -> Vor ft->FindTemplate(_temp2); /sdcard/config/ref1.jpg
08:14:18.439 -> Anzahl 5292, avgDifSum -123283.000000d, avg -23.296108, SAD_neu: 1.081303d, _SAD_old: 1.066861, _SAD_crit:0.014441
08:14:21.419 -> [0;31mE (719925) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:[0m
08:14:21.454 -> [0;31mE (719925) task_wdt: - IDLE0 (CPU 0)[0m
08:14:21.454 -> [0;31mE (719925) task_wdt: Tasks currently running:[0m
08:14:21.454 -> [0;31mE (719925) task_wdt: CPU 0: httpd[0m
08:14:21.454 -> [0;31mE (719925) task_wdt: CPU 1: IDLE1[0m
08:14:23.040 -> Alignment: dx 1 - dy 18 - rot 2.708143
08:14:23.079 -> 2021-04-10_08-14-23
08:14:23.218 -> uri: /img_tmp/rot.jpg
08:14:23.218 -> 1 uri: /img_tmp/rot.jpg, filename: rot.jpg, filepath: /sdcardrot.jpg
08:14:23.218 -> File to upload: rot.jpg
08:14:23.218 -> ClassFlowControll::GetJPGStream rot.jpg
08:14:23.218 -> uri: /img_tmp/rot.jpg
08:14:23.218 -> 1 uri: /img_tmp/rot.jpg, filename: rot.jpg, filepath: /sdcardrot.jpg
08:14:23.255 -> File to upload: /sdcard/img_tmp/rot.jpg
08:14:23.255 -> File is locked: /sdcard/img_tmp/rot.jpg - wait for 1
08:14:23.255 -> Logfile opened: /sdcard/log/message/log_2021-04-10.txt
08:14:24.238 -> [0;31mE (722735) serverhelp: Failed to read existing file : /sdcard/img_tmp/rot.jpg[0m
08:14:24.238 -> [0;33mW (722735) httpd_txrx: httpd_resp_send_err: 500 Internal Server Error - Failed to read existing file[0m
08:14:24.273 -> [0;33mW (722755) httpd_uri: httpd_uri: uri handler execution failed[0m
08:14:24.273 -> uri: /img_tmp/rot_roi.jpg
08:14:24.273 -> 1 uri: /img_tmp/rot_roi.jpg, filename: rot_roi.jpg, filepath: /sdcardrot_roi.jpg
08:14:24.273 -> File to upload: rot_roi.jpg
08:14:24.273 -> ClassFlowControll::GetJPGStream rot_roi.jpg
08:14:24.273 -> uri: /img_tmp/rot_roi.jpg
08:14:24.273 -> 1 uri: /img_tmp/rot_roi.jpg, filename: rot_roi.jpg, filepath: /sdcardrot_roi.jpg
08:14:24.306 -> File to upload: /sdcard/img_tmp/rot_roi.jpg
08:14:24.306 -> File is locked: /sdcard/img_tmp/rot_roi.jpg - wait for 1
08:14:24.306 -> Logfile opened: /sdcard/log/message/log_2021-04-10.txt
08:14:25.289 -> [0;31mE (723795) serverhelp: Failed to read existing file : /sdcard/img_tmp/rot_roi.jpg[0m
08:14:25.289 -> [0;33mW (723795) httpd_txrx: httpd_resp_send_err: 500 Internal Server Error - Failed to read existing file[0m
08:14:25.324 -> [0;33mW (723815) httpd_uri: httpd_uri: uri handler execution failed[0m
08:14:25.324 -> uri: /img_tmp/alg.jpg
08:14:25.324 -> 1 uri: /img_tmp/alg.jpg, filename: alg.jpg, filepath: /sdcardalg.jpg
08:14:25.324 -> File to upload: alg.jpg
08:14:25.324 -> ClassFlowControll::GetJPGStream alg.jpg
08:14:25.324 -> [0;32mI (723825) flow_controll: Sending file : alg.jpg ...[0m
08:14:26.708 -> [0;32mI (725195) flow_controll: File sending complete[0m
After a reboot (disconnect & connect, a software reboots often results in a bootloop) everything works again for 3-4 times:
Hi - first of all great, that you have it up and running. Some remarks:
Hi, thank you for this great project. Until now I read my water meter with a TCRT5000 but this was kind of unreliable an complicated so this looks very promising.
[MakeImage] LogImageLocation = /log/source LogfileRetentionInDays = 15 WaitBeforeTakingPicture = 5 ImageQuality = 5 ImageSize = VGA ;Brightness = -2 FixedExposure = false
[Alignment] InitialRotate = 181 /config/ref0.jpg 341 142 /config/ref1.jpg 91 248 SearchFieldX = 20 SearchFieldY = 20 InitialMirror = false AlignmentAlgo = Default
[Digits] Model = /config/dig0820s2q.tflite LogImageLocation = /log/digit LogfileRetentionInDays = 3 ModelInputSize = 20 32 digit2 151 131 31 56 digit3 192 132 27 48 digit1 229 130 32 58 ROI4 267 128 37 64 ROI5 309 132 32 50
[Analog] Model = /config/ana0700s1lq.tflite LogImageLocation = /log/analog LogfileRetentionInDays = 3 ModelInputSize = 32 32 analog4 351 192 79 79 analog3 322 286 78 78 analog2 231 325 78 78 analog1 137 288 80 80 ExtendedResolution = false
[PostProcessing] DecimalShift = 0 PreValueUse = false PreValueAgeStartup = 720 AllowNegativeRates = false MaxRateValue = 0.1 ErrorMessage = true CheckDigitIncreaseConsistency = false
[MQTT] Uri = mqtt://192.168.1.5:1883 Topic = home/wasserzaehler ;TopicError = wasserzaehler/error ClientID = wasseruhr user = mqtt password =**
[AutoTimer] AutoStart = true Intervall = 6
[Debug] Logfile = true LogfileRetentionInDays = 3
[System] TimeZone = CET-1CEST ;TimeServer = fritz.box ;Hostname = watermeter ;SetupMode = false
[Ende]
The config looks okay. You could switch on the UsePreValue - this helps in case of sudden reboots to get to know the previous value (in case there is an intermediate number). A reboot from time to time is normal. After quite some work, we could not figure out why. My system is running stable for more than 200 runs, other systems do a reboot after a view turns.
One can observe, that a reboot is more likely after a html access and with some kind of SD-cards.
Therefore after a reboot the system should recover itself pretty well and as you only need a value every several numbers, in my case this not turns out to be a problem at all.
Yes I think my main problem is the alignment. This is what it looked like after 6 correct values:
Should I perhaps put a little marking or sticker with red paint on the glass to help the alignment? Or could the rotation be a problem?
This is not a problem of the alignment - rather of the camera itself. It looks like, the image is rotated several times in a sequence. This might happen, if the taking of new images fails. Can you check your camera connection itself?
Yes, I just replaced the whole ESP32 but used the cam. if this also fails I will try another cam.
So, no idea what is happening here, tried different ESP & different cam, Connections are ok:
5good readings, these are the source files after that: Good:
Good:
Wrong orientation:
Wrong orientation and strange twisted:
Also the whole alignment check process is not working, could this be a general hardware issue?
What is the difference between good and twisted? The two lines on the edges indicate, that there are two rotations happening. I have seen this once, but do not remeber the reason for this or the counter measure. Do you have the corresponding part of the log-file?
I meant the image seems to be half rotated.
I just now started new. New SD card, new camera, and set it up so that the image doesnt have to be rotated and I think I got a better image quality now too.
One question though: when aligning the Digital ROIs, is the thin or the thick frame supposed to be around the number?
Here he always recognizes a 9 instead of a 3 And what is the way to deal with numbers like the last digit where I now get a NaN Value?
Sorry if I ask dumb questions, and thank you for your effort
The thin frame is supposed to be directly around the number. The thicker frame is than the later cut out image. The recognition works better if there is some spacing to the border of the image. If the 3/9 Problem is still there you can send me some of your wrong detected "3" images (just turn on the logging and check the sd-card). I will put them to the next training.
I got it working now with the 3 and 9s I think the problem yesterday was something with the sd card. Now the esp boots perfectly and it looks good.
I will wait how it works today and close this issue then, thank you very much for your help, I will report how it works .
So far everything works very good. What I did, for reference:
Had good readings for the past hours, and the system recovered from 2 reboots without problems
Thank you very much for your help
So I'm trying to get this to run reliable and I'm having a few issues:
A few reads always are right, and then everything falls apart:
I think I might have a problem with the alignment process, because when I go to the settings and check my alignment the correct rotated image never shows up, and the alignment is sometimes off.
These are my two alignment points:
And this is what the check looks like:
Any Idea whats going on here?