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

Why WiFi.disconnect() in setup? #6

Open
misosec opened this issue Jan 23, 2022 · 1 comment
Open

Why WiFi.disconnect() in setup? #6

misosec opened this issue Jan 23, 2022 · 1 comment

Comments

@misosec
Copy link

misosec commented Jan 23, 2022

Hello,
could you explain to me please, what is the reason behind the lines 495 - 497 in your MQTT_TH_UV_rain/src/main.cpp file? Isn't WiFi connection handled by setup_wifi() function later in the setup() code?

And what about setup_wifi() and setup_mqtt() in all if statements from line 580 down? Isn't WiFi and MQTT already connected?

Thank you.

@bonjour81
Copy link
Owner

Hello, I cannot believe I see your message only now. Sorry for this huge delay.

Line 495-497 : sorry I cannot remember why I put those.maybe was for debug and not needed now.

Repeated setup_wifi/setup_mqtt : allow reconnection if connection get lost (if AP is a bit far for the tiny ESP antenna...). It will do nothing if connection is already well established

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