reconnect timeout
Posted: Wed Sep 30, 2020 6:47 am
hi everyone
I'm using ESP8266-7 as the only micocontroller in my project and I have a tiny problem it. there is some times that the internet line is broken and my ESP tries to reconnect to the broker. while this happens, the program freezes until the internet get back online and ESP reconnects to the broker.
I'm using
how can I try to connect to the broker, without using this code or is there any other solution for me?
can ESP connects to the broker in the background while my program is still running?
I'm using ESP8266-7 as the only micocontroller in my project and I have a tiny problem it. there is some times that the internet line is broken and my ESP tries to reconnect to the broker. while this happens, the program freezes until the internet get back online and ESP reconnects to the broker.
I'm using
Code: Select all
library and as I have tested, this problem occurs when I call PubSubClient.h
Code: Select all
. this way the program runs this function and waits till the process finishes. this may take up to 15 seconds.mqtt_client.connect(device_ID.c_str(), mqtt_user.c_str(), mqtt_pass.c_str())
how can I try to connect to the broker, without using this code or is there any other solution for me?
can ESP connects to the broker in the background while my program is still running?