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

WebAuthentication.cpp:73: undefined reference to `mbedtls_md5_starts' #1147

Open
41linea45 opened this issue May 1, 2022 · 35 comments
Open

Comments

@41linea45
Copy link

Hi,
I am using Visual Studio code and added last library to my project.
platform.ini:
env:esp32dev] platform = espressif32 board = esp32dev framework = arduino lib_deps = me-no-dev/ESP Async WebServer@^1.2.3 me-no-dev/AsyncTCP@^1.1.1 ayushsharma82/AsyncElegantOTA@^2.2.6
It gives error:

c:/users/delphi/.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\lib299\libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x4): undefined reference to mbedtls_md5_starts' c:/users/delphi/.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\lib299\libESP Async WebServer.a(WebAuthentication.cpp.o): in function getMD5(unsigned char*, unsigned short, char*)':
D:\Yazilim\Off_Road_2\ESP32\Inclinometer2/.pio/libdeps/esp32dev/ESP Async WebServer/src/WebAuthentication.cpp:73: undefined reference to `mbedtls_md5_starts'

How can i solve this problem? I used just sample code.

@QuangKhuongIoT
Copy link

QuangKhuongIoT commented May 2, 2022

I had the same issue, waiting for the solution.

update: I had check the esp32 framework tool, and realized that the md5.h file had a small changing, the mbedtls_md5_starts() was removed. I think the radical solution is on the next update on the AsyncWebServer library.

update: the WebServer file was use new function mbedtls_md5_starts_ret() instead mbedtls_md5_starts().

@csetera
Copy link

csetera commented May 2, 2022

I just ran into this as well. I forced an older version of the expressif framework in platform.io for now:

  framework = arduino
  platform = espressif32@3.5.0
  board = esp32doit-devkit-v1

@Keanu-Type
Copy link

I just ran into this as well. I forced an older version of the expressif framework in platform.io for now:

  framework = arduino
  platform = espressif32@3.5.0
  board = esp32doit-devkit-v1

is there a way to force older version on Arduino IDE? currently my Platform IO is not running in VS Code(separate problem) so i can barely even try

@IronBamBam1990
Copy link

IronBamBam1990 commented May 6, 2022

your compiler crash out .Try reinstall Platformio and delete library folder in .pio/libdeps/ and than uninstall platformio, find this folder espressif32@3.5.0 and also delete ,also dont install ArduinoIDE in VScode when you running Platformio. but first you should try clean button at VScode or clean all (this function clean also librarys so when you use some custom better make copy of .pio/libdeps/ ). I got similar issue with esp8266 .

@MartinVerges
Copy link

super annoying issue, I used the workaround from #1085 to be able to compile my project. Please fix

@82andre
Copy link

82andre commented May 8, 2022

I think there may be a versioning issue, v1.2.3 was released 3 years ago
https://github.com/me-no-dev/ESPAsyncWebServer/blob/master/library.properties 2 Oct 2019
platformio get this version
https://registry.platformio.org/libraries/me-no-dev/ESP%20Async%20WebServer/versions
then after that at 26 Jul 2021 have a new file without new version
https://github.com/me-no-dev/ESPAsyncWebServer/blob/master/src/WebAuthentication.cpp

My bet is, that platformio will only update their files if you release a new version like 1.2.4

@82andre
Copy link

82andre commented May 8, 2022

https://docs.platformio.org/en/latest/librarymanager/creating.html
"Publishing
You can publish a library to the PlatformIO Registry using pio pkg publish command. Every time when you modify a source code of a library you will need to increment the “version” field in library.json manifest and re-publish again."

@IronBamBam1990
Copy link

IronBamBam1990 commented May 8, 2022

#970

edabf22

@tmattukat
Copy link

Same issue, won´t write to esp until you switch to expressiv 3.5.0; If you use expressiv 3.5.0, then everything should be fine...

@DanteNahuel
Copy link

PlatformIO still gives problems because the version in the json shows as 1.2.3 so Platform doesn't try to update the files.

@JellevanKraaij
Copy link

Any updates on when this is fixed?

@41linea45
Copy link
Author

Hello again
Thank you very much for replies. I apoligize for late feedback.
I solved problem in platformIO like that:

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

@MartinVerges
Copy link

That's not solving, that's just a workaround. We need a simple version upgrade and a clean update of the registry files. This can only be done by the maintainer and it takes as little as a minute to solve the whole problem.

@stale
Copy link

stale bot commented Jul 31, 2022

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@Erriez
Copy link

Erriez commented Aug 17, 2022

Can someone update the library / registry to fix other projects using the old style lib_deps = ESP Async WebServer?
Thanks!

@maverck-
Copy link

I think there may be a versioning issue, v1.2.3 was released 3 years ago
https://github.com/me-no-dev/ESPAsyncWebServer/blob/master/library.properties 2 Oct 2019
platformio get this version
https://registry.platformio.org/libraries/me-no-dev/ESP%20Async%20WebServer/versions
then after that at 26 Jul 2021 have a new file without new version
https://github.com/me-no-dev/ESPAsyncWebServer/blob/master/src/WebAuthentication.cpp

My bet is, that platformio will only update their files if you release a new version like 1.2.4

Following this logic by @82andre (thanks) I was able to solve the problem.
By downloading the library directly (Code -> Download ZIP) and copying it to the libraries folder of my PlatformIO project (Project/lib/ESPAsyncWebServer).

@stale
Copy link

stale bot commented Sep 17, 2022

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

@stale stale bot removed the stale label Sep 17, 2022
@RalphBacon
Copy link

PlatformIO.ini entry

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

This solved it for me (rather then the usual me-no-dev/ESP Async WebServer@^1.2.3 entry) but it means this still has not been "fixed" natively. Still is version 1.2.3.

@me-chiel
Copy link

Thanks for the quick fix:

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

this works for me, took me a while to figure that out....

@kiliw
Copy link

kiliw commented Nov 1, 2022

Has there been an update? Don't think so, right? I came across the issue since my GitHub action failed with this error. If I build the project locally with platform io everything works fine.
I used the approach mentioned above and it fixed the CI build problem

//platfromio.ini
lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer.git

Would love to use the standard way again and not this workaround.

Thanks

@sanjayraojjn
Copy link

replacing
//platfromio.ini
lib_deps = ESP Async WebServer

with

//platfromio.ini
lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer.git

worked.
Is platformIO repo using an older version of the server?

@h0l0gram
Copy link

h0l0gram commented Jan 12, 2023

@me-no-dev Please see #1147 (comment).
It seems to be a quickfix!
Until you release a version >1.2.3 with platformio, all will get this ugly error.

@Jefferson-Lopes
Copy link

I'm still getting this same error

@RalphBacon
Copy link

RalphBacon commented Jan 30, 2023

You can remove this error in PlatformIO by editing

.pio\libdeps\esp32dev\ESP Async WebServer\src\WebAuthentication.cpp

and remove (comment out) the call to mbedtls_md5_starts(&_ctx); (line 74, approx).

image

Or just get the library another way like this:

https://github.com/me-no-dev/ESPAsyncWebServer.git

which seems to force the download of the correct version of the library.

@mjechow
Copy link

mjechow commented Feb 2, 2023

better use mbedtls_md5_starts_ret() instead of commenting out a deprecated method.

@RalphBacon
Copy link

Yes, that seems to be the update in the GitHub:

image

Oddly, I've had no trouble with the call not being there! 😲

@SebastianKotstein
Copy link

SebastianKotstein commented Apr 21, 2023

I ran into the same issue. However, only removing/commenting mbedtls_md5_starts_ret() out worked in my case. If I replace me-no-dev/ESP Async WebServer@^1.2.3 with https://github.com/me-no-dev/ESPAsyncWebServer.git in platformio.ini the web server could not resolve any endpoint (I get a 404 Not Found for any URI).

@acsadamjozsef
Copy link

I could compiled, but it did not work for me with:
"lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer.git"

it just works like changing the decrapted lines to the new versions :
mbedtls_md5_starts_ret(&_ctx);
mbedtls_md5_update_ret(&_ctx, data, len);
mbedtls_md5_finish_ret(&_ctx, _buf);

@sseruzaifa
Copy link

I had the same issue, waiting for the solution.

update: I had check the esp32 framework tool, and realized that the md5.h file had a small changing, the mbedtls_md5_starts() was removed. I think the radical solution is on the next update on the AsyncWebServer library.

update: the WebServer file was use new function mbedtls_md5_starts_ret() instead mbedtls_md5_starts().

thank you, saved my day

@Westcott1
Copy link

Thanks, worked for me too!
Only mbedtls_md5_starts needed to be changed

@andyb749
Copy link

andyb749 commented Nov 21, 2023

I've not tried this.... but if you do a clean, then PlatformIO will go to the repositority to get the latest available version and not use the out of date one in the project.

Failing that, fork the repository to your own Github account make the necessary changes and link to that instead.

A

@mortie
Copy link

mortie commented Feb 3, 2024

@me-no-dev this is still an issue. Is ESPAsyncWebServer unmaintained?

@mjechow
Copy link

mjechow commented Feb 4, 2024

This fork seems to be maintained: https://github.com/esphome/ESPAsyncWebServer

@mortie
Copy link

mortie commented Feb 4, 2024

@mjechow That's what I eventually found as well :) There's a bunch of different forks, but the esphome one seems like the most serious one. I added esphome/ESPAsyncWebServer-esphome@3.1.0 and esphome/AsyncTCP-esphome@2.1.1 to my platformio lib_deps and it works flawlessly so far.

@talhaahmii
Copy link

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

this worked in platform IO

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