Core 2.0.3 WiFiClient breaks timeouts #6918
Replies: 2 comments
-
Yes, exactly connected to #6835 which because of the breaking changes we have left for 2.1.0 |
Beta Was this translation helpful? Give feedback.
-
In core v1.0.6, timeouts were in milliseconds. And if I understand, in other espressif cores (8266) and in Arduino they are in milliseconds. In core v2.0.3 they are now in seconds. Why the change? Especially weird as in v2.0.3 it makes no sense to pass anything other that integer multiples of exactly 1000 as a timeout value, and anything less than 1000 is now equal to 0. And to ask again, could 2.0.4 at least add a logw() message and a compiler warning that things are very different in core 2.x? Especially given it was known that the new release was going to break existing code based on 1.0.6. It would save hours of debugging chasing down a thing that was broken but not reported as breaking. |
Beta Was this translation helpful? Give feedback.
-
I'm migrating code from arduino-esp32 core v1.0.6 to core v2.0.3.
Part of what broke is this bit of (highly simplified) code:
The above connects 100% of the time under 1.0.6. but under 2.0.3 it fails 100%.
Using v2.0.3, I could only get it to connect if I left out the timeout parameter, as in:
or if I set the timeout parameter value to at least
1000
as in:So I compared the WiFClient.h and WiFiClient.cpp files from core versions 1.0.6 and 2.0.3.
Of the changes to the v2.0.3
.cpp
file, a number have to do with the way thetimeout
or_timeout
parameter is used, which make it not backward compatible with the core v1.0.6 implementation.It seems that in v2.0.3
timeout
is now a value of seconds instead of ms (but why do we need a uint32_t value for that??). Internal to WiFiClient.cpp a default timeout of 3000ms is used? Why the breaking change in thetimeout
parameter in the call to.connect
? Or am I missing something?If everything has to be in seconds (though why??) under 2.0.3 shouldn't any value of
timeout
less than 1000 throw an error during compile? Or at least a warning? Or use a run-timelogw
in the.cpp
?Regardless, is there a summary somewhere, relative to core 1.0.6, of the way
timeout
(for all WiFiClient methods) is used in core 2.0.3?And an opportunity for improvement -- do the release notes for new core releases track breaking changes? Would be nice (and save hours of debugging) if they did 😄.
Philosophically related to #6835?
Beta Was this translation helpful? Give feedback.
All reactions