Setup and test the Adafruit HUZZAH ESP8266 Wi Fi SOC. Sets SSID and PASSWORD and prints status messages. For use on mbed LPC1768. See https://developer.mbed.org/users/ausdong/notebook/using-the-adafruit-huzzah-esp8266-to-add-wi-fi-to-/
Fork of ESP8266-configuration-mbed-LPC1768 by
Diff: main.cpp
- Revision:
- 3:14e33fec26c3
- Parent:
- 2:c5515c7eba46
- Child:
- 4:f40e7eb1ba1e
diff -r c5515c7eba46 -r 14e33fec26c3 main.cpp --- 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"); }