8266的异常掉线?

yuzu
Posts: 2
Joined: Sun Oct 06, 2019 2:34 pm

8266的异常掉线?

Postby yuzu » Mon Oct 07, 2019 11:49 pm

使用8266连接路由器,之后8266什么事都不干。电脑用有线连接路由器,不断ping8266,会发现8266大约每隔不到一分钟就会从路由器断开连接。RTOS、NONOS、ARDUINO均有这种现象。
WiFi信道上几乎没有干扰,路由器只连接了电脑和8266这两个设备。
代码如下

Code: Select all

#include "esp_common.h"

void ICACHE_FLASH_ATTR user_init(void) {
    system_update_cpu_freq(160);  //设置CPU为160Mhz

    wifi_set_opmode_current(STATION_MODE);

    struct station_config conf = {
        .ssid = "TESTY",
        .password = "OOOOPPPP",
        .bssid_set = 0,
    };
    wifi_station_set_config(&conf);

    os_printf("init done\n");
}



串口日志如下

Code: Select all

rf cal sector: 1019
tcpip_task_hdl : 3ffef680, prio:10,stack:512
idle_task_hdl : 3ffef720,prio:0, stack:384
tim_task_hdl : 3fff1ed8, prio:2,stack:512
sleep disable
init done
mode : sta(bc:dd:c2:30:24:b9)
add if0
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
pm open phy_2,type:0 0 0
cnt

connected with TESTY, channel 13
dhcp client start...
ip:192.168.1.101,mask:255.255.255.0,gw:192.168.1.1
state: 5 -> 2 (3c0)
rm 0
pm close 7 0 0/44806164
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
pm open phy_2,type:0 0 0
cnt

connected with TESTY, channel 13
dhcp client start...
ip:192.168.1.101,mask:255.255.255.0,gw:192.168.1.1
state: 5 -> 2 (3c0)   
rm 0
pm close 7 0 0/66950923
reconnect       
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)     
add 0
aid 1
pm open phy_2,type:0 0 0
cnt

Her Mary
Posts: 396
Joined: Mon Oct 27, 2014 11:09 am

Re: 8266的异常掉线?

Postby Her Mary » Thu Oct 10, 2019 11:46 am

路由器一般会踢掉那些不活跃的 station,你可以试试从 8266 周期性的向外发心跳包,看是否还会掉线。

Who is online

Users browsing this forum: No registered users and 3 guests