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

Doubt regarding reducing socket timeout #47

Open
jassi00713 opened this issue Mar 30, 2018 · 3 comments
Open

Doubt regarding reducing socket timeout #47

jassi00713 opened this issue Mar 30, 2018 · 3 comments

Comments

@jassi00713
Copy link

When i suddenly take out or switch off the mesh Gateway, the nodes still keep showing a valid connection for sometime.

How to reduce that time?
Keep Alive time or something like that needs to be reduced

@PhracturedBlue
Copy link
Owner

Do you mean that the nodes don't detect that the gateway node is no longer present, and so don't try to find an alternate path?

This appears to be an issue with the ESP8266 core code, and I'm not sure it is fixable. As per this message from a year ago, it doesn't seem to be configurable:
esp8266/Arduino#3279 (comment)

A workaround may be to send a 'ping' every so often and reset if it isn't returned. If the 2.4.0 core didn't address this, that may be the only option.

@jassi00713
Copy link
Author

hmm
It seems that changing the keep alive time is not allowed in the SDK.
Well, we will have to settle with sending the pings which is not a bad option.

@PhracturedBlue
Copy link
Owner

Actually, I am not sure why this isn't already working. There is an onTimeout callback which should be triggered within 5 seconds if there is no ACK from the server after sending a message. Yet I don't see the expected timeout getting called in this case. We may be able to use the lack of an ACK to trigger the disconnect though. When things are working, every packet gets ACKed quickly. When things stop working, we don't see the ACKs come in.

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

2 participants