Cannot find router, connect fail -- 找不到路由,连接失败?

ESP_Faye
Posts: 1643
Joined: Mon Oct 27, 2014 11:08 am

Cannot find router, connect fail -- 找不到路由,连接失败?

Postby ESP_Faye » Wed Jan 21, 2015 5:59 pm

:?:

Q: Why could not ESP8266 find my router and connect to it?

A:
There is a parameter "stationConf.bssid_set" maybe you missed.
"stationConf.bssid_set" needs to be 0 , if you are setting ssid, otherwise it will check bssid which is the mac address..

More details on Espressif BBS http://bbs.espressif.com/viewtopic.php?f=5&t=53

Please refer to the source code below.

问:为什么我设置了路由信息,ESP8266 却找不到路由,无法连上?
答:
可能是您漏掉了一个参数 "stationConf.bssid_set",
当您根据 ssid 查找路由时,请将 "stationConf.bssid_set"设置为 0,否则,它查找时会参考 bssid,也就是路由的 MAC 地址。。

详情参见 Espressif BBS http://bbs.espressif.com/viewtopic.php?f=5&t=53

请参考如下示例代码:

void wifi_config()
{
// Wifi configuration
char ssid[32] = SSID;
char password[64] = PASSWORD;
struct station_config stationConf;

//Set station mode
wifi_set_opmode( 0x1 );

stationConf.bssid_set = 0;

//Set ap settings
os_memcpy(&stationConf.ssid, ssid, 32);
os_memcpy(&stationConf.password, password, 64);
wifi_station_set_config(&stationConf);

}

//Init function
void user_init()
{
wifi_config();
}

Who is online

Users browsing this forum: No registered users and 2 guests