Configuring Wifi Station mode for ESP32
Posted: Sat Nov 03, 2018 11:21 am
Hi,
I am getting an error during configuration of Wifi station mode , it is not getting connected to the given ssid and passwrd. .Please refer the below code
The ssid and passwrd has the valid data.
wifi_config_t sta_config ;
for(i=0;i<30;i++)
{
sta_config.sta.ssid = ssid;
sta_config.sta.password=passwrd;
}
but if I replace the above with hardcoded ssid and passwrd as given below it connects to the router immediately.
wifi_config_t sta_config = {
.sta = {
.ssid = "excellence",
.password = "vk123456"
},
};
Cant understand what is the issue ,I monitored the sta_config.sta.password & sta_config.sta.ssid strings both gives same value.But the first code snippet doesnt work. Pleaes help
I am getting an error during configuration of Wifi station mode , it is not getting connected to the given ssid and passwrd. .Please refer the below code
The ssid and passwrd has the valid data.
wifi_config_t sta_config ;
for(i=0;i<30;i++)
{
sta_config.sta.ssid = ssid;
sta_config.sta.password=passwrd;
}
but if I replace the above with hardcoded ssid and passwrd as given below it connects to the router immediately.
wifi_config_t sta_config = {
.sta = {
.ssid = "excellence",
.password = "vk123456"
},
};
Cant understand what is the issue ,I monitored the sta_config.sta.password & sta_config.sta.ssid strings both gives same value.But the first code snippet doesnt work. Pleaes help