@@ -90,7 +90,7 @@ namespace ESP8266_IoT {
90
90
}
91
91
92
92
/**
93
- * Initialize ESP8266 module
93
+ * Initialize ESP8266 module
94
94
*/
95
95
//% block="set ESP8266|RX %tx|TX %rx|Baud rate %baudrate"
96
96
//% tx.defl=SerialPin.P8
@@ -146,7 +146,7 @@ namespace ESP8266_IoT {
146
146
}
147
147
148
148
/**
149
- * Connect to ThingSpeak and set data.
149
+ * Connect to ThingSpeak and set data.
150
150
*/
151
151
//% block="set data to send ThingSpeak | Write API key = %write_api_key|Field 1 = %n1||Field 2 = %n2|Field 3 = %n3|Field 4 = %n4|Field 5 = %n5|Field 6 = %n6|Field 7 = %n7|Field 8 = %n8"
152
152
//% write_api_key.defl=your_write_api_key
@@ -273,7 +273,7 @@ namespace ESP8266_IoT {
273
273
/**
274
274
* Set MQTT client
275
275
*/
276
- //% subcategory=MQTT weight=30
276
+ //% subcategory=MQTT weight=30
277
277
//% blockId=initMQTT block="Set MQTT client config|scheme: %scheme clientID: %clientID username: %username password: %password path: %path"
278
278
export function setMQTT ( scheme : SchemeList , clientID : string , username : string , password : string , path : string ) : void {
279
279
sendAT ( `AT+MQTTUSERCFG=0,${ scheme } ,"${ clientID } ","${ username } ","${ password } ",0,0,"${ path } "` , 1000 )
@@ -306,7 +306,7 @@ namespace ESP8266_IoT {
306
306
}
307
307
308
308
/**
309
- * send message
309
+ * send message
310
310
*/
311
311
//% subcategory=MQTT weight=21
312
312
//% blockId=sendMQTT block="publish %msg to Topic:%topic with Qos:%qos"
@@ -363,6 +363,7 @@ namespace ESP8266_IoT {
363
363
*/
364
364
serial . onDataReceived ( serial . delimiters ( Delimiters . NewLine ) , function ( ) {
365
365
recvString += serial . readString ( )
366
+ pause ( 1 )
366
367
367
368
// received kids iot data
368
369
if ( recvString . includes ( "switchoff" ) ) {
0 commit comments