Setup and test the ESP8266 Wi Fi SOC from Sparkfun. Sets SSID and PASSWORD and prints status messages. For use on mbed LPC1768. Also reports IP and MAC address. See https://developer.mbed.org/users/4180_1/notebook/using-the-esp8266-with-the-mbed-lpc1768/

Dependencies:   mbed

Fork of ESP8266-configuaration-baudrate by Paul Staron

Files at this revision

API Documentation at this revision

Comitter:
star297
Date:
Tue Feb 10 16:59:16 2015 +0000
Parent:
1:4a9cc6d8c33d
Child:
3:14e33fec26c3
Commit message:
code tidy

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Feb 10 16:35:26 2015 +0000
+++ b/main.cpp	Tue Feb 10 16:59:16 2015 +0000
@@ -9,16 +9,16 @@
 char buf[1024];
 char snd[255];
 
-char ssid[32] = "ssid";    // enter router ssid inside the quotes
-char pwd [32] = "password";    // enter router password inside the quotes
+char ssid[32] = "ssid";     // enter router ssid inside the quotes
+char pwd [32] = "password"; // enter router password inside the quotes
 
 void SendCMD(),getreply(),ESPconfig(),ESPsetbaudrate();
 
 
 int main() {
     
-    pc.baud(115200);    // set what you want here depending on your terminal program speed
-    esp.baud(115200);   // change this to the new ESP8266 baudrate if it is changed at any time.    
+    pc.baud(115200);  // set what you want here depending on your terminal program speed
+    esp.baud(9600);   // change this to the new ESP8266 baudrate if it is changed at any time.    
     
     //ESPsetbaudrate();   //******************  include this routine to set a different ESP8266 baudrate  ******************
 
@@ -46,18 +46,17 @@
     getreply();
     pc.printf(buf);
     
-    wait(1);
-   
+    wait(1);   
    
     pc.printf("\n---------- Get Version ----------\r\n");
     strcpy(snd,"AT+GMR\r\n");
     SendCMD();
     timeout=1;
     getreply();
-    pc.printf(buf);
+    pc.printf(buf);    
     
-    
-    wait(1);    
+    wait(1);
+        
     // set CWMODE to 1=Station,2=AP,3=BOTH, default mode 1 (Station)
     pc.printf("\n---------- Setting Mode ----------\r\n");
     strcpy(snd, "AT+CWMODE=1\r\n");
@@ -68,6 +67,16 @@
     
     wait(1);
     
+    // set CIPMUX to 0=Single,1=Multi 
+    pc.printf("\n---------- Setting Connection Mode ----------\r\n");
+    strcpy(snd, "AT+CIPMUX=1\r\n"); 
+    SendCMD();
+    timeout=1;
+    getreply();
+    pc.printf(buf);
+    
+    wait(1);
+    
     pc.printf("\n---------- Listing Acces Points ----------\r\n");
     strcpy(snd, "AT+CWLAP\r\n");
     SendCMD();