ESP8266 Developer Zone The Official ESP8266 Forum 2015-04-20T20:19:17+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=378 2015-04-20T20:19:17+08:00 2015-04-20T20:19:17+08:00 https://bbs.espressif.com:443/viewtopic.php?t=378&p=1439#p1439 <![CDATA[Re: Can't configure softap if authmode is set]]> Statistics: Posted by yorknh — Mon Apr 20, 2015 8:19 pm


]]>
2015-04-18T06:33:28+08:00 2015-04-18T06:33:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=378&p=1407#p1407 <![CDATA[Re: Can't configure softap if authmode is set]]> Statistics: Posted by Anki — Sat Apr 18, 2015 6:33 am


]]>
2015-04-18T03:30:03+08:00 2015-04-18T03:30:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=378&p=1406#p1406 <![CDATA[Can't configure softap if authmode is set]]> In the function below, if I comment out apconfig.authmode = AUTH_WPA_WPA2_PSK, wifi_softap_setconfig() succeeds, and I can connect to the esp. If I uncomment that line, I see "ESP8266 not set softap config!" printed on the UART and no network is available.

Code:

void ICACHE_FLASH_ATTR setup_wifi_softap_mode(void)
{
   struct softap_config apconfig;

   if(wifi_softap_get_config(&apconfig))
   {
//      wifi_softap_dhcps_stop();
      os_memset(apconfig.ssid, 0, sizeof(apconfig.ssid));
      os_memset(apconfig.password, 0, sizeof(apconfig.password));
      os_sprintf(apconfig.ssid, "%s", "john");
      os_sprintf(apconfig.password, "%s", "1234");
      apconfig.authmode = AUTH_WPA_WPA2_PSK;
      apconfig.ssid_len = 0;
      apconfig.max_connection = 4;
      if(!wifi_softap_set_config(&apconfig))
      {
         #ifdef PLATFORM_DEBUG
         ets_uart_printf("ESP8266 not set softap config!\n");
         #endif
      }
      wifi_set_opmode(SOFTAP_MODE);
//      wifi_softap_dhcps_start();
   }

   if(wifi_get_phy_mode() != PHY_MODE_11N)
      wifi_set_phy_mode(PHY_MODE_11N);

   #ifdef PLATFORM_DEBUG
   ets_uart_printf("ESP8266 in SoftAP mode configured.\n");
   #endif
}


I have tried AUTH_WPA_PSK, AUTH_WPA2_PSK, AUTH_WPA_WPA2_PSK and all behave the same. Anyone see anything obvious?

Statistics: Posted by yorknh — Sat Apr 18, 2015 3:30 am


]]>