不停在连接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
- static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
- {
- switch (event->event_id)
- {
- case SYSTEM_EVENT_STA_START:
- esp_wifi_connect();
- break;
- case SYSTEM_EVENT_STA_GOT_IP:
- if (mqtt_client_hd == NULL)
- xTaskCreatePinnedToCore(ilab_mqtt_test_task, "mqtt_test", 4 * 1024,
- NULL, 10, mqtt_client_hd, 1);
- if (mqtt_recv_hd == NULL)
- xTaskCreatePinnedToCore(ilab_mqtt_praseRecv_task, "praserecv", 4 * 1024,
- NULL, 10, mqtt_recv_hd, 1);
- // if (mqtt_offline_hd == NULL)
- // xTaskCreatePinnedToCore(ilab_mqtt_SendMsg_task, "mqtt_send", 4 * 1024,
- // NULL, 8, mqtt_offline_hd, 1);
- if (ilab_system_get_error() < E_ERROR_SENSOR)
- ilab_system_set_error(E_ERROR_NONR);
- else
- ilab_system_set_error(E_ERROR_SENSOR);
- break;
- case SYSTEM_EVENT_STA_DISCONNECTED:
- esp_wifi_connect();
- ESP_LOGI(TAG, "trying connect to wifi");
- // xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
- break;
- default:
- break;
- }
- return ESP_OK;
- }