-->
Page 1 of 2

wifi_softap_set_config_current/wifi_softap_set_config failed

PostPosted: Mon Jun 29, 2015 9:14 pm
by wjzhang
:? we try setup our SSID but get failed.
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!

Re: wifi_softap_set_config_current/wifi_softap_set_config fa

PostPosted: Tue Jun 30, 2015 4:25 am
by wjzhang
:? :shock:
the same ESP-01 working fine with 果云科技 board.
the ok log:
...
set SoftAP parameters
SSID:tt_3001 414B303818581743

bcn 0
del if1
usl
sul 0 0
set SoftAP mode
stop DHCP
set static IP address
start TCP server

pcb->localport 80
start UDP client
add if1
bcn 100
.....

the wrong log:
......
set SoftAP parameters
SSID:tt_3001 414B303818581743
wifi_softap_set_config_current failed
set SoftAP mode
stop DHCP
set static IP address
start TCP server

pcb->localport 80
start UDP client
.......

Re: wifi_softap_set_config_current/wifi_softap_set_config fa

PostPosted: Tue Jun 30, 2015 4:37 am
by kriegste
The module needs to be in AP or STA+AP mode while setting the parameters. Is that the case?

Re: wifi_softap_set_config_current/wifi_softap_set_config fa

PostPosted: Tue Jun 30, 2015 7:53 pm
by wjzhang
I found interest thing: the ESP8266 will auto start with default settings before reach to our program set code.
question:
1) how to disable this feature?
2) how max long will take from setting ESP8266 Enable/Reset High to reach call wifi_set_opmode()?