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:
3:14e33fec26c3
Parent:
2:c5515c7eba46
Child:
4:cd4543cf2f9c
--- a/main.cpp	Tue Feb 10 16:59:16 2015 +0000
+++ b/main.cpp	Tue Feb 10 17:14:53 2015 +0000
@@ -23,6 +23,24 @@
     //ESPsetbaudrate();   //******************  include this routine to set a different ESP8266 baudrate  ******************
 
     ESPconfig();        //******************  include Config to set the ESP8266 configuration  ***********************
+    
+   
+   // contiuosly get AP list and IP
+    while(1){
+        pc.printf("\n---------- Listing Acces Points ----------\r\n");
+        strcpy(snd, "AT+CWLAP\r\n");
+        SendCMD();
+        timeout=3;
+        getreply();   
+        pc.printf(buf);
+
+        pc.printf("\n---------- Get IP's ----------\r\n"); 
+        strcpy(snd, "AT+CIFSR\r\n");
+        SendCMD();
+        timeout=2;
+        getreply(); 
+        pc.printf(buf);
+    }    
      
 }
 
@@ -107,6 +125,15 @@
     getreply(); 
     pc.printf(buf);
     
+    wait(1);
+    
+    pc.printf("\n---------- Get Connection Status ----------\r\n"); 
+    strcpy(snd, "AT+CIPSTATUS\r\n");
+    SendCMD();
+    timeout=2;
+    getreply(); 
+    pc.printf(buf);   
+    
     pc.printf("\n\n\n  If you get a valid IP, ESP8266 has been set up.\r\n");
     pc.printf("  Run this if you want to reconfig the ESP8266 at any time.\r\n");
 }