jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.67k stars 612 forks source link

httpd_sock_err #153

Closed pcjogi closed 3 years ago

pcjogi commented 3 years ago

I always get the http_sock-err when I try to set up the system. Access via Browser (Edge and Crome tested) gives an empty page back (Failed to load resource: net::ERR_CONNECTION_RESET)

16:42:50.678 -> I (1944) heap_init: Initializing. RAM available for dynamic allocation: 16:42:50.678 -> I (1944) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM 16:42:50.724 -> I (1951) heap_init: At 3FFC2B08 len 0001D4F8 (117 KiB): DRAM 16:42:50.724 -> I (1957) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM 16:42:50.724 -> I (1963) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM 16:42:50.724 -> I (1970) heap_init: At 4009F244 len 00000DBC (3 KiB): IRAM 16:42:50.724 -> I (1976) cpu_start: Pro cpu start user code 16:42:50.724 -> I (1981) spiram: Adding pool of 4096K of external SPI memory to heap allocator 16:42:50.771 -> I (2006) spi_flash: detected chip: generic 16:42:50.771 -> I (2007) spi_flash: flash io: dio 16:42:50.771 -> I (2007) cpu_start: Starting scheduler on PRO CPU. 16:42:50.771 -> I (0) cpu_start: Starting scheduler on APP CPU. 16:42:50.771 -> I (2015) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations 16:42:50.771 -> Do Reset Camera 16:42:50.771 -> I (2025) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  16:42:52.781 -> Init Camera 16:42:52.781 -> I (4035) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.781 -> I (4035) gpio: GPIO[18]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.781 -> I (4035) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.781 -> I (4045) gpio: GPIO[21]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.828 -> I (4055) gpio: GPIO[22]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.828 -> I (4065) gpio: GPIO[23]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.828 -> I (4075) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.828 -> I (4085) gpio: GPIO[34]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.828 -> I (4095) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.875 -> I (4105) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.875 -> I (4115) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:52.875 -> I (4125) sccb: pin_sda 26 pin_scl 27 16:42:52.875 ->  16:42:52.875 -> I (4125) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  16:42:53.015 -> I (4275) camera: Detected OV2640 camera 16:42:53.015 -> I (4275) camera: Allocating 1 frame buffers (150 KB total) 16:42:53.062 -> I (4295) camera: Allocating 150 KB frame buffer in OnBoard RAM 16:42:53.624 -> I (4895) connect_wlan_main: Initializing SD card 16:42:53.671 -> Name: USDU1 16:42:53.671 -> Type: SDHC/SDXC 16:42:53.671 -> Speed: 20 MHz 16:42:53.671 -> Size: 15223MB 16:42:53.671 -> I (4935) server_ota: Start CheckOTAUpdateCheck ... 16:42:53.671 -> Start CheckOTAUpdateCheck ... 16:42:53.671 -> I (4945) server_ota: SHA-256 for the partition table: : 9d4a2809ae90fb20709a8ca3dd3ac3462e1e73286bcd31b689060c91de06fa3a 16:42:53.763 -> I (5005) server_ota: SHA-256 for bootloader: : 09f050e25d82d33ab0250407aa9008f3d55d5db66fe6e62abebedd702bf6102f 16:42:54.466 -> I (5735) server_ota: SHA-256 for current firmware: : fc385b5ab53f3a31011418f497e3047740165fdb4fc3fcf9bf5d1d3e243f10a1 16:42:54.466 -> CheckOTAUpdate Partition: ESP_OK 16:42:54.513 -> file loaded 16:42:54.513 -> ssid = "XXXX" 16:42:54.513 -> password = "YYYY" 16:42:54.513 -> hostname = "watermeter" 16:42:54.513 -> ;hostname is optional 16:42:54.513 -> 16:42:54.513 -> ;if you want to use a fixed IP you need to specify the following 3 parameters (ip, gateway, netmask) with IP4-Addresses "123.456.789.012" 16:42:54.513 -> ;ip = "IP4-ADDRESS" 16:42:54.513 -> ;gateway = "IP4-ADDRESS" 16:42:54.513 -> ;netmask = "255.255.255.0" 16:42:54.560 -> 16:42:54.560 -> ;in some cases you want to specify the DNS server as well (especially, if it is not identical to the gateway - this is optional for a fixed IP 16:42:54.560 -> ;dns = "IP4-ADDRESS" 16:42:54.560 -> WLan: XXXX, YYYY 16:42:54.560 -> Hostename: watermeter 16:42:54.560 -> Fixed IP: , Gateway , Netmask , DNS 16:42:54.560 -> Connect to WLAN with dyn. IP 16:42:54.560 -> I (5825) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE 16:42:54.560 -> I (5825) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE 16:42:54.701 -> I (5955) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 0 16:42:54.701 -> I (5965) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:56.059 -> I (7315) esp_netif_handlers: sta ip: 192.168.5.75, mask: 255.255.255.0, gw: 192.168.5.1 16:42:56.059 -> I (7315) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  16:42:56.059 -> IPv4 : 192.168.5.75 16:42:56.059 -> HostName : watermeter 16:42:56.059 -> 16:42:56.059 -> Netparameter: IP: 192.168.5.75 - GW: 192.168.5.1 - NetMask 255.255.255.0 16:42:56.105 -> Autoflow: sleep for : 200ms 16:42:58.070 -> I (9335) sntp: Time is not set yet. Connecting to WiFi and getting time over NTP. 16:42:58.070 -> I (9335) sntp: Initializing SNTP 16:42:58.070 -> I (9335) sntp: Waiting for system time to be set... (1/10) 16:43:00.081 -> I (11335) sntp: Waiting for system time to be set... (2/10) 16:43:02.092 -> I (13335) sntp: Waiting for system time to be set... (3/10) 16:43:04.057 -> I (15335) sntp: Waiting for system time to be set... (4/10) 16:43:06.069 -> I (17335) sntp: Waiting for system time to be set... (5/10) 16:43:08.082 -> TimeZone set to CET-1CEST,M3.5.0,M10.5.0/3 16:43:08.082 -> Logfile opened: /sdcard/log/message/log_2021-03-16.txt 16:43:08.082 -> I (19345) sntp: The current date/time in Berlin is: Tue Mar 16 16:43:06 2021 16:43:08.082 -> I (19345) sntp: The current date/time in Berlin is: 2021-03-16_16:43 16:43:08.082 -> timeist 20210316-164306 16:43:08.082 -> Logfile opened: /sdcard/log/message/log_2021-03-16.txt 16:43:08.129 -> Logfile opened: /sdcard/log/message/log_2021-03-16.txt 16:43:08.129 -> Logfile opened: /sdcard/log/message/log_2021-03-16.txt 16:43:08.129 -> time 20210316-164306 16:43:08.129 -> Autoflow: sleep for : 200ms 16:43:10.143 -> I (21385) server-main: Starting server on port: '80' 16:43:10.143 -> I (21385) server-main: Registering URI handlers 16:43:10.143 -> I (21385) server_tflite: server_part_camera - Registering URI handlers 16:43:10.143 -> I (21385) server_ota: server_ota - Registering URI handlers 16:43:10.143 -> I (21395) server_GPIO: server_GPIO - Registering URI handlers 16:43:10.143 -> I (21405) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  16:43:10.143 -> I (21415) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0  16:43:10.190 -> [MakeImage] 16:43:10.190 -> Start ReadParameter 16:43:10.190 -> ;LogImageLocation = /log/source 16:43:10.190 -> ;LogfileRetentionInDays = 15 16:43:10.190 -> WaitBeforeTakingPicture = 5 16:43:10.190 -> ImageQuality = 5 16:43:10.190 -> ImageSize = VGA 16:43:10.190 -> ;Brightness = -2 16:43:10.190 -> FixedExposure = false 16:43:10.190 -> 16:43:10.190 -> [Alignment] 16:43:11.734 -> Start ReadParameter 16:43:11.734 -> InitalRotate=180 16:43:11.734 -> /config/ref0.jpg 119 273 16:43:11.734 -> /config/ref1.jpg 456 138 16:43:11.734 -> SearchFieldX = 20 16:43:11.734 -> SearchFieldY = 20 16:43:11.781 -> InitialMirror= false 16:43:11.781 -> AlignmentAlgo = Default 16:43:11.781 -> 16:43:11.781 -> [Digits] 16:43:11.781 -> Start ReadParameter 16:43:11.781 -> Model = /config/dig0811s1.tflite 16:43:11.781 -> ;LogImageLocation = /log/digit 16:43:11.781 -> ;LogfileRetentionInDays = 3 16:43:11.781 -> ModelInputSize = 20 32 16:43:11.781 -> digit1 306 120 37 67 16:43:11.781 -> digit2 355 120 37 67 16:43:11.781 -> digit3 404 120 37 67 16:43:11.781 -> 16:43:11.781 -> [Analog] 16:43:11.781 -> Start ReadParameter 16:43:11.781 -> Model = /config/ana0630s2.tflite 16:43:11.781 -> ;LogImageLocation = /log/analog 16:43:11.781 -> ;LogfileRetentionInDays = 3 16:43:11.781 -> ModelInputSize = 32 32 16:43:11.781 -> analog1 444 225 92 92 16:43:11.781 -> analog2 391 329 92 92 16:43:11.781 -> analog3 294 369 92 92 16:43:11.781 -> analog4 168 326 92 92 16:43:11.781 -> ExtendedResolution = false 16:43:11.781 -> 16:43:11.781 -> [PostProcessing] 16:43:11.828 -> Start ReadParameter 16:43:11.828 -> DecimalShift = 0 16:43:11.828 -> PreValueUse = true 16:43:11.828 -> PreValueAgeStartup = 720 16:43:11.828 -> AllowNegativeRates = false 16:43:11.828 -> MaxRateValue = 0.1 16:43:11.828 -> ErrorMessage = true 16:43:11.828 -> CheckDigitIncreaseConsistency = false 16:43:11.828 -> 16:43:11.828 -> [MQTT] 16:43:11.828 -> 2020-11-30_12-02-22 16:43:11.828 -> 42.013401 16:43:11.828 -> Start ReadParameter 16:43:11.828 -> ;Uri = mqtt://IP-ADRESS:1883 16:43:11.828 -> ;Topic = wasserzaehler/zaehlerstand 16:43:11.828 -> ;TopicError = wasserzaehler/error 16:43:11.828 -> ;ClientID = wasser 16:43:11.828 -> ;user = USERNAME 16:43:11.828 -> ;password = PASSWORD 16:43:11.828 -> 16:43:11.828 -> [AutoTimer] 16:43:11.828 -> Start ReadParameter 16:43:11.828 -> AutoStart = true 16:43:11.828 -> Intervall = 4.85 16:43:11.828 -> 16:43:11.828 -> [Debug] 16:43:11.828 -> Start ReadParameter 16:43:11.828 -> Logfile = false 16:43:11.875 -> LogfileRetentionInDays = 3 16:43:11.875 -> 16:43:11.875 -> [System] 16:43:11.875 -> Start ReadParameter 16:43:11.875 -> TimeZone = CET-1CEST,M3.5.0,M10.5.0/3 16:43:11.875 -> TimeZone set to CET-1CEST,M3.5.0,M10.5.0/3 16:43:11.875 -> ;TimeServer = fritz.box 16:43:11.875 -> ;hostname = watermeter 16:43:11.875 -> SetupMode = true 16:43:11.875 -> 16:43:17.906 -> [Ende]Image loaded from memory: 640, 480, 3 16:43:23.285 -> uri: / 16:43:23.285 -> 1 uri: /, filename: , filepath: /sdcard 16:43:23.285 -> System ist im Setupmodus --> index.html --> setup.htmlFilename: 16:43:23.285 -> File requested: /sdcard/html/setup.html 16:43:23.285 -> I (34535) serverhelp: Sending file : /sdcard/html/setup.html ... 16:43:23.285 -> I (34545) serverhelp: File sending complete 16:43:23.285 -> W (34565) httpd_txrx: httpd_sock_err: error in recv : 104

jomjol commented 3 years ago

I have tested it with freshly downloaded version 6.2.2 and totally reseted system (SD-card formated, ESP32 flash ereased), monitoring through FTDI-adapter with the following browsers:

I could access the inital setup page without any problem on the browser or unuasal error on the serial monitor. Here is the part of the serial, that fails in your setup:

uri: /
1 uri: /, filename: , filepath: /sdcard
System ist im Setupmodus --> index.html --> setup.htmlFilename:
File requested: /sdcard/html/setup.html
I (27316) serverhelp: Sending file : /sdcard/html/setup.html ...
I (27356) serverhelp: File sending complete
uri: /edit_explain_0.html
1 uri: /edit_explain_0.html, filename: , filepath: /sdcard
Filename:
File requested: /sdcard/html/edit_explain_0.html
I (27416) serverhelp: Sending file : /sdcard/html/edit_explain_0.html ...
I (27436) serverhelp: File sending complete

I have no clou what is going wrong with your setup?!? Sorry, that I cannot help. If something comes to my mind I'll update this issue.

pcjogi commented 3 years ago

The reason is somthing with my kaspersky setup on my Windows 10 System. If I use a standard Debian System with Chrome Browser I am albe to go further on . So from my point of view this issue can be closed.

jomjol commented 3 years ago

Thanks for posting the solution and closing the issue.