ittraining_project_2016 / ESP8266Interface

Dependents:   ESP8266_Test_WIFI

Fork of ESP8266Interface by Steve Kim

Files at this revision

API Documentation at this revision

Comitter:
hank51017
Date:
Fri Jun 24 05:09:07 2016 +0000
Parent:
49:2c05d747bb91
Commit message:
reset change

Changed in this revision

ESP8266/ESP8266.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/ESP8266/ESP8266.cpp	Tue Jul 14 09:09:55 2015 +0000
+++ b/ESP8266/ESP8266.cpp	Fri Jun 24 05:09:07 2016 +0000
@@ -65,7 +65,7 @@
 
 bool ESP8266::join()
 {
-    sendCommand( "AT+CWMODE=1", "change", NULL, 1000);
+    sendCommand( "AT+CWMODE=1", "OK", NULL, 1000);
     string cmd="AT+CWJAP=\""+(string)this->ssid+"\",\""+(string)this->phrase+"\"";
     if( sendCommand( cmd.c_str(), "OK", NULL, 10000) ) {
         // successfully joined the network
@@ -291,9 +291,12 @@
     //send("+++",3);
     wait(1);
     state.cmdMode = true;
-    sendCommand("AT", "OK", NULL, 1000);
-    sendCommand("AT+RST", "ready", NULL, 10000);
+    if(sendCommand("AT", "OK", NULL, 1000) != true)
+        printf("ERROR \r\n");
+    if(sendCommand("AT+RST", "ready", NULL, 10000) !=true)
+        printf("ERROR reset\r\n");
     state.associated = false;
+    reset_pin = 0;
 
 }