nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.64k stars 3.12k forks source link

MQTT connfail fix #3477

Closed stromnet closed 2 years ago

stromnet commented 2 years ago

Noticed that cb_connect_fail_ref was not properly called sometimes, after wifi was reconnected (for example, explicit clearconfig + config). Seems DNS is resolved fine but the espconn returned -4. Since return value was ignored, the failure callback was never trigged, and LUA code could not see react properly (i.e. re-trigger connect attempt in my case)