-
Notifications
You must be signed in to change notification settings - Fork 25
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
connect() hangs system when client not available #8
Comments
Last I checked there are no issues there, the client code has a default timeout of 10 seconds where it’ll wait for a client to connect before determining that nothing is there. There is already a function to set the timeout from your sketch, client.setConnectionTimeout(uint16_t milliseconds). Can you verify if it’s actually freezing or not by reducing the timeout to something more manageable. 10 seconds was the default for the w5500 library so I left it as is so that the functionality would line up. |
I checked a small test program. And indeed it works...but only in the Arduino IDE, when I copy it into PlatformIO it hangs as before...
|
I was able to get around a similar problem by changing the "while" in line 293 of the NativeEthernet.cpp file to an "if". I assumed my program was hanging up there and when I made the change, my program moved on. |
In the setup() I want to connect to a MQTT broker, this works fine when the broker is online but fails when the broker is not online. I expected that the connect() function returns a false when it cannot connect but instead the system does not get anything back and freezes...
The text was updated successfully, but these errors were encountered: