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

Motor control NodeMCU drops out of WiFi #25

Open
2 tasks
frederikheld opened this issue May 31, 2020 · 3 comments
Open
2 tasks

Motor control NodeMCU drops out of WiFi #25

frederikheld opened this issue May 31, 2020 · 3 comments

Comments

@frederikheld
Copy link
Owner

frederikheld commented May 31, 2020

If the train is powered on for a certain time, the NodeMCU is not available via MQTT anymore as it drops out form WiFi. This can happen after an hour, after a couple of hours, sometimes not at all through the whole day.

You can mitigate the bug by resetting the NodeMCU or by unpowering the train and then powering up again.

Possible Reasons

Arduino Sketch has memory leaks

  • check if the dropout is related to the number of MQTT messages sent to the NodeMCU.

I read about ways the library can leak memory in https://github.com/knolleary/pubsubclient.

I would appreciate help on that as I'm not firm with memory management in C

Other possible issues with the Arduino Sketch

NodeMCU is overheated

With all the electronis inside, the train gets pretty warm. Active ventilation might fix the issue.

@frederikheld frederikheld changed the title Motor control NodeMCU drops out from WiFi Motor control NodeMCU drops out of WiFi May 31, 2020
@frederikheld frederikheld pinned this issue May 31, 2020
@frederikheld
Copy link
Owner Author

No, not yet unfortunately. I didn't dig deeper on that one yet. If you find a solution, I'd be happy about a comment or PR ;-)

@Chetan-99
Copy link

Hey, the issue is resolved.
So I made a function for reconnecting to a wifi like :
reconnectWifi() -> normal function that we initialize in setup()

Now in loo(), apply a check for the wifi connection:
if ( WiFi.status() != WL_CONNECTED){
reconnectWifi();
}

Working flawlessly. Never experienced disconnection after this.
Good Luck

@frederikheld
Copy link
Owner Author

frederikheld commented Jun 12, 2021

Awesome, thank you very much for sharing with me! I'll look into it as soon as I am working on this project again :-) This should fix the issue for me as well :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants