ESP8266 set up for AT version 1.7.0

Dependencies:   mbed

Use this to set and test the ESP8266.

For ESP8266 firmware v1.7.0 and v1.7.1

restore.. resets the ESP8266 to factory settings with baud rate 115200 this is MBED-OS default setting.

config.. use this if you want to set ssid, password and mode in the ESP8266 flash.

setbaud.. set the ESP8266 baud rate that will stored in ESP8266 flash.

Most platforms will work up to 460800 baud, 921600 works on platforms with a MCU clock speed of 100MHz and above. MBED-OS built in ESP8266 driver only works up to 460800 at time of writing but is considerably faster than the default 115200 .

In most cases use 'restore' and 'setbaud' to reset the ESP8266 back to factory settings with your required baud rate.

Revision:
2:c5515c7eba46
Parent:
1:4a9cc6d8c33d
Child:
3:14e33fec26c3
--- 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();