knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

pubsubclient::callback() not working with wifimanager #916

Closed hitenlulla closed 2 years ago

hitenlulla commented 2 years ago

Hello, I'm facing an issue, the callback() of pubsubclient is not working with wifimanager. I've used FS to store the Wifi Credentials, MQTT Server IP, MQTT username using WiFiManager and then later connect to MQTT using it. Debugging shows that MQTT is connected successfully and I'm able to run client.loop() but there is no response from callback(). I've set digital pins on esp8266 to toggle HIGH and LOW based on callback payload values but they don't work. Note: When I hardcode the Wifi Credentials, MQTT Server IP, MQTT username in the code, it works properly. Can anyone help me regarding this issue?