-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Webserver.on calls wrong Callback #11074
Comments
Arduino Core 2.0.17 is out of support. |
Yes .... but that's what is delivered in platformio with the newest Platform Espressif32, V6.10.0 .... No way,... Then please take another, not "out of support" Version to see if there is as well a wrong called Callback. |
It is the other way around it works. In github issues people provide an example for the actual version where an error occurs. |
Hello Jason2866, I agree in principal.
The result is the same. It calls the ufn function and not (as expected and correctly until 2.0.14) the fn function. |
Hello @ams-hh as you already mentioned there is a new method I did some digging and it looks like A A I think a possible way to mimic the previous behavior is to subclass So in your code you could do the following:
Thanks |
Hello Felix, thanks for the effort you made! I am not a friend of manipulating core functions or libraries. It's quickly forgotten and after the next update the issue is probably (no ... for sure) back and the correction made is presumably overwritten .... I made the following: This second function works correctly. I use it for the fn function. So the combination in general works ok. Not nice ... but I do not have to change anything in the core. Best regards |
.... but beside of the workaround .... is this an error or not? |
Hello @ams-hh thank you for sharing your workaround. As whether this is an error or wanted behavior I cannot say, sorry. Well, actually my proposal wouldn't require modifying the core or libraries - it would all be in your own code. That said, I agree, it still could break with the next update. Thanks |
Board
ESP32-S3 on custom PCB
Device Description
Described issue is device independant
Hardware Configuration
Independant
Version
v2.0.17
IDE Name
platformio
Operating System
Windows 11
Flash frequency
?
PSRAM enabled
no
Upload speed
921600
Description
After several years of "works as expected" I now have crashes inside the Webserver.
(WebServer.h. "Now" means: Change from framework-arduinoespressif32 @ 3.20014 to framework-arduinoespressif32 @ 3.20017)
WbServer.h offers the method
to define two callbacks "Function" and "Uploads Function".
As said, until V 3.20014 everything worked as expected. From 3.20017 on, when exceuting a POST to the fn, THE UFN is called. NOT THE FN. (And my system then crashes because of wrong handling ...)
To demonstrate I provide:
DEMO PROGRAM
(see below)
PLATFORMIO.INI
(I use a custom board file. Substitude it by an own board for ESP32-S3)
HTML FILE
Why?
Can someone verify? Or provide a solution?
Thank you !
P.S.
There is a change in RequestHandlersImpl.h. in the class FunctionRequestHandler.
There appears two new methods canRaw and raw that do not exist in Version
3.20014. And they do something with the _ufn parameter. But I did not digg into deeper ...
Sketch
Debug Message
Other Steps to Reproduce
0.) (Substitude SSID/PW in program for your needs!)
1.) Build the project with project environment esp32S3-with-6-6-0 (which comes with Version 2.14)
2.) Run and see the connected IP
3.) Substitude IP in HTML-File
4.) Open Brower and execute HTML-File
5.) See in PIO Terminal, that Function FN ist called
---> Works as expected
6.) Change to project environment esp32S3-with-6-10-0 (which comes with Version 2.17) and build
... rest the same as before
---> See in PIO Terminal, that Function UFN ist called. (... and than FN...?)
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: