wifi setup APmode
Dependencies: mbed
Revision 7:8055eb42a0f0, committed 2020-09-09
- Comitter:
- molberry
- Date:
- Wed Sep 09 04:44:48 2020 +0000
- Parent:
- 6:c3c9277c64ba
- Commit message:
- WiFi connection Limit 1
Changed in this revision
--- a/main.cpp Mon Aug 24 02:36:06 2020 +0000 +++ b/main.cpp Wed Sep 09 04:44:48 2020 +0000 @@ -7,7 +7,7 @@ DigitalOut reset(p26); Timer t; -int count,ended,timeout; +int ount,ended,timeout; char buf[1024]; char snd[255]; @@ -21,7 +21,7 @@ //char ssid[32] = "802ZTa-003243"; //char pwd [32] = "0129875a"; -char ssid[32] = "mbed01"; +char ssid[32] = "mbed06"; char pwd [32] = "0123456789a"; void SendCMD(),getreply(),ESPconfig(),ESPsetbaudrate(); @@ -164,6 +164,8 @@ strcat(snd, "5"); //<chl>: channel ID. strcat(snd, ","); strcat(snd, "4"); //<ecn>: encryption method; WEP is notsupported.(0:OPEN, 2:WPA_PSK, 3:WPA2_PSK, 4:WPA_WPA2_PSK) + strcat(snd, ","); + strcat(snd, "1"); // <max conn>: max connect. strcat(snd, "\r\n"); // "を入力し改行 //「AT+CWJAP="ssid","pwd",5,3」 SendCMD(); timeout=10; @@ -205,11 +207,11 @@ memset(buf, '\0', sizeof(buf)); t.start(); ended=0; - count=0; + ount=0; while(!ended) { if(esp.readable()) { - buf[count] = esp.getc(); - count++; + buf[ount] = esp.getc(); + ount++; } if(t.read() > timeout) { ended = 1;
--- a/mbed.bld Mon Aug 24 02:36:06 2020 +0000 +++ b/mbed.bld Wed Sep 09 04:44:48 2020 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c \ No newline at end of file +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file
--- a/wifi_configuration_AP.lib Mon Aug 24 02:36:06 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://os.mbed.com/users/4180_1/code/ESP8266-configuration-mbed-LPC1768/#9f46b8cdd469