-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Problem whit reconnect when wifif is off at start #629
Comments
Can you post your code? |
This is the code, as i said it works perfect when the wifi is reset, but only if the wifi was On at the startup of the esp8266, when i get to this part of the code client.connected() shows that the esp8266 is not connected, but is connected because is publishing messages. |
try to disconnected then re-connect. You must assume that wifi is not always available and take appropriate action. |
i have a similar problem, in my case i disable wifi after its been running for awhile:
my output looks like this:
it just seems to stall at that last message. which happens shortly after i disable/enable wifi on my router |
i forgot to add, in my other terminal where i receive the messages i get up to i'm also running this on an esp32 board, not ESP8266 as the example mentions |
@mdeanda you also need to disconnected the pubsubclient client after wifi was disconnected. Then after the wifi connectes again you do a connect. The disconnect of pubsubclient was important for me to get stable re-connects. |
Hi! I try to use this the same program code on d1mini esp8266, and I see that function callback(...) does not work properly. On cloudmqtt not work! On local server I receive one message from 10 published! I read in internet that this bug appeared from ver 2.2. I use ver 2.7. What I doing wrong or this problem really exist?thx. |
hello, i have a problem, im using a esp8266, Everithing works perfect, but when the esp8266 start and dont have internet at the start, then if a few moments later it get internet, the client.conected function keep showing that is disconnected, but i can send mqtt messages, i need to use this function, is there any bug or i am missing something?
The text was updated successfully, but these errors were encountered: