here the code:
wifi_softap_get_config(&esp8266SoftAPcfg);
os_memset(esp8266SoftAPcfg.ssid, 0, sizeof(esp8266SoftAPcfg.ssid));
os_memset(esp8266SoftAPcfg.password, 0, sizeof(esp8266SoftAPcfg.password));
//copy moduleID. and check last
os_memcpy(esp8266SoftAPcfg.ssid, moduleID, 8);
for(i = 7; i > 0; i--)
{
if(esp8266SoftAPcfg.ssid[i] == 0x00)
{
esp8266SoftAPcfg.ssid[i] = 0x20; //replace with space
}
else
{
break;
}
}
//copy 64bit to 16 char string.
for(i = 0; i < 8; i++)
{
esp8266SoftAPcfg.ssid[8+2*i] = toHexTable[(uniqueID[i]>>4) & 0x0F];
esp8266SoftAPcfg.ssid[8+2*i+1] = toHexTable[(uniqueID[i]) & 0x0F];
}
//copy password
os_memcpy(esp8266SoftAPcfg.password, password, passwdlen);
/*set SoftAP config*/
esp8266SoftAPcfg.ssid_len = 24;
esp8266SoftAPcfg.ssid_hidden = 0;
esp8266SoftAPcfg.authmode = AUTH_WPA_WPA2_PSK;
esp8266SoftAPcfg.max_connection = 1; //only 1 Gateway
ESP_DBG("SSID:%24s\r\n", esp8266SoftAPcfg.ssid);
//save current SoftAP config
//wifi_softap_set_config(&esp8266SoftAPcfg);
//wifi_softap_set_config_current(&esp8266SoftAPcfg);
if(wifi_softap_set_config(&esp8266SoftAPcfg) != true )
{
ESP_DBG("wifi_softap_set_config failed\r\n");
}
if(wifi_softap_set_config_current(&esp8266SoftAPcfg) != true )
{
ESP_DBG("wifi_softap_set_config_current failed\r\n");
}
......
the wifi_softap_set_config/wifi_softap_set_config_current both get failed on ESP-01 module. but it's working on 果云科技 module.
the config parameters seem no problem!
is there document describe why get failed?
Thanks for your help!