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 mqtt but no call onConnect and onDisconnect... #277

Open
acer1204 opened this issue Feb 2, 2022 · 3 comments
Open

reconnect mqtt but no call onConnect and onDisconnect... #277

acer1204 opened this issue Feb 2, 2022 · 3 comments

Comments

@acer1204
Copy link

acer1204 commented Feb 2, 2022

my wifi RSSI is -92.
sometimes it will call mqtt.connect finish, but onConnect and onDisconnect will not call.
if lost wifi long time(one hour or two hour). sometimes reconnect wifi success, but call mqtt.connect will no callback with onConnect or onDisconnect event.

in this stage, i try to use xTimerStart to recall mqtt.connect again, but it still no callback anything.
is any way to clear/delete asyncmqttclient obj?
i use disconnect() before connect, but it still not work...

@joelgamal
Copy link

same issue, after mqtt.connect() neither onConnect nor onDisconnect is called.

@bertmelis
Copy link
Contributor

Do you have the broker log?

PS I hate to say, but this lib is built on top of AsyncTCP and that library seems not to be mainainted. It might be that I cannot help with that.

@ajinkya-open
Copy link

ajinkya-open commented Jan 2, 2023

as per my observation , on connect works sometime and sometime not, i have copied forked async library to lib forlder of project platform io that is, its random behaviour

update

when i run sudo service mosquitto restart
device dont run onconenct ()
but if run sudo service mosquitto stop and then sudo service mosquitto restart
device runs onconnect()

may be library is holding previous state of connection for 2/3 loop of onconnect () ...

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

4 participants