HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

ESP_Minatel
Posts: 364
Joined: Mon Jan 04, 2021 2:06 pm

HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ESP_Minatel » Thu Aug 12, 2021 1:51 pm

Hello!

We are close to releasing the Arduino ESP32 support version 2.0.0. To make it better, we need your help to test this RC1 version in order to release with most of the bugs fixed.

If you are testing the version 2.0.0 and have found a bug, please comment here or directly in our GitHub repository.

https://github.com/espressif/arduino-esp32

To install the RC1 version, you can follow these instructions, selecting the development release JSON link:

https://docs.espressif.com/projects/ard ... lling.html

JSON link:

Code: Select all

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
Any help you can provide will be appreciated!

Thank you!

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Fri Aug 13, 2021 7:14 am

I am very interested to test this, but I am on PlatformIO. Do you have guidance for use there as well?

My request for help was basically met with cryptic or snarky remarks https://github.com/espressif/arduino-esp32/issues/5489

Tried it again elsewhere with not better result https://github.com/espressif/arduino-es ... -896583973

Last state is that I can compile with

Code: Select all

platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
but the linker complains about

Code: Select all

/home/ullix/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32dev/lib741/libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x8): undefined reference to `mbedtls_md5_starts
I'd be very happy to test, but unfortunately I can't solve this on my own.

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby felmue » Fri Aug 13, 2021 10:35 am

Hello @ullixesp

yes, you'll need a fresh copy of ESPAsyncWebServer - me-no-dev fixed this linker issue about 18 days ago.

https://github.com/me-no-dev/ESPAsyncWe ... d020856a0a

@me-no-dev: thank you very much for fixing this issue.

Thanks
Felix

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Fri Aug 13, 2021 11:27 am

I'm still getting only error:

Code: Select all

Linking .pio/build/esp32dev/firmware.elf
/home/ullix/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32dev/lib741/libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x8): undefined reference to `mbedtls_md5_starts'
/home/ullix/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32dev/lib741/libESP Async WebServer.a(WebAuthentication.cpp.o): in function `getMD5(unsigned char*, unsigned short, char*)':
/home/ullix/Code/platformio/ampp-v0.4/.pio/libdeps/esp32dev/ESP Async WebServer/src/WebAuthentication.cpp:74: undefined reference to `mbedtls_md5_starts'

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby felmue » Fri Aug 13, 2021 12:03 pm

Hello @ullixesp

Hmm, that is strange. In the latest version of ESPAsyncWebServer `mbedtls_md5_starts()` doesn't exist - the only similar function I can find is `mbedtls_md5_starts_ret()`. Are you sure you are compiling with the latest version?

Thanks
Felix

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Fri Aug 13, 2021 12:36 pm

How would I know? I can only guess on what to use. I my pio ini is:

Code: Select all

platform =
	https://github.com/platformio/platform-espressif32.git#feature/idf-master

board = esp32dev
framework = arduino
platform_packages =
	framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-rc1

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby felmue » Fri Aug 13, 2021 1:30 pm

Hello @ullixesp

try adding something like this in your platformio.ini:

Code: Select all

lib_deps =
    https://github.com/me-no-dev/AsyncTCP.git#master
    https://github.com/me-no-dev/ESPAsyncWebServer.git#master
That should download the latest version of those two libraries.

Thanks
Felix

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Sat Aug 14, 2021 8:51 am

@felmue With that addition the code now compiles, links, and runs. But this can't be right; the result is too weird!

First, the code size of ~1MB is now some 100k(!) smaller. Sure, efficiencies can be gained, but in this magnitude?

Code: Select all

; old code:
; 10:03:30.615 > ESP IDF Version  : v3.3.5-1-g85c43024c
; 10:03:30.618 > SketchSize       : 1299248 B (90.11% of Max)

; new code:
; 10:25:56.452 > ESP IDF Version  : v4.4-dev-2030-gd93887f9f-dirty
; 10:25:56.457 > SketchSize       : 1175840 B (81.55% of Max)  (Note: 123408 B smaller)
Second, I am creating web pages, and from them load Javascript. In the old code the loading takes a few 10 ms, while in the new code mostly several 100 ms, if not several seconds, if at all!

Further, of the of the 4 ... 5 JS loadings, it seems only the last one is actually "arriving" in the browser, and thus JS code complains about functions being not available. Very strange.

This is the relevant part of my pio ini:

Code: Select all

[env:esp32dev]
board = esp32dev
framework = arduino

platform =
	; old code: espressif32
	https://github.com/platformio/platform-espressif32.git#feature/idf-master

platform_packages =
	; old code: none
	framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-rc1

lib_deps =
	; old code: me-no-dev/ESP Async WebServer@^1.2.3
	https://github.com/me-no-dev/ESPAsyncWebServer.git#master
	https://github.com/me-no-dev/AsyncTCP.git#master
 	; other libs ...

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Wed Aug 18, 2021 9:03 am

Whatever has changed in RC1 and its IDF-4.4 base: it has gotten even WORSE !

One of my big problems with an ESP32 is the download of files well >100k. Generally, using Arduino-Code based on IDF-3.3.5, every 2nd download attempt results in a Watch-Dog-Timer generated crash. Now I see 70% crashes!

There is already a long discussion here: https://github.com/me-no-dev/ESPAsyncWe ... issues/984

What has so far come out:
  • it is seen on all ESP32s, be they old revision 1 or latest revision 3 on Arduino-framework
  • There seems to be some influence of the flash-manufacturer
  • it is NOT seen on an ESP8266 with equivalent code on Arduino-framework
  • it is NOT seen on an ESP32 running under the IDF-framework (no flash influence whatsoever)
I have created a testing-package for use on both PlatformIO and Arduino, available here: https://github.com/ullix/ESP32-Flash-Crash. The code creates a web page, which attempts to download big files by JavaScript, and registers the success or failure on the ESP32. I have now used pio to also test the RC1 version, with matching ESPAsyncWebServer and AsyncTCP. The complete pio configuration is shown below; see notes for using either IDF-3.3.5 or IDF-4.4 base.

The result: out of a total of >1200 download attempts of files of 300k, about 70%(!) resulted in a WDT triggered crash with subsequent boot, see red-framed part of screenshot .

The fact that no problem is seen on IDF seems to rule out that this is a hardware problem, irrespective of a possible flash type influence when using Arduino code. I did investigate the Webserver and Async behaviour more deeply, and it does not look like the they are creating the problem. Most likely seems to me now the WiFi code.
Auswahl_055-w250.png
Auswahl_055-w250.png (77.02 KiB) Viewed 10683 times

Code: Select all

 
; PlatformIO Project Configuration File

[platformio]
description = DEMO Crash by WDT when downloading big files

[env:esp32dev]
board = esp32dev
framework = arduino

platform =
    ; espressif32                                                                                                  ; uncomment for IDF-3.35
    https://github.com/platformio/platform-espressif32.git#feature/idf-master   ; uncomment for IDF-4.4

platform_packages =
    ; no platform_packages used in IDF-3.3.5
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-rc1 ; uncomment for IDF-4.4

lib_deps =
    ; me-no-dev/ESP Async WebServer@^1.2.3                                      ; uncomment for IDF-3.35
    https://github.com/me-no-dev/ESPAsyncWebServer.git#master       ; uncomment for IDF-4.4
    https://github.com/me-no-dev/AsyncTCP.git#master                      ; uncomment for IDF-4.4

    powerbroker2/SafeString@^4.1.5
    lorol/LittleFS_esp32@^1.0.6

monitor_speed = 115200
monitor_filters =
    log2file
    time
    default
    send_on_enter
    esp32_exception_decoder

upload_speed = 921600
upload_port = /dev/ttyUSB0
build_flags = -D CORE_DEBUG_LEVEL=4
board_build.partitions = partitions.csv

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: HELP NEEDED: Arduino ESP32 Support RC1 test (version 2.0.0)

Postby ullixesp » Thu Aug 19, 2021 12:47 pm

Another example, where RC1 seriously fails ( code at the end):

This is how it should be, the "old version": a web page is created with a table, which is filled by using several JS files. The web page is build up in adequate time, and then updated with data ("lastavg") every 1 sec by a JS timer:

Auswahl_058.png
Auswahl_058.png (179.1 KiB) Viewed 10525 times


This is what it is using the RC1 code, the "new version". Two of the JS scripts ( see red frame ) aren't downloaded at all (size is 0 B), although they have the web status "200" = OK. With the essential scripts missing, no data can be downloaded and the table remains empty.

Auswahl_060.png
Auswahl_060.png (125.36 KiB) Viewed 10525 times

On top of this, whatever is downloaded took about an order of magnitude more time, see yellow frame. The d3* file download took 7 sec compared to 0.3 sec, so 20x longer. Sometimes it takes even 20 sec (!), i.e. takes 60x longer!

This is the relevant code used on the web page and the corresponding webserver code; I think it is straight forward?

Code: Select all

# Web page
<script src="/d3.v5.min.js"></script>
<script src="/am_common.js"></script>
<script src="/am_extra.js"></script>
<script src="/am_dates.js"></script>


# Web server code
server.on("/am_dates.js",   HTTP_GET, [] (AsyncWebServerRequest *request) {request->send(200, text_js, am_dates_js); });
server.on("/am_common.js",  HTTP_GET, [] (AsyncWebServerRequest *request) {request->send(200, text_js, am_common_js);});
server.on("/am_extra.js",   HTTP_GET, [] (AsyncWebServerRequest *request) {request->send(200, text_js, am_extra_js); });
server.on("/d3.v5.min.js",  HTTP_GET, [] (AsyncWebServerRequest *request) {
        AsyncWebServerResponse *response = request->beginResponse(*myFS, "/web/d3.v5.min.js.gz",   text_js);
        if (response != NULL) {
            response->addHeader("Content-Encoding","gzip");
            request->send(response);
        } else {
            request->send(404);
        }
});
And here are parts of the settings of the pio ini. The only difference is in the platform and platform_packages settings.

Code: Select all

; old version (working ok)
[env:esp32dev]
framework = arduino
board = esp32dev

platform =
    espressif32

lib_deps =
    https://github.com/me-no-dev/ESPAsyncWebServer.git#master
    https://github.com/me-no-dev/AsyncTCP.git#master

===================================================================================

; new version (not working ok)
[env:esp32dev]
framework = arduino
board = esp32dev

platform =
    https://github.com/platformio/platform-espressif32.git#feature/idf-master
platform_packages =
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-rc1

lib_deps =
    https://github.com/me-no-dev/ESPAsyncWebServer.git#master
    https://github.com/me-no-dev/AsyncTCP.git#master

Who is online

Users browsing this forum: No registered users and 98 guests