IUPUI ESP8266 config code for IU Device net, make sure you first run this , get the MAC address of you module, register the device with IU Device net. after that there is no need for a password, just run this program once on your module, it will save password

Dependencies:   mbed

Fork of ESP8266-configuration-mbed-LPC1768 by jim hamblen

Files at this revision

API Documentation at this revision

Comitter:
imomoh
Date:
Mon Apr 30 07:11:33 2018 +0000
Parent:
5:9f46b8cdd469
Commit message:
NO

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 9f46b8cdd469 -r 282abce8e842 main.cpp
--- a/main.cpp	Fri Aug 28 01:21:15 2015 +0000
+++ b/main.cpp	Mon Apr 30 07:11:33 2018 +0000
@@ -1,16 +1,16 @@
 #include "mbed.h"
 
 Serial pc(USBTX, USBRX);
-Serial esp(p28, p27); // tx, rx
-DigitalOut reset(p26);
+Serial esp(D1, D0); // tx, rx
+DigitalOut reset(D3);
 Timer t;
 
 int  count,ended,timeout;
 char buf[1024];
 char snd[255];
 
-char ssid[32] = "mySSID";     // enter WiFi router ssid inside the quotes
-char pwd [32] = "myPASSWORD"; // enter WiFi router password inside the quotes
+char ssid[32] = "IU DeviceNet";     // enter WiFi router ssid inside the quotes
+char pwd [32] = ""; // enter WiFi router password inside the quotes
 
 void SendCMD(),getreply(),ESPconfig(),ESPsetbaudrate();
 
@@ -36,7 +36,8 @@
     // continuosly get AP list and IP
     while(1) {
         pc.printf("\n---------- Listing Acces Points ----------\r\n");
-        strcpy(snd, "AT+CWLAP\r\n");
+       // strcpy(snd, "AT+CWLAP\r\n");
+       pc.printf("\n---------- skip listing access points ----------\r\n");
         SendCMD();
         timeout=15;
         getreply();
@@ -116,7 +117,8 @@
     wait(2);
 
     pc.printf("\n---------- Listing Access Points ----------\r\n");
-    strcpy(snd, "AT+CWLAP\r\n");
+  //  strcpy(snd, "AT+CWLAP\r\n");
+   pc.printf("\n---------- skip listing access points ----------\r\n");
     SendCMD();
     timeout=15;
     getreply();
@@ -135,6 +137,7 @@
     timeout=10;
     getreply();
     pc.printf(buf);
+    pc.printf("ap connection");
 
     wait(5);