-->
Page 1 of 2

Encrypted SoftAP not working

PostPosted: Fri Mar 27, 2015 6:34 am
by PeteW
Hello,

I'm having trouble configuring ESP8266 to work as encrypted SoftAP. I'm using following code

Code: Select allvoid user_init(void) {
   stdoutInit();
   static struct softap_config config;

   wifi_softap_get_config(&config);
   os_sprintf(config.password, "abc");
   config.authmode = AUTH_WPA_WPA2_PSK;

   os_printf("WIFI: SSID [%s]\n", config.ssid);
   os_printf("WIFI: Password [%s]\n", config.password);
   os_printf("WIFI: Mode [%d]\n", config.authmode);

   if (wifi_softap_set_config(&config)) {
      os_printf("SUCCESS: AP config set\n");
   } else {
      os_printf("WARNING: Failed to set AP config\n");
   }
}


I'm able to get SUCCESS message only when using AUTH_OPEN or AUTH_WEP.
Can you guys please give some advice what possibly is wrong.

Re: Encrypted SoftAP not working

PostPosted: Fri Mar 27, 2015 8:55 am
by PeteW
I've tested this with SDK 0.9.5 and 1.0.0

Re: Encrypted SoftAP not working

PostPosted: Mon Mar 30, 2015 4:48 am
by PeteW
It looks like the problem is not in my piece of code.
Today I flashed the device with AT command set binary supplied with the 1.0.0 SDK and here is the result from my attempts to configure encrypted SoftAP

Code: Select allAT+CWSAP="ESP8266","abc",5,0
OK

AT+CWSAP="ESP8266","abc",5,1
ERROR

AT+CWSAP="ESP8266","abc",5,2
ERROR

AT+CWSAP="ESP8266","abc",5,3
ERROR

AT+CWSAP="ESP8266","abc",5,4
ERROR


As you can see only mode 0 is OK.

Does anyone manage to run SoftAP with encryption? Do I need to configure something else before trying to change mode to WPA?


Command description from AT Instruction Set follows:
Code: Select allSet configuration of softAP mode.
Command:
AT+CWSAP=<ssid>,<pwd>,<chl>,<ecn>

Note: This CMD is only available when softAP mode enable, and need to follow by AT+RST to make it works.
Param description:
<ssid> string, ESP8266 softAP’ SSID
<pwd> string, MAX: 64 bytes ASCII
<chl> channel id
<ecn> 0 OPEN
      2 WPA_PSK
      3 WPA2_PSK
      4 WPA_WPA2_PSK

Re: Encrypted SoftAP not working

PostPosted: Mon Mar 30, 2015 7:02 am
by Artem Pastukhov
Password can not be shorter that 8 chars.