Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of ESP8266-configuaration-baudrate by
Revision 2:c5515c7eba46, committed 2015-02-10
- 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();
