Wifi can't connect with ssid loaded from file.(NO_AP_FOUND)
Posted: Tue May 15, 2018 12:36 pm
I'm trying to solve a strange issue.
When the ssid and password are configured at compile time, the connection work. When the SSID is set from a file the connection fails with a 201 - NO_AP_FOUND. I can reproduce the problem here using the simple_wifi example. changing it to:
Both ssid and password are globals defined as:
The event handler needs to be modified to LOG the disconnect reason also.
The example works fine without the modification.
I couldn't figure out the issue in the code above.
When the ssid and password are configured at compile time, the connection work. When the SSID is set from a file the connection fails with a 201 - NO_AP_FOUND. I can reproduce the problem here using the simple_wifi example. changing it to:
Code: Select all
wifi_config_t wifi_config;
memcpy(wifi_config.sta.ssid, ssid, sizeof(wifi_config.sta.ssid));
memcpy(wifi_config.sta.password, password, sizeof(wifi_config.sta.password));
Code: Select all
static const char ssid[] = "MySSID";
static const char password[]= "MyPassword";
The example works fine without the modification.
I couldn't figure out the issue in the code above.