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

Reconnect after Internet connection was recovered #2

Open
marioishikawa opened this issue Oct 29, 2018 · 8 comments
Open

Reconnect after Internet connection was recovered #2

marioishikawa opened this issue Oct 29, 2018 · 8 comments
Labels
bug Something isn't working

Comments

@marioishikawa
Copy link

I have seen that there are some cases in which the node appears as disconnected from Google Cloud, although there is Internet connection available. It does not reconnect until I restart node-red or execute a new deploy. Is this a normal behavior? Is there a way to set an auto-retry time?

@marioishikawa
Copy link
Author

Although I didn't discover the origin of the problem, looking to the code I noticed that apparently the reconnect time is set to 5000 on this.options.reconnectPeriod = RED.settings.mqttReconnectTime || 5000;. The KeepAlive default time is 60s. When this value is set to less than 5s, the reconnection works.

@marioishikawa
Copy link
Author

Apparently there is still a problem, when Node-Red is started with no connection. In this situation, the MQTT node remains disconneted without retrying to communicate.

@marioishikawa marioishikawa reopened this Dec 17, 2018
@cyberflohr
Copy link
Owner

I'll take a look at that

@marioishikawa
Copy link
Author

I'll take a look at that

Thank you. One question regarding the behavior of the memory database in this situation: the only way to recover the connection is restarting node-red or doing a new deploy. In this case, apparently there is no buffer anymore or the buffer is lost. The local outgoing file, when I checked before deploying (I simply moved the node in the screen and deployed), was empty. But I believe the data was in memory. Is that correct? The data remains in memory only and after a new deploy is lost? I'd like to know what would be the correct sequence of steps to manually recover the connection without losing the data.

@cyberflohr
Copy link
Owner

As described in the README this project ist based on MQTTDB. The in-memory DB is provided by MQTTDB, therefore it would be better to ask this question in the MQTTDB issue board. Nevertheless I will make some tests to find out, how things will work together.

@marioishikawa
Copy link
Author

I asked on the repo MQTTDB and their answer is that it does not lose data when re-started. But this is the behavior I'm observing in this node. Thank you!

@marioishikawa
Copy link
Author

I think this comes from Node-Red MQTT and it is related to this issue.
There is a "try" added to the file.

@cyberflohr cyberflohr added the bug Something isn't working label Mar 21, 2019
@Jaimenms
Copy link

I have the same problem. Any new ideas to solve it???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants