I've been using these ESP's for about a year, and feel pretty comfortable with them.
But I've hit a weird snag, I can't for the life of me set a password for the softAP which actually allows me to connect to it.
ESP-12
SDK v1.5.0
This is my code:
struct softap_config config;
int ret = 0;
os_memset(config.ssid, 0, 32);
os_memset(config.password, 0, 64);
os_memcpy(config.ssid, "ESP8266_AP", 10);
os_memcpy(config.password, "mypassword", 10);
config.authmode = AUTH_WPA_WPA2_PSK;
//config.authmode = AUTH_OPEN;
config.ssid_len = 0;// or its actual length
config.beacon_interval = 100;
config.channel = 9;
config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.
wifi_set_opmode(SOFTAP_MODE);
ret = wifi_softap_set_config(&config);// Set ESP8266 softap config .
CONFIG_DEBUG("AP config loaded (return %u): %s, %s\r\n", ret, config.ssid, config.password);
void user_init(void) {
wifi_station_set_auto_connect(FALSE);
uart_init(BIT_RATE_115200,BIT_RATE_115200);
os_delay_us(2000000);
ioInit();
CFG_Load();
return;
}
It comes up with ESP8266_AP just fine, but when I try to connect my phone complains the password is incorrect. Changing it to open works just fine. I dont know what else to do.
The debug output is "AP config loaded (return 1): ESP8266_AP, mypassword", which looks perfect to me.
Any help will be appreciated.