Open acer1204 opened 2 years ago
same issue, after mqtt.connect()
neither onConnect
nor onDisconnect
is called.
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.
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 () ...
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...