MQTT on ESP8266 with NodeMCU - problems with publishing
问题 I'm building a battery powered IoT device based on ESP8266 with NodeMCU. I use mqtt to periodically perform measurements and publish results. I know, that to allow network stack running, I should avoid tight loops and rely on callback functions. Therefore it seemed to me that the right organization of my measurement code should be: interval=60000000 function sleep_till_next_sample() node.dsleep(interval) end function close_after_sending() m:close() sleep_till_next_sample() end function