ESP8266

Dependencies:   mbed

Fork of Client-ESP8266 by Digital dog

Revision:
2:a3692ba08124
Parent:
1:edcfe804de99
Child:
3:2df821b3eb35
--- a/main.cpp	Sun Dec 10 08:08:29 2017 +0000
+++ b/main.cpp	Sun Dec 10 18:46:31 2017 +0000
@@ -3,7 +3,7 @@
 #include "ESP8266.h"
 
 ESP8266 esp(D8, D2, 9600);
-Serial pc(D1, D0, 115200);
+Serial pc(D1, D0);
 
 char snd[255], rcv[1000];
 
@@ -33,7 +33,7 @@
     pc.printf("%s", rcv);
     
     pc.printf("Connecting to AP\r\n");
-    esp.Join("Mind", "00000000"); // Replace MyAP and MyPasswd with your SSID and password
+    esp.Join("ESP8266-MIND", "mindkafuu"); // Replace MyAP and MyPasswd with your SSID and password
     esp.RcvReply(rcv, 1000);
     pc.printf("%s", rcv);
     wait(8);
@@ -55,13 +55,15 @@
     wait(4);
     
     pc.printf("Connect to Server\r\n");
-    esp.SetPath("TCP", "172.20.10.3", "9999");
+    esp.SetPath("TCP", "192.168.1.53", "80");
     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);
+    while(1) {
+        esp.SetPath("TCP", "192.168.4.1", "80");
+        esp.RcvReply(rcv, 5000);
+        pc.printf("%s", rcv);
+        wait(2);
+    }
 }
\ No newline at end of file