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

guru meditation #337

Closed
s0170071 opened this issue Sep 10, 2021 · 32 comments
Closed

guru meditation #337

s0170071 opened this issue Sep 10, 2021 · 32 comments

Comments

@s0170071
Copy link

When accessing the web interface when the DNN processing takes place, the ESP crashes. Serial log shows:


ostename: watermeter2
I (5589) wifi:wifi driver task: 3ffd9c90, prio:23, stack:6656, core=0
�[0;32mI (5589) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
�[0;32mI (5589) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE�[0m
I (5619) wifi:wifi firmware version: 3ea4c76
I (5619) wifi:config NVS flash: enabled
I (5619) wifi:config nano formating: disabled
I (5619) wifi:Init dynamic tx buffer num: 32
I (5629) wifi:Init data frame dynamic rx buffer num: 32
I (5629) wifi:Init management frame dynamic rx buffer num: 32
I (5639) wifi:Init management short buffer num: 32
I (5639) wifi:Init static tx buffer num: 16
I (5649) wifi:Init static rx buffer size: 1600
I (5649) wifi:Init static rx buffer num: 10
I (5649) wifi:Init dynamic rx buffer num: 32
�[0;32mI (5799) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 2�[0m
�[0;33mW (5799) phy_init: saving new calibration data because of checksum failure, mode(0)�[0m
I (5849) wifi:mode : sta (10:52:1c:69:c1:40)
�[0;32mI (5859) BLINK: Blinken - start�[0m
�[0;32mI (5859) wifi station: wifi_init_sta finished.�[0m
I (5979) wifi:new:<6,1>, old:<1,0>, ap:<255,255>, sta:<6,1>, prof:1
I (5979) wifi:state: init -> auth (b0)
I (5989) wifi:state: auth -> assoc (0)
I (5999) wifi:state: assoc -> run (10)
I (6039) wifi:connected with MNET, aid = 8, channel 6, 40U, bssid = 5c:49:79:2c:0c:61
I (6039) wifi:security: WPA2-PSK, phy: bgn, rssi: -71
I (6049) wifi:pm start, type: 1

�[0;32mI (6059) BLINK: Blinken - done�[0m
I (6069) wifi:AP's beacon interval = 102400 us, DTIM period = 1
�[0;32mI (6579) esp_netif_handlers: sta ip: 192.168.1.64, mask: 255.255.255.0, gw: 192.168.1.1�[0m
�[0;32mI (6579) wifi station: got ip:192.168.1.64�[0m
�[0;32mI (6579) BLINK: Blinken - start�[0m
�[0;32mI (6579) wifi station: connected to ap SSID: password:�[0m
main: sleep for : 200ms
�[0;32mI (8589) sntp: Time is not set yet. Connecting to WiFi and getting time over NTP.�[0m
�[0;32mI (8589) sntp: Initializing SNTP�[0m
�[0;32mI (8589) sntp: Waiting for system time to be set... (1/10)�[0m
�[0;32mI (10589) sntp: Waiting for system time to be set... (2/10)�[0m
TimeZone set to CET-1CEST,M3.5.0,M10.5.0/3
Logfile opened: /sdcard/log/message/log_2021-09-10.txt
�[0;32mI (12599) sntp: The current date/time in Berlin is: Fri Sep 10 17:16:54 2021�[0m
�[0;32mI (12599) sntp: The current date/time in Berlin is: 2021-09-10_17:16�[0m
timeist 20210910-171654
Logfile opened: /sdcard/log/message/log_2021-09-10.txt
Logfile opened: /sdcard/log/message/log_2021-09-10.txt
Logfile opened: /sdcard/log/message/log_2021-09-10.txt
time 20210910-171654
main: sleep for : 200ms
�[0;32mI (14649) server-main: Starting server on port: '80'�[0m
�[0;32mI (14649) server-main: Registering URI handlers�[0m
�[0;32mI (14649) server_tflite: server_part_camera - Registering URI handlers�[0m
�[0;32mI (14649) server_ota: server_ota - Registering URI handlers�[0m
�[0;32mI (14659) server_GPIO: start GpioHandler�[0m
�[0;32mI (14659) server_GPIO: register GPIO Uri�[0m
�[0;32mI (14669) server_GPIO: server_GPIO - Registering URI handlers�[0m
vor reg server main
vor dotautostart
task_autodoFlow: start

open config file /sdcard/config/config.ini in mode r
[MakeImage]
Start ReadParameter
;LogImageLocation = /log/source
WaitBeforeTakingPicture = 5
;LogfileRetentionInDays = 15
Brightness = -2
;Contrast = 0
;Saturation = 0
ImageQuality = 5
ImageSize = VGA
FixedExposure = false

[Alignment]
Start ReadParameter
InitialRotate = 179
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
AlignmentAlgo = Default
FlipImageSize = false
/config/ref0.jpg 103 271
/config/ref1.jpg 442 142

[Digits]
Start ReadParameter
aktparamgraph: [Digits]
Name Digit: 
Model = /config/dig1200s1q.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32
main.dig1 294 126 30 54
GetDIGIT - digit main - roi dig1
main.dig2 343 126 30 54
GetDIGIT - digit main - roi dig2
main.dig3 391 126 30 54
GetDIGIT - digit main - roi dig3

[Analog]
Start ReadParameter
Model = /config/ana0700s1lq.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
ModelInputSize = 32 32
ExtendedResolution = true
main.ana1 432 230 92 92
GetANALOG - ANALOG main - roi ana1
main.ana2 379 332 92 92
GetANALOG - ANALOG main - roi ana2
main.ana3 283 374 92 92
GetANALOG - ANALOG main - roi ana3
main.ana4 155 328 92 92
GetANALOG - ANALOG main - roi ana4

[PostProcessing]
Start ReadParameter
Anzahl NUMBERS: 1 - DIGITS: 1, ANALOG: 1
Number main, Anz DIG: 3, Anz ANA 4
main.DecimalShift = 0
PreValueUse = true
PreValueAgeStartup = 720
AllowNegativeRates = false
main.MaxRateValue = 0.1
ErrorMessage = true
CheckDigitIncreaseConsistency = true

;[MQTT]
Read Zeile Prevalue.ini: 2020-11-30_12-02-22
42.013401
TIME: 120, 10, 1, 1, 2, 5
Read: ;Uri = mqtt://IP-ADRESS:1883
Read: ;MainTopic = wasserzaehler
Read: ;ClientID = wasser
Read: ;user = USERNAME
Read: ;password = PASSWORD
Read: 
Read: ;[GPIO]
Read: ;IO0 = input disabled 10 false false 
Read: ;IO1 = input disabled 10 false false 
Read: ;IO3 = input disabled 10 false false 
Read: ;IO4 = built-in-led disabled 10 false false 
Read: ;IO12 = input-pullup disabled 10 false false 
Read: ;IO13 = input-pullup disabled 10 false false 
Read: 
Read: [AutoTimer]
Start ReadParameter
AutoStart = true
Intervall = 4.85

[Debug]
Start ReadParameter
Logfile = false
LogfileRetentionInDays = 3

[System]
Start ReadParameter
TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
TimeZone set to CET-1CEST,M3.5.0,M10.5.0/3
;TimeServer = undefined
;AutoAdjustSummertime = false
;Hostname = undefined
;SetupMode = false
�[0;32mI (16469) server_GPIO: read GPIO config and init GPIO�[0m
open config file /sdcard/config/config.ini in mode r
[MakeImage]
;LogImageLocation = /log/source
WaitBeforeTakingPicture = 5
;LogfileRetentionInDays = 15
Brightness = -2
;Contrast = 0
;Saturation = 0
ImageQuality = 5
ImageSize = VGA
FixedExposure = false

[Alignment]
InitialRotate = 179
InitialMirror = false
SearchFieldX = 20
SearchFieldY = 20
AlignmentAlgo = Default
FlipImageSize = false
/config/ref0.jpg 103 271
/config/ref1.jpg 442 142

[Digits]
Model = /config/dig1200s1q.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32
main.dig1 294 126 30 54
main.dig2 343 126 30 54
main.dig3 391 126 30 54

[Analog]
Model = /config/ana0700s1lq.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
ModelInputSize = 32 32
ExtendedResolution = true
main.ana1 432 230 92 92
main.ana2 379 332 92 92
main.ana3 283 374 92 92
main.ana4 155 328 92 92

[PostProcessing]
main.DecimalShift = 0
PreValueUse = true
PreValueAgeStartup = 720
AllowNegativeRates = false
main.MaxRateValue = 0.1
ErrorMessage = true
CheckDigitIncreaseConsistency = true

;[MQTT]
�[0;32mI (16579) server_GPIO: GPIO init comleted, handler is disabled�[0m
Autoflow: start
doflow - start 20210910-171658
�[0;32mI (16589) BLINK: Blinken - done�[0m
Flashdauer: 5000
Image loaded from memory: 640, 480, 3
�[0;31mE (24819) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (24819) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (24819) task_wdt: Tasks currently running:�[0m
�[0;31mE (24819) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (24819) task_wdt: CPU 1: IDLE1�[0m
Vor ft->FindTemplate(_temp1);  /sdcard/config/ref0.jpg
�[0;31mE (30499) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (30499) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (30499) task_wdt: Tasks currently running:�[0m
�[0;31mE (30499) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (30499) task_wdt: CPU 1: IDLE1�[0m
Vor ft->FindTemplate(_temp2);  /sdcard/config/ref1.jpg
�[0;31mE (35639) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (35639) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (35639) task_wdt: Tasks currently running:�[0m
�[0;31mE (35639) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (35639) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (38639) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (38639) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (38639) task_wdt: Tasks currently running:�[0m
�[0;31mE (38639) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (38639) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (41639) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (41639) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (41639) task_wdt: Tasks currently running:�[0m
�[0;31mE (41639) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (41639) task_wdt: CPU 1: IDLE1�[0m
Alignment: dx -20 - dy 0 - rot -2.239414
2021-09-10T17:17:25
DIGIT[_dig]->ROI.size() 3
DigitalDigit 0 - Align&Cut
DigitalDigit 1 - Align&Cut
DigitalDigit 2 - Align&Cut
/sdcard/config/dig1200s1q.tflite
open config file /sdcard/config/dig1200s1q.tflite in mode rb
DigitalDigit 0 - TfLite
�[0;31mE (47629) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (47629) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (47629) task_wdt: Tasks currently running:�[0m
�[0;31mE (47629) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (47629) task_wdt: CPU 1: IDLE1�[0m
Result Digit0: 10
DigitalDigit 1 - TfLite
�[0;31mE (50629) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (50629) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (50629) task_wdt: Tasks currently running:�[0m
�[0;31mE (50629) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (50629) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (53629) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (53629) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (53629) task_wdt: Tasks currently running:�[0m
�[0;31mE (53629) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (53629) task_wdt: CPU 1: IDLE1�[0m
Result Digit1: 10
DigitalDigit 2 - TfLite
�[0;31mE (56629) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (56629) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (56629) task_wdt: Tasks currently running:�[0m
�[0;31mE (56629) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (56629) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (59629) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (59629) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (59629) task_wdt: Tasks currently running:�[0m
�[0;31mE (59629) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (59629) task_wdt: CPU 1: IDLE1�[0m
Result Digit2: 10
Analog 0 - Align&Cut
Analog 1 - Align&Cut
Analog 2 - Align&Cut
Analog 3 - Align&Cut
/sdcard/config/ana0700s1lq.tflite
open config file /sdcard/config/ana0700s1lq.tflite in mode rb
Analog 0 - TfLite
�[0;31mE (63889) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (63889) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (63889) task_wdt: Tasks currently running:�[0m
�[0;31mE (63889) task_wdt: CPU 0: wifi�[0m
�[0;31mE (63889) task_wdt: CPU 1: IDLE1�[0m
Result Analog0: 2.404621
Analog 1 - TfLite
�[0;31mE (66889) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (66889) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (66889) task_wdt: Tasks currently running:�[0m
�[0;31mE (66889) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (66889) task_wdt: CPU 1: IDLE1�[0m
Result Analog1: 2.198880
Analog 2 - TfLite
�[0;31mE (69889) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (69889) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (69889) task_wdt: Tasks currently running:�[0m
�[0;31mE (69889) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (69889) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (72889) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (72889) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (72889) task_wdt: Tasks currently running:�[0m
�[0;31mE (72889) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (72889) task_wdt: CPU 1: IDLE1�[0m
Result Analog2: 1.630749
Analog 3 - TfLite
�[0;31mE (75889) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (75889) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (75889) task_wdt: Tasks currently running:�[0m
�[0;31mE (75889) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (75889) task_wdt: CPU 1: IDLE1�[0m
Result Analog3: 2.060578
Anzahl NUMBERS: 1
�[0;32mI (78199) log: 0 older log files deleted. 2 current log files not deleted.�[0m
CPU Temperature: 53.33
Autoflow: sleep for : 22938ms
uri: /
1 uri: /, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/index.html
open config file /sdcard/html/index.html in mode r
�[0;32mI (174839) serverhelp: Sending file : /sdcard/html/index.html ...�[0m
�[0;32mI (174859) serverhelp: File sending complete�[0m
uri: /wasserzaehler_roi.html
1 uri: /wasserzaehler_roi.html, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/wasserzaehler_roi.html
open config file /sdcard/html/wasserzaehler_roi.html in mode r
�[0;32mI (174919) serverhelp: Sending file : /sdcard/html/wasserzaehler_roi.html ...�[0m
�[0;32mI (174929) serverhelp: File sending complete�[0m
uri: /jquery-3.6.0.min.js
1 uri: /jquery-3.6.0.min.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/jquery-3.6.0.min.js
open config file /sdcard/html/jquery-3.6.0.min.js in mode r
�[0;32mI (175049) serverhelp: Sending file : /sdcard/html/jquery-3.6.0.min.js ...�[0m
�[0;32mI (175339) serverhelp: File sending complete�[0m
uri: /gethost.js
1 uri: /gethost.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/gethost.js
open config file /sdcard/html/gethost.js in mode r
�[0;32mI (175359) serverhelp: Sending file : /sdcard/html/gethost.js ...�[0m
�[0;32mI (175359) serverhelp: File sending complete�[0m
uri: /readconfigcommon.js
1 uri: /readconfigcommon.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/readconfigcommon.js
open config file /sdcard/html/readconfigcommon.js in mode r
�[0;32mI (175389) serverhelp: Sending file : /sdcard/html/readconfigcommon.js ...�[0m
�[0;32mI (175409) serverhelp: File sending complete�[0m
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=value
TYPE: value
ZW: main	NNN.22120
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=prevalue
TYPE: prevalue
ZW: main	PreValue too old
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=raw
TYPE: raw
ZW: main	NNN.22120
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=error
TYPE: error
ZW: main	
uri: /img_tmp/alg_roi.jpg
1 uri: /img_tmp/alg_roi.jpg, filename: alg_roi.jpg, filepath: /sdcardalg_roi.jpg
File to upload: alg_roi.jpg
ClassFlowControll::GetJPGStream alg_roi.jpg
�[0;32mI (176889) flow_controll: Sending file : alg_roi.jpg ...�[0m
�[0;32mI (177899) flow_controll: File sending complete�[0m
handler_wasserzaehler uri:
/wasserzaehler.html?full
uri: /img_tmp/main_dig1.bmp
1 uri: /img_tmp/main_dig1.bmp, filename: main_dig1.bmp, filepath: /sdcardmain_dig1.bmp
File to upload: main_dig1.bmp
ClassFlowControll::GetJPGStream main_dig1.bmp
�[0;32mI (238679) flow_controll: Sending file : main_dig1.bmp ...�[0m
�[0;32mI (238689) flow_controll: File sending complete�[0m
uri: /img_tmp/main_dig2.bmp
1 uri: /img_tmp/main_dig2.bmp, filename: main_dig2.bmp, filepath: /sdcardmain_dig2.bmp
File to upload: main_dig2.bmp
ClassFlowControll::GetJPGStream main_dig2.bmp
�[0;32mI (239539) flow_controll: Sending file : main_dig2.bmp ...�[0m
�[0;32mI (239539) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana4.bmp
1 uri: /img_tmp/main_ana4.bmp, filename: main_ana4.bmp, filepath: /sdcardmain_ana4.bmp
File to upload: main_ana4.bmp
ClassFlowControll::GetJPGStream main_ana4.bmp
�[0;32mI (240369) flow_controll: Sending file : main_ana4.bmp ...�[0m
�[0;32mI (240379) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana1.bmp
1 uri: /img_tmp/main_ana1.bmp, filename: main_ana1.bmp, filepath: /sdcardmain_ana1.bmp
File to upload: main_ana1.bmp
ClassFlowControll::GetJPGStream main_ana1.bmp
�[0;32mI (241309) flow_controll: Sending file : main_ana1.bmp ...�[0m
�[0;32mI (241319) flow_controll: File sending complete�[0m
uri: /img_tmp/main_dig3.bmp
1 uri: /img_tmp/main_dig3.bmp, filename: main_dig3.bmp, filepath: /sdcardmain_dig3.bmp
File to upload: main_dig3.bmp
ClassFlowControll::GetJPGStream main_dig3.bmp
�[0;32mI (242139) flow_controll: Sending file : main_dig3.bmp ...�[0m
�[0;32mI (242149) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana3.bmp
1 uri: /img_tmp/main_ana3.bmp, filename: main_ana3.bmp, filepath: /sdcardmain_ana3.bmp
File to upload: main_ana3.bmp
ClassFlowControll::GetJPGStream main_ana3.bmp
�[0;32mI (243019) flow_controll: Sending file : main_ana3.bmp ...�[0m
�[0;32mI (243029) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana2.bmp
1 uri: /img_tmp/main_ana2.bmp, filename: main_ana2.bmp, filepath: /sdcardmain_ana2.bmp
File to upload: main_ana2.bmp
ClassFlowControll::GetJPGStream main_ana2.bmp
�[0;32mI (243919) flow_controll: Sending file : main_ana2.bmp ...�[0m
�[0;32mI (243929) flow_controll: File sending complete�[0m
uri: /img_tmp/alg_roi.jpg
1 uri: /img_tmp/alg_roi.jpg, filename: alg_roi.jpg, filepath: /sdcardalg_roi.jpg
File to upload: alg_roi.jpg
ClassFlowControll::GetJPGStream alg_roi.jpg
�[0;32mI (245199) flow_controll: Sending file : alg_roi.jpg ...�[0m
�[0;32mI (246199) flow_controll: File sending complete�[0m
handler_wasserzaehler uri:
/wasserzaehler.html?full
uri: /img_tmp/alg_roi.jpg
1 uri: /img_tmp/alg_roi.jpg, filename: alg_roi.jpg, filepath: /sdcardalg_roi.jpg
File to upload: alg_roi.jpg
ClassFlowControll::GetJPGStream alg_roi.jpg
�[0;32mI (297229) flow_controll: Sending file : alg_roi.jpg ...�[0m
�[0;32mI (298229) flow_controll: File sending complete�[0m
uri: /img_tmp/main_dig1.bmp
1 uri: /img_tmp/main_dig1.bmp, filename: main_dig1.bmp, filepath: /sdcardmain_dig1.bmp
File to upload: main_dig1.bmp
ClassFlowControll::GetJPGStream main_dig1.bmp
�[0;32mI (299109) flow_controll: Sending file : main_dig1.bmp ...�[0m
�[0;32mI (299119) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana3.bmp
1 uri: /img_tmp/main_ana3.bmp, filename: main_ana3.bmp, filepath: /sdcardmain_ana3.bmp
File to upload: main_ana3.bmp
ClassFlowControll::GetJPGStream main_ana3.bmp
�[0;32mI (300019) flow_controll: Sending file : main_ana3.bmp ...�[0m
�[0;32mI (300029) flow_controll: File sending complete�[0m
uri: /img_tmp/main_dig3.bmp
1 uri: /img_tmp/main_dig3.bmp, filename: main_dig3.bmp, filepath: /sdcardmain_dig3.bmp
File to upload: main_dig3.bmp
ClassFlowControll::GetJPGStream main_dig3.bmp
�[0;32mI (300869) flow_controll: Sending file : main_dig3.bmp ...�[0m
�[0;32mI (300869) flow_controll: File sending complete�[0m
uri: /img_tmp/main_dig2.bmp
1 uri: /img_tmp/main_dig2.bmp, filename: main_dig2.bmp, filepath: /sdcardmain_dig2.bmp
File to upload: main_dig2.bmp
ClassFlowControll::GetJPGStream main_dig2.bmp
�[0;32mI (301789) flow_controll: Sending file : main_dig2.bmp ...�[0m
�[0;32mI (301799) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana1.bmp
1 uri: /img_tmp/main_ana1.bmp, filename: main_ana1.bmp, filepath: /sdcardmain_ana1.bmp
File to upload: main_ana1.bmp
ClassFlowControll::GetJPGStream main_ana1.bmp
�[0;32mI (302619) flow_controll: Sending file : main_ana1.bmp ...�[0m
�[0;32mI (302629) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana2.bmp
1 uri: /img_tmp/main_ana2.bmp, filename: main_ana2.bmp, filepath: /sdcardmain_ana2.bmp
File to upload: main_ana2.bmp
ClassFlowControll::GetJPGStream main_ana2.bmp
�[0;32mI (303509) flow_controll: Sending file : main_ana2.bmp ...�[0m
�[0;32mI (303519) flow_controll: File sending complete�[0m
uri: /img_tmp/main_ana4.bmp
1 uri: /img_tmp/main_ana4.bmp, filename: main_ana4.bmp, filepath: /sdcardmain_ana4.bmp
File to upload: main_ana4.bmp
ClassFlowControll::GetJPGStream main_ana4.bmp
�[0;32mI (304349) flow_controll: Sending file : main_ana4.bmp ...�[0m
�[0;32mI (304359) flow_controll: File sending complete�[0m
uri: /fileserver/log/message/?readonly=true
uri: /fileserver/log/message/?readonly=true, filename: /log/message/, filepath: /sdcard/log/message/
�[0;32mI (305929) file_server: Found URL query => readonly=true�[0m
�[0;32mI (305929) file_server: Found URL query parameter => readonly=true�[0m
Dirpath: </sdcard/log/message/>, Pathlength: 20
entrypath: </sdcard/log/message/>
Entrypath: /sdcard/log/message/leer.txt
�[0;32mI (305959) file_server: Found file : leer.txt (0 bytes)�[0m
Entrypath: /sdcard/log/message/log_2021-09-10.txt
�[0;32mI (305969) file_server: Found file : log_2021-09-10.txt (820 bytes)�[0m
Autoflow: start
doflow - start 20210910-172149
Flashdauer: 5000
uri: /fileserver/log/message/log_2021-09-10.txt
uri: /fileserver/log/message/log_2021-09-10.txt, filename: /log/message/log_2021-09-10.txt, filepath: /sdcard/log/message/log_2021-09-10.txt
open config file /sdcard/log/message/log_2021-09-10.txt in mode r
�[0;32mI (307989) file_server: Sending file : /log/message/log_2021-09-10.txt (820 bytes)...�[0m
�[0;32mI (307999) file_server: File sending complete�[0m
Image loaded from memory: 640, 480, 3
�[0;31mE (315749) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (315749) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (315749) task_wdt: Tasks currently running:�[0m
�[0;31mE (315749) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (315749) task_wdt: CPU 1: IDLE1�[0m
Vor ft->FindTemplate(_temp1);  /sdcard/config/ref0.jpg
�[0;31mE (321409) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (321409) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (321409) task_wdt: Tasks currently running:�[0m
�[0;31mE (321409) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (321409) task_wdt: CPU 1: IDLE1�[0m
Vor ft->FindTemplate(_temp2);  /sdcard/config/ref1.jpg
�[0;31mE (326559) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (326559) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (326559) task_wdt: Tasks currently running:�[0m
�[0;31mE (326559) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (326559) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (329559) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (329559) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (329559) task_wdt: Tasks currently running:�[0m
�[0;31mE (329559) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (329559) task_wdt: CPU 1: IDLE1�[0m
�[0;31mE (332559) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (332559) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (332559) task_wdt: Tasks currently running:�[0m
�[0;31mE (332559) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (332559) task_wdt: CPU 1: IDLE1�[0m
Alignment: dx -20 - dy -1 - rot -2.080703
2021-09-10T17:22:16
DIGIT[_dig]->ROI.size() 3
DigitalDigit 0 - Align&Cut
DigitalDigit 1 - Align&Cut
DigitalDigit 2 - Align&Cut
/sdcard/config/dig1200s1q.tflite
open config file /sdcard/config/dig1200s1q.tflite in mode rb
DigitalDigit 0 - TfLite
uri: /wasserzaehler_roi.html
1 uri: /wasserzaehler_roi.html, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/wasserzaehler_roi.html
open config file /sdcard/html/wasserzaehler_roi.html in mode r
�[0;32mI (338589) serverhelp: Sending file : /sdcard/html/wasserzaehler_roi.html ...�[0m
�[0;32mI (338599) serverhelp: File sending complete�[0m
�[0;31mE (338609) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (338609) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (338609) task_wdt: Tasks currently running:�[0m
�[0;31mE (338609) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (338609) task_wdt: CPU 1: IDLE1�[0m
uri: /jquery-3.6.0.min.js
1 uri: /jquery-3.6.0.min.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/jquery-3.6.0.min.js
open config file /sdcard/html/jquery-3.6.0.min.js in mode r
�[0;32mI (338649) serverhelp: Sending file : /sdcard/html/jquery-3.6.0.min.js ...�[0m
�[0;32mI (338969) serverhelp: File sending complete�[0m
uri: /readconfigcommon.js
1 uri: /readconfigcommon.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/readconfigcommon.js
open config file /sdcard/html/readconfigcommon.js in mode r
�[0;32mI (338989) serverhelp: Sending file : /sdcard/html/readconfigcommon.js ...�[0m
�[0;32mI (339019) serverhelp: File sending complete�[0m
uri: /gethost.js
1 uri: /gethost.js, filename: , filepath: /sdcard
Filename: 
File requested: /sdcard/html/gethost.js
open config file /sdcard/html/gethost.js in mode r
�[0;32mI (339039) serverhelp: Sending file : /sdcard/html/gethost.js ...�[0m
�[0;32mI (339039) serverhelp: File sending complete�[0m
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=value
TYPE: value
ZW: main	NNN.22120
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=prevalue
TYPE: prevalue
ZW: main	PreValue too old
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=raw
TYPE: raw
ZW: main	NNN.22120
handler_wasserzaehler uri:
/wasserzaehler.html?all=true&type=error
TYPE: error
ZW: main	
uri: /img_tmp/alg_roi.jpg
1 uri: /img_tmp/alg_roi.jpg, filename: alg_roi.jpg, filepath: /sdcardalg_roi.jpg
File to upload: alg_roi.jpg
ClassFlowControll::GetJPGStream alg_roi.jpg
�[0;32mI (340429) flow_controll: Sending file : alg_roi.jpg ...�[0m
�[0;32mI (341409) flow_controll: File sending complete�[0m
�[0;31mE (341609) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:�[0m
�[0;31mE (341609) task_wdt:  - IDLE0 (CPU 0)�[0m
�[0;31mE (341609) task_wdt: Tasks currently running:�[0m
�[0;31mE (341609) task_wdt: CPU 0: task_autodoFlow�[0m
�[0;31mE (341609) task_wdt: CPU 1: IDLE1�[0m
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x401ad193  PS      : 0x00060e30  A0      : 0x801b9a51  A1      : 0x3fff9ee0  
A2      : 0x3ffe2e4c  A3      : 0x3f95fb60  A4      : 0x3f95fa2c  A5      : 0x3f92dde0  
A6      : 0x3f932de0  A7      : 0x3f9691dc  A8      : 0x801ad18f  A9      : 0x3fff9ec0  
A10     : 0x40563838  A11     : 0x401f12dc  A12     : 0x00000000  A13     : 0x3f95f850  
A14     : 0xffd1fcf8  A15     : 0x40563838  SAR     : 0x0000000a  EXCCAUSE: 0x0000001c  
EXCVADDR: 0xffd1fd00  LBEG    : 0x4008a194  LEND    : 0x4008a1b0  LCOUNT  : 0x00000000  

ELF file SHA256: e28c0a570ff021f0

Backtrace: 0x401ad190:0x3fff9ee0 0x401b9a4e:0x3fff9f10 0x40199776:0x3fff9f50 0x4019748b:0x3fff9f70 0x4019754e:0x3fff9f90 0x4018b6bf:0x3fff9fb0 0x4018bc51:0x3fffa070 0x40189dff:0x3fffa0b0 0x400f0edd:0x3fffa170 0x400f11e3:0x3fffa1c0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4
load:0x3fff0034,len:7248
ho 0 tail 12 room 4
load:0x40078000,len:13856
load:0x40080400,len:4052
entry 0x40080688

IMHO, that triggers a déjà vu. The ESPEasy folks had a similar issue some time ago. Long story short: the ESP ran out of memory during a webserver request. ..

@jomjol
Copy link
Owner

jomjol commented Sep 10, 2021

This has been observed since the first versions. Most propably you are right with the assumption of running out of memory.
I'm not working on this as it is "only" a problem in the initial setup procedure. In normal mode there is almost no acces to the html server as the MQTT is doing the data transfer.
Some of the memory leakeas has been removed, but never the less some do remain and it would take a high effort to get ride of all of them. I cannot invest this further due to leak of resources.

Anyway a warning is given on top of the readme, that extensive web access can crash the system. Usually the reboot is quite fast and with prevalue turned on, there is almost no noticable effect to the end user.

@jomjol jomjol closed this as completed Sep 10, 2021
@s0170071
Copy link
Author

but what you could do is keep TF from running if web access is detected. Only start TF processing one minute after the last web access. That should ease things a lot.

Especially when setting up the first time, I can hardly click 2-3 links before it becomes unavailable.

Use a timestamp that updates on every webserver access and compare against it when image processing runs.

@s0170071
Copy link
Author

I did some investigation, the errors that occur have a distinct probability.

Most popular crash was (20 times):
PC: 0x401b0f43: tflite::(anonymous namespace)::MaxEval(TfLiteContext*, TfLiteNode*) at components/tfmicro/tensorflow/lite/micro/kernels/pooling.cc line 68

4 times:
PC: 0x401f2c41: flatbuffers::Table::GetOptionalFieldOffset(unsigned short) const at components/tfmicro/third_party/flatbuffers/include/flatbuffers/flatbuffers.h line 2454

2 times:
PC: 0x400ef78c: CCamera::CaptureToBasisImage(CImageBasis*, int) at components/jomjol_controlcamera/ClassControllCamera.cpp line 332

once each:
PC: 0x401f2c37: flatbuffers::Table::GetOptionalFieldOffset(unsigned short) const at components/tfmicro/third_party/flatbuffers/include/flatbuffers/base.h line 401

PC: 0x401a76c1: tflite::(anonymous namespace)::Eval(TfLiteContext*, TfLiteNode*) at components/tfmicro/tensorflow/lite/micro/kernels/conv.cc line 55

PC: 0x4019da06: tflite::internal::GetFlatbufferTensorBuffer(tflite::Tensor const&, flatbuffers::Vector > const*) at components/tfmicro/tensorflow/lite/micro/micro_allocator.cc line 410

PC: 0x4018b6b7: ClassFlowControll::getReadoutAllabi:cxx11 at /home/john/.platformio/packages/toolchain-xtensa32/xtensa-esp32-elf/include/c++/8.2.0/bits/stl_vector.h line 805

PC: 0x4019d714: flatbuffers::Vector ::Get(unsigned int) const at components/tfmicro/third_party/flatbuffers/include/flatbuffers/flatbuffers.h line 261

PC: 0x401bd1b1: tflite::BytesRequiredForTensor(tflite::Tensor const&, unsigned int*, unsigned int*, tflite::ErrorReporter*) at components/tfmicro/third_party/flatbuffers/include/flatbuffers/flatbuffers.h line 2468

flatbuffers::Offsettflite::SubGraph; flatbuffers::Vector::return_type = const tflite::SubGraph*; flatbuffers::uoffset_t = unsigned int]

@jomjol
Copy link
Owner

jomjol commented Sep 20, 2021

@s0170071 the tflite and flatbuffers are part of the TensorFlow library. therefore internal debugging is a pretty high effort.
Out of experience most of the reboots are comming from running out of memory (e.g. html parallel to the tflite calculation) or slight memory leakage. I did some effort to reduce this, but to be honest, this is really a pain, as you cannot run a debugger, but have to analyse the code after the crash.

Do you have any ideas, how to improve this?

@s0170071
Copy link
Author

I looked into the code, looks like we have plenty of memory. Looks more like invalid objects and so.
Can you check in ClassFlowControll.cpp the line

i = -1; // vorheriger Schritt muss wiederholt werden (vermutlich Bilder aufnehmen)

I am pretty sure this should be
if (i) i-=1;

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

Your totally right - corrected in current rolling

@s0170071
Copy link
Author

s0170071 commented Sep 21, 2021

Can you check in ClassFlowPostProcessing.cpp line

for (int i = 0; i < NUMBERS.size(); ++i)
is it possible that it should be
for (int i = 0; i < NUMBERS.size(); i++)

?

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

++i and i++ dont' make a difference as long as you are not assigning the value or overwrite the ++-Operator.
Therefore both are correct and will work.

@s0170071
Copy link
Author

Its the line (ClassFlowControl.cpp)
std::vector<NumberPost*> numbers = flowpostprocessing->GetNumbers();

that causes the crash. To be more precise, calling flowpostprocessing->GetNumbers(); causes it. The flowpostprocessing pointer seems to be available, i.e. it is not NULL. But you must not access NUMBERS.

Returning NULL in GetNumbers() and not using that any further fixes the crash.

Furthermore, NUMBERS is a vector that contains pointers to multiple NumberPost structs. That struct itself is dangerous as it contains strings.



struct NumberPost {
    float MaxRateValue;
    bool useMaxRateValue;
    bool ErrorMessage;
    bool PreValueOkay;
    bool AllowNegativeRates;
    bool checkDigitIncreaseConsistency;
    time_t lastvalue;
    string timeStamp;
    float FlowRateAct;          // m3 / min
    float PreValue;             // letzter Wert, der gut ausgelesen wurde
    float Value;                // letzer ausgelesener Wert, inkl. Korrekturen
    string ReturnRawValue;      // Rohwert (mit N & führenden 0)    
    string ReturnValue;         // korrigierter Rückgabewert, ggf. mit Fehlermeldung
    string ReturnPreValue;  // korrigierter Rückgabewert ohne Fehlermeldung
    string ReturnValueNoError;
    string ErrorMessageText;        // Fehlermeldung bei Consistency Check
    int AnzahlAnalog;
    int AnzahlDigital;
    int DecimalShift;
    int DecimalShiftInitial;
    int Nachkomma;

    general *digit_roi;
    general *analog_roi;

    string name;
};

Strings in structs are just pointers to a string object itself, which is variable in size.
Thinking about how such a struct could possibly be arranged in the memory makes me dizzy. In general, strings are eval.

I did put a printf debug instruction into GetNumbers()


std::vector<NumberPost*> ClassFlowPostProcessing::GetNumbers()
{

    printf("\n\nxxxx %lx\n\n", (unsigned long ) &NUMBERS);
    return (vector<NumberPost*>) NULL;
    return NUMBERS;

}

What I can't figure out is why that printf only shows once after power up and calling the website. Successive website calls do not trigger it. Maybe related to optimization.
If it does print, it shows that the NUMBERS vector seems to be located at 0x40, which seems wrong.

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

That is strange. Currently I don't see a reason why flowpostprocessing->GetNumbers() should fail at that moment.
GetNumbers() should be called always, when you access the web page, as this is the interface to get the acutal results.

Removing all strings in the code is pain in the ass. I'm not considering this yet at all.

@s0170071
Copy link
Author

s0170071 commented Sep 21, 2021

And yet, this seems to be the root of all evil. If I return NULL in getNumbers, I cant get it to crash, no matter how hard I try. Is it running tf in that state ?

@s0170071
Copy link
Author

in ClassFlowControll.cpp, the code is :

    if (toUpper(_type).compare("[ANALOG]") == 0)
    {
        cfc = new ClassFlowCNNGeneral(flowalignment);
        flowanalog = (ClassFlowCNNGeneral*) cfc;
    }
    if (toUpper(_type).compare(0, 7, "[DIGITS") == 0)
    {
        cfc = new ClassFlowCNNGeneral(flowalignment);
        flowdigit = (ClassFlowCNNGeneral*) cfc;
    }
    if (toUpper(_type).compare("[MQTT]") == 0)
        cfc = new ClassFlowMQTT(&FlowControll);
        
    if (toUpper(_type).compare("[POSTPROCESSING]") == 0)
    {
        cfc = new ClassFlowPostProcessing(&FlowControll, flowanalog, flowdigit); 
        flowpostprocessing = (ClassFlowPostProcessing*) cfc;
    }

The line near the end

cfc = new ClassFlowPostProcessing(&FlowControll, flowanalog, flowdigit);

is critical, since flowanalog and flowdigit may be uninitialized.

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

No, this it not critical, as they are initialized with NULL, which can be handeled by ClassFlowPostProcessing

void ClassFlowControll::SetInitialParameter(void)
{
    AutoStart = false;
    SetupModeActive = false;
    AutoIntervall = 10;
    flowdigit = NULL;
    flowanalog = NULL;
    flowpostprocessing = NULL;
    disabled = false;
    aktRunNr = 0;
    aktstatus = "Booting ...";

}

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

And yet, this seems to be the root of all evil. If I return NULL in getNumbers, I cant get it to crash, no matter how hard I try. Is it running tf in that state ?

I thought a bit about it. The vector array can be pretty big (depending on the number of numbers and ROIs). Maybe it would be better, just to work with a pointer to the NUMBERS, to avoid memory copying. Just uploaded a new rolling version with this change.
At a first test on 4 ESP32s it runs more stable! Thanks for fostering this discussion!

@s0170071
Copy link
Author

lf I understood your code right, then GetNumbers() is a member of ClassFlowPostProcessing. This class is instantiated as object flowpostprocessing in ClassFlowControll::CreateClassFlow.

I put a printf() in InittNumbers() and called it from the ClassFlowPostProcessing constructor. I noticed that the printf was not executed. Could it be that flowpostprocessing is not initialized until the flow is done ? Hence all access to the web interface that invokes GetNumbers() is doomed to fail...

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

No, flowpostprocessing is initiated during the reading of the config.ini.

But you are totally right: getReadoutAll() could be called before the config.ini was fully processed, resulting in a undefined (NULL) pointer access. I changed it to:

string ClassFlowControll::getReadoutAll(int _type)
{
    std::string out = "";
    if (flowpostprocessing)
    {
        std::vector<NumberPost*> *numbers = flowpostprocessing->GetNumbers();
        ...
    }
...

@s0170071
Copy link
Author

If there is no postprocessing section in the config file, flowpostprocessing would not be instantiated. Or is there any other place in the code where the flowpostprocessing pointer is set ?

@s0170071
Copy link
Author

At a first test on 4 ESP32s it runs more stable!

Did you click the "Overview" menu and look at the serial output ? I didn't try your latest code, but my copy crashes very reliably if I click it a couple seconds after boot.

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

If there is no postprocessing section in the config file, flowpostprocessing would not be instantiated. Or is there any other place in the code where the flowpostprocessing pointer is set ?

If there is no postprocessing, the whole system will not make any sense and postprocessing cannot be disabled in the graphical setting. So this should not happen.

@jomjol
Copy link
Owner

jomjol commented Sep 21, 2021

Yes, but if you push it more than 1x during the neural network calculation it still restarts. Looks like a memory overflow in the combination of the http server and the neural network calculation.
Really hard to debugg!

@s0170071
Copy link
Author

s0170071 commented Sep 22, 2021 via email

@s0170071
Copy link
Author

s0170071 commented Sep 22, 2021 via email

@s0170071
Copy link
Author

Another thing that I observed:
In the config file, I got five digits configured:

main.dig1 130 125 33 60
main.dig2 170 124 36 65
main.dig3 214 125 36 65
main.dig4 264 124 38 65
main.dig5 303 123 39 69


later, these get processed:


i 0size 1#> Nach dem Laden in inputi 0size 1i 0size 1Result General(Digit)0: 4
General 1 - TfLite
i 0size 1#> Nach dem Laden in inputi 0size 1i 0size 1Result General(Digit)1: 10
General 2 - TfLite
i 0size 1#> Nach dem Laden in inputi 0size 1i 0size 1Result General(Digit)2: 10
General 3 - TfLite
i 0size 1#> Nach dem Laden in inputi 0size 1i 0size 1Result General(Digit)3: 5
General 4 - TfLite
i 0size 1#> Nach dem Laden in inputi 0size 1i 0size 1Result General(Digit)4: 10
General 0 - TfLite


right before the next Guru, in bool ClassFlowPostProcessing::doFlow(string zwtime) I do printf("Anzahl NUMBERS: %d\n", NUMBERS.size());

It shows 4. Shouldn't that be 5?


i 0size 1#> 	ClassFlowControll::doFlow		Heap:	3072272	Min Free:	1355276	larg. Block: 	3017584	SPI Heap:	3017584	NOT_SPI Heap:	54688	Internal Heap:	54688	Internal Min Heap free:	35036#> 	FlowControll.doFlow - ClassFlowPostProcessing		Heap:	3072204	Min Free:	1355276	larg. Block: 	3017584	SPI Heap:	3017584	NOT_SPI Heap:	54620	Internal Heap:	54620	Internal Min Heap free:	35036


**Anzahl NUMBERS: 4**


Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x40195eae  PS      : 0x00060730  A0      : 0x8018f3f1  A1      : 0x3fff7da0  
A2      : 0x0067706a  A3      : 0x3ffc2b10  A4      : 0x00000004  A5      : 0x3fff7ea8  
A6      : 0x00000006  A7      : 0x0014ae0c  A8      : 0x3ffc2580  A9      : 0x3fff7d80  
A10     : 0x3fff7dc0  A11     : 0x3fff7da8  A12     : 0x3fff7dc0  A13     : 0x3ffc305c  


@jomjol
Copy link
Owner

jomjol commented Sep 22, 2021

  1. I have a JTAG-debugger, but couldn't get it running (tried not really hard yet :-))
  2. wrong number of NUMBERS is strange !!!

I can reproduce the crash, if I push "Overview" several times during the neural network detections. Otherwise it is running smooth. I assume a memory problem within the tflite code. This I cannot debug, as I don't have much insight into this. I will try to use a more recent version. Maybe this is more stable with respect to this.

@s0170071
Copy link
Author

I ordered a debugger.
Maybe it is not memory problem after all. I get a crash after accessing NUMBERS struct. If I do
return (vector<NumberPost*>) NULL;
the programm keeps running (dont use the pointer ;-)
If I do
return NUMBERS;
it crashes. I don't see how this could be related to heap or stack. Both are pointers, so they are the same in size.
In the example in post #1, the core tried to read from address 0xffd1fd00.

According to this there is no memory at this location.

How do you feel about making some of the objects global / static ?

@jomjol
Copy link
Owner

jomjol commented Sep 24, 2021

Global and static could be a solution. But I need to create the content dynamically (don't know, how many maximum ROIs are possible), it might only help partially.
Most propably it is a leakage in the server. Because it usually only crashes when you access the web page. If I leave it alone (only MQTT transfer), it usually runs without problems for more than 100x times. If it reboots 1x/2x a day, that is not really a problem.

Currently I'm cleaning up parts of the code to reduce the dynamic memory usage (remove copy of strings and use pointers to the source, ...). Maybe that helps a bit.

@s0170071
Copy link
Author

s0170071 commented Sep 24, 2021 via email

@s0170071
Copy link
Author

s0170071 commented Oct 6, 2021

1. I have a JTAG-debugger, but couldn't get it running (tried not really hard yet :-))

2. wrong number of NUMBERS is strange !!!

I can reproduce the crash, if I push "Overview" several times during the neural network detections. Otherwise it is running smooth. I assume a memory problem within the tflite code. This I cannot debug, as I don't have much insight into this. I will try to use a more recent version. Maybe this is more stable with respect to this.

My debugger (esp-prog) arrived. I got it up and running with a easy blink example on an ESP32CAM module. The process is not straight forward. See here for a collection of pit-falls that I encounterd. Took me two days. Next stop: running the AIontheedge software with the debugger. Give me some days, I'll keep you posted.

@jomjol
Copy link
Owner

jomjol commented Oct 6, 2021

Great news - looking forward for the update!

Update: you need to compile the AI-on-the-edge with esp-idf version 2.1.0 (=espressif 4.1). With the 4.3 it will not run.

@s0170071
Copy link
Author

s0170071 commented Oct 7, 2021

Figured that. I think some project files are messed up.
I had a clean installation when I could debug the blink project. When I open the EdgeAI poject, VSC constantly shows popups "
Error: Multiple requests to rebuild the project "code" index"
Also, debugging does not work. Spend over three hours on that. The debugger seems to work but the target does not respond.

Have you considered to update the esp-idf version ? I tried, it shows some error with the exceptions. But maybe some of the trouble goes away with the up-to-date version ?

@s0170071
Copy link
Author

s0170071 commented Oct 7, 2021

LOL, I just compiled with the latest IDF. I remove the exceptions, diabled the certificates -> compiles ok but has 100.7% flash memory usage. WTF!

@s0170071
Copy link
Author

s0170071 commented Oct 7, 2021

Oh no...

https://community.platformio.org/t/issue-with-esp32-jtag-scan-chain-interrogation-failed/5267/10

here they say that the SD card uses the jtag pins. That leads to an error where the JTAG complains
Error: JTAG scan chain interrogation failed: all ones

I checked the ESP32cam schematic. This board also uses the JTAG pins for the SD card.

Apart from that, I got the current IDF running, but it crashes frequently. With it it never goes beyond [Alignment]. But on the bright side, this error is pretty reliably, even without web access. Fixing it would probably be a good thing.

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

2 participants