Several months ago I was studying “Building Web Servers ESP32 ESP8266 v2.1”. I was able to successfully build and run examples ‘1.1 – Hello World Web Server’ through and including ‘3.1 – Web Server: Display Sensor Readings (SSE)’ using VS Code and Platform IO. I learned a lot. Thank you both, Sara and Rui. I had to abandon my efforts for at least six months and am now getting back to the book and examples. I decided to spend some review time going over what I had accomplished six months prior. I loaded VSCode/PlatformIO and performed all of the updates I could find. I am now getting a error in all of the examples and I am not sure what I need to do. Here is the output from one of the samples,
****************************************************************************
> Executing task in folder 2_3_Control_Outputs: C:\Users\pauls\.platformio\penv\Scripts\platformio.exe run –environment esp32dev <
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
——————————————————————————————————————–Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
– framework-arduinoespressif32 @ 3.20002.220503 (2.0.2)
– tool-esptoolpy @ 1.30300.0 (3.3.0)
– toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies…
Dependency Graph
|– ESP Async WebServer @ 1.2.3
| |– AsyncTCP @ 1.1.1
| |– FS @ 2.0.0
| |– WiFi @ 2.0.0
|– SPIFFS @ 2.0.0
| |– FS @ 2.0.0
|– AsyncTCP @ 1.1.1
|– WiFi @ 2.0.0
Building in release mode
Linking .pio\build\esp32dev\firmware.elf
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x10): undefined reference to `SHA1Init’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x18): undefined reference to `SHA1Update’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o):(.literal._ZN22AsyncWebSocketResponseC2ERK6StringP14AsyncWebSocket+0x1c): undefined reference to `SHA1Final’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib08d\libESP Async WebServer.a(AsyncWebSocket.cpp.o): in function `AsyncWebSocketResponse::AsyncWebSocketResponse(String const&, AsyncWebSocket*)’:
C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1269: undefined reference to `SHA1Init’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1270: undefined reference to `SHA1Update’
c:/users/pauls/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\pauls\Documents\PlatformIO\Projects\2_3_Control_Outputs/.pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:1271: undefined reference to `SHA1Final’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
=========================================== [FAILED] Took 25.80 seconds ===========================================
The terminal process “C:\Users\pauls\.platformio\penv\Scripts\platformio.exe ‘run’, ‘–environment’, ‘esp32dev'” terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
*******************************************************************************
Basically, I am getting an undefined reference error in the file AsyncWebSocket.cpp for SHA1Init, SHA1Update and SHA1Final. Usually, I am pretty good at resolving errors like these, but I’m not having any luck. Any suggestions, please?
Paul
Hi.
I have no idea what might be causing the issue.
But, after reading this: https://github.com/me-no-dev/ESPAsyncWebServer/issues/1151
I think it has to do with the newest ESP32 boards version.
There are some solutions presented in that discussion. Check them out and see if you can solve the issue.
Regards,
Sara
I just changed
platform = espressif32
to
platform = espressif32 @ ~3.5.0
in my platformio.ini and I just had a successful build. It will take me a little while to check out the code execution, but so far — success!!
Thanks for finding this Sara. I am now closer to giving my daughters web pages to control their RGB lights.
-Paul