If you are asking a question, please follow this template:
- My goal is:
[
Detect MQTT server not available / disconnect
Using https://github.com/mongoose-os-libs/js-demo-bundle
mongoose_os_version: 2.19.1
Running Mosquitto (MQTT) on Laptop
]
2. My actions are:
[
The code send data to MQTT is working in normal condition
#1. Disconnect the WiFi connection on MQTT server (Laptop)
#2. Stop the Mosquitto server
]
3. The result I see is:
[
Have setup a callback
- mgos_event_add_handler(MGOS_EVENT_CLOUD_DISCONNECTED, mqtt_disconnect_cb, NULL);
#1 - Receive log print out over 20 & 50 lines of following
- mgos_mongoose.c:66 New heap free LWM: 11536
- E:M 18325 (2292 blocks)
#2 - Receive callback from mqtt_disconnect_cb()
]
- My expectation & question is:
[
#1 No Callback event is triggered in this condition
What other event callback can be setup ??
]