ESP8266

Dependencies:   mbed

Revision:
1:edcfe804de99
Parent:
0:3222c85ebd43
diff -r 3222c85ebd43 -r edcfe804de99 main.cpp
--- a/main.cpp	Sun Dec 10 06:10:50 2017 +0000
+++ b/main.cpp	Sun Dec 10 08:08:29 2017 +0000
@@ -33,16 +33,17 @@
     pc.printf("%s", rcv);
     
     pc.printf("Connecting to AP\r\n");
-    esp.Join("ESP_FED007"); 
+    esp.Join("Mind", "00000000"); // Replace MyAP and MyPasswd with your SSID and password
     esp.RcvReply(rcv, 1000);
     pc.printf("%s", rcv);
+    wait(8);
+    
+    pc.printf("Check Connected\r\n");
+    esp.look();
+    esp.RcvReply(rcv, 400);
+    pc.printf("%s", rcv);
     wait(2);
     
-    pc.printf("Check Connect\r\n");
-    esp.Check(rcv);
-    esp.RcvReply(rcv, 200);
-    pc.printf("%s", rcv);
-    
     pc.printf("Getting IP\r\n");
     esp.GetIP(rcv);
     pc.printf("%s", rcv);
@@ -54,8 +55,13 @@
     wait(4);
     
     pc.printf("Connect to Server\r\n");
-    esp.SetPath(9999);
+    esp.SetPath("TCP", "172.20.10.3", "9999");
     esp.RcvReply(rcv, 1000);
     pc.printf("%s", rcv);
     wait(4);
+    
+    pc.printf("Check Connected To Server\r\n");
+    esp.check();
+    esp.RcvReply(rcv, 400);
+    pc.printf("%s", rcv);
 }
\ No newline at end of file