McLab20_esp8266_wifi_mqtt

Files at this revision

API Documentation at this revision

Comitter:
petripakkanen
Date:
Tue Sep 29 08:14:09 2020 +0000
Parent:
2:6d5dbdb22631
Commit message:
Added comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6d5dbdb22631 -r 3e3a9fd1a242 main.cpp
--- a/main.cpp	Tue Sep 29 08:08:02 2020 +0000
+++ b/main.cpp	Tue Sep 29 08:14:09 2020 +0000
@@ -60,6 +60,9 @@
     
     while(1) {
         client.publish(MBED_CONF_APP_MQTT_TOPIC, msg);
+        
+        // Sleep time must be less than TCP timeout
+        // TODO: check if socket is usable before publishing
         ThisThread::sleep_for(30000);
     }
     //client.yield(100);