i would like to send an message to AWS IoT as soon as connected to the MQTT broker after restart of the esp8266 device.
How do i check the status on the the connection?
Can i read the mgos_mqtt_ev status some how from init.js?
use MQTT.setEventHandler to listen for MG_EV_MQTT_CONNACK - it is delivered when connection to broker was established.
added. however, you don't need to reconnect explicitly, mOS will do it. is this not the case for you?
Hi @rojer ,
Thank you for your information, i just want handle MQTT events for some action, sush as turn on or turn off status LEDs.