碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Jimmy1688
Posts: 5
Joined: Fri Apr 03, 2020 9:28 am

碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Postby Jimmy1688 » Tue Apr 07, 2020 1:59 am

IDF版本为3.2.2。碰到的问题描述
不停在连接WIFI和从WIFI上断开,这个问题是偶发的,同一热点下有两个设备,一个正常,另一个出现这样的问题。
我尝试关闭路由器后,重新打开,现象依旧。
重启设备后,恢复正常。
不知道如何办。
下面是我摘取的一段log
I (320354986) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:40:56
I (320354993) ilab_queue: call ilab_queue_add_item
E (320354998) ilab_peripherals: temprature is over, warning
I (320355005) ilab_adc: Raw: 2454 Voltage: 2069mV

I (320355010) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:40:56
I (320355017) ilab_queue: call ilab_queue_add_item
I (320355023) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:40:56
I (320355029) ilab_queue: call ilab_queue_add_item
I (320355035) ilab_peripherals: LCD_flush_Screen
I (320355040) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:40:56
I (320355791) iLab_Flash: call ilab_flash_write_item writepos = 22611, readpos = 0
I (320356792) iLab_Flash: call ilab_flash_write_item writepos = 22612, readpos = 0
I (320357792) iLab_Flash: call ilab_flash_write_item writepos = 22613, readpos = 0
I (320358792) iLab_Flash: call ilab_flash_write_item writepos = 22614, readpos = 0
I (320359069) wifi: bcn_timout,ap_probe_send_start
I (320359792) iLab_Flash: call ilab_flash_write_item writepos = 22615, readpos = 0
I (320361576) wifi: ap_probe_send over, resett wifi status to disassoc
I (320361576) wifi: state: run -> init (c800)
I (320361577) wifi: pm stop, total sleep time: 2643721 us / 30692074 us

I (320361583) wifi: n:11 0, o:11 2, ap:255 255, sta:11 2, prof:1
E (320361591) MQTT_CLIENT: Error network response
I (320361592) ilab_mqtt: trying connect to wifi
I (320361593) MQTT_CLIENT: Error MQTT Connected
I (320362206) ilab_peripherals: run in ilab_get_store_sensor_value
I (320363556) pt100: current is 2207.000000
I (320363557) pt100: resist is 10619
I (320363557) ilab_sensors: temp1 = 1587/n
I (320363559) ilab_peripherals: Channel A Temprature = 1587
I (320363646) ilab_mqtt: trying connect to wifi
I (320363766) wifi: n:11 2, o:11 0, ap:255 255, sta:11 2, prof:1
I (320363767) wifi: state: init -> auth (b0)
I (320363792) wifi: state: auth -> assoc (0)
I (320364076) wifi: state: assoc -> run (10)
I (320364967) ilab_peripherals: door status = 0
I (320364967) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:6
I (320364968) ilab_queue: call ilab_queue_add_item
I (320364973) iLab_Flash: call ilab_flash_write_item writepos = 22616, readpos = 0
I (320364973) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:6
I (320364989) ilab_queue: call ilab_queue_add_item
I (320364994) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:6
I (320365001) ilab_queue: call ilab_queue_add_item
E (320365006) ilab_peripherals: temprature is over, warning
I (320365013) ilab_adc: Raw: 2451 Voltage: 2066mV

I (320365018) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:6
I (320365025) ilab_queue: call ilab_queue_add_item
I (320365031) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:6
I (320365037) ilab_queue: call ilab_queue_add_item
I (320365044) ilab_peripherals: LCD_flush_Screen
I (320365048) ILAB_SNTP: -------localtime:2020:4:7:weekday2:9:41:7
I (320365982) iLab_Flash: call ilab_flash_write_item writepos = 22617, readpos = 0
I (320366982) iLab_Flash: call ilab_flash_write_item writepos = 22618, readpos = 0
I (320367982) iLab_Flash: call ilab_flash_write_item writepos = 22619, readpos = 0
I (320368982) iLab_Flash: call ilab_flash_write_item writepos = 22620, readpos = 0
I (320372206) ilab_peripherals: run in ilab_get_store_sensor_value
I (320373557) pt100: current is 2207.800049
I (320373557) pt100: resist is 10619
I (320373558) ilab_sensors: temp1 = 1587/n
I (320373560) ilab_peripherals: Channel A Temprature = 1587
I (320374077) wifi: state: run -> init
I (320374078) wifi: n:11 0, o:11 2, ap:255 255, sta:11 2, prof:1
I (320374081) ilab_mqtt: trying connect to wifi
  1. static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
  2. {
  3.     switch (event->event_id)
  4.     {
  5.     case SYSTEM_EVENT_STA_START:
  6.         esp_wifi_connect();
  7.         break;
  8.     case SYSTEM_EVENT_STA_GOT_IP:
  9.         if (mqtt_client_hd == NULL)
  10.             xTaskCreatePinnedToCore(ilab_mqtt_test_task, "mqtt_test", 4 * 1024,
  11.                                     NULL, 10, mqtt_client_hd, 1);
  12.         if (mqtt_recv_hd == NULL)
  13.             xTaskCreatePinnedToCore(ilab_mqtt_praseRecv_task, "praserecv", 4 * 1024,
  14.                                     NULL, 10, mqtt_recv_hd, 1);
  15.         // if (mqtt_offline_hd == NULL)
  16.         //     xTaskCreatePinnedToCore(ilab_mqtt_SendMsg_task, "mqtt_send", 4 * 1024,
  17.         //                             NULL, 8, mqtt_offline_hd, 1);
  18.  
  19.         if (ilab_system_get_error() < E_ERROR_SENSOR)
  20.             ilab_system_set_error(E_ERROR_NONR);
  21.         else
  22.             ilab_system_set_error(E_ERROR_SENSOR);
  23.         break;
  24.     case SYSTEM_EVENT_STA_DISCONNECTED:
  25.         esp_wifi_connect();
  26.         ESP_LOGI(TAG, "trying connect to wifi");
  27.  
  28.         // xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
  29.         break;
  30.     default:
  31.         break;
  32.     }
  33.     return ESP_OK;
  34. }
Attachments
wifi问题2.PNG
wifi问题2.PNG (132.86 KiB) Viewed 11112 times

xiehang
Posts: 26
Joined: Mon Mar 18, 2019 8:57 am

Re: 碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Postby xiehang » Wed Apr 08, 2020 9:25 am

wifi: ap_probe_send over, resett wifi status to disassoc
这句打印出现,是在 beacon timeout 时,发送 probe request 后没有找到自己连接的 AP 。
这时会发送 disassoc ,然后断开连接。

如果 AP 不存在了,比如掉电之类,出现这种 log 就是正常现象。

如果 AP 正常,出现 beacon timeout,就需要详细分析下。

你使用的 AP 是什么型号?

测试过程中 除了 连接 WiFi ,断开 WiFi ,还有其他什么操作吗?

出问题的 板子的剩余内存还有多少?

可以提供下你的 代码让我来 debug这个问题吗?

liuzhifu
Posts: 39
Joined: Tue Dec 13, 2016 2:18 am

Re: 碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Postby liuzhifu » Thu Apr 30, 2020 6:09 am

Hi,

如果连同一个 AP,有一个有问题,另一个没有问题,而且重起 AP 无法恢复,可能是 WiFi RX 挂了,导致收不到 beacon。这个问题应该在 v3.2 中 IDF commit: 3750fe94 中 fix 掉了。

Jimmy1688
Posts: 5
Joined: Fri Apr 03, 2020 9:28 am

Re: 碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Postby Jimmy1688 » Thu Jul 02, 2020 10:08 am

@xiehang
目前看,可能是内存泄漏,引起这个问题。

liuzhifu
Posts: 39
Joined: Tue Dec 13, 2016 2:18 am

Re: 碰到wifi: ap_probe_send over, resett wifi status to disassoc问题

Postby liuzhifu » Tue Jul 07, 2020 7:13 am

Hi Jimmy,

你提到的内存泄漏是指应用层还是 IDF 存在内存泄漏?为什么怀疑是内存泄漏导致?

Who is online

Users browsing this forum: No registered users and 117 guests