-
Notifications
You must be signed in to change notification settings - Fork 13.3k
hostByName encounters IN_PROGRESS status and immediately returns #3353
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
Comments
Hi, i have tried running the code snipped (setting |
Unfortunately, the code above no longer exists - I've switched to the builtin HTTP library, which seems to work better. If you don't mind running the entire project, it requires TimeLib and can be found here. The HTTP based rewrite still encounters some oddities from time to time, as seen below:
If running this full project is a bit overwhelming, I think a simpler example would be to run a GET request every 10-12 seconds in a loop, and catch any errors that may occur. This is essentially what my project is doing at the moment, and could probably significantly reduce the noise for finding the possible bug. EDIT: Something else that may help - not sure if this is related, but the 10-12 second delay in my code is a while loop that constantly checks the time. This while loop requires me to feed the WDT in order to prevent a reset... not sure if that would impact the WiFi or not. |
I was able to resolve my |
Closing per previous comment. |
During a normal client connection, there are periods within execution that the client fails to connect with the server immediately without any noticeable delay. (This means that in my serial logs, the program would print a connection attempt, and immediately print that it failed.)
My code essentially can be boiled down to this:
"Do stuff here" executes successfully for the first few data transmissions, and then begins to fail afterwards for a significant period of time, usually for 2-6 minutes of failed connections before sparsely succeeding again.
Upon enabling debugging on Serial, as well as Core+WiFi debugging, I see this:
At the very beginning, hostByName succeeds. After a few lookups, however, it begins failing as shown above.
I've traced this message to here, where there is some info about the message printed. Searching the error codes leads to this header, which defines each error semantically. -5 seems to be the IN_PROGRESS error, which seems to get handled but does not seem to pause for execution to succeed.
As an additional check, I tried using the latest version on Git (with the newest SDK 2.1.0 branch), and this problem seems to occur there too.
Is this an error on my part (as in should I be specifying a timeout of some sort?), or is there some sort of strange handling going on in the library?
The text was updated successfully, but these errors were encountered: