Wifi is getting reset after running continuously showing an error "wifi: bcn_timout,ap_probe_send_start "

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Wifi is getting reset after running continuously showing an error "wifi: bcn_timout,ap_probe_send_start "

Postby amalamal » Tue Jul 04, 2017 5:37 am

Hi

I am trying to push some data to sever by http over wifi, but after sending 30-40 minutes it showing the error "wifi: bcn_timout,ap_probe_send_start " , Wifi is disconnecting and trying to connect again, it will connect and show the same error and disconnect. Please help me fix this issue. Please find attachment for error details.


Thanks
Attachments
wifi_code.c
(3.79 KiB) Downloaded 556 times
wifi_issue_new.png
wifi_issue_new.png (43.89 KiB) Viewed 5592 times

f.h-f.s.
Posts: 214
Joined: Thu Dec 08, 2016 2:53 pm

Re: Wifi is getting reset after running continuously showing an error "wifi: bcn_timout,ap_probe_send_start "

Postby f.h-f.s. » Tue Jul 04, 2017 8:14 am

I think what happened here is: wifi beacon frame was sent, this timed out. the esp32 tried to probe the AP, this also failed, which is why you were disconnected

You can expand your event_handler to reconnect if wifi disconnects, also you can move the connect call to the event handler:

Code: Select all

static esp_err_t 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:
		ESP_LOGI(TAG, "ip: %d.%d.%d.%d", IP2STR(&event->event_info.got_ip.ip_info.ip));
		break;

	case SYSTEM_EVENT_STA_DISCONNECTED:
		esp_wifi_connect();
		ESP_LOGE(TAG, "Wifi Disconnected!");
		break;

	default:
		break;
	}
	return ESP_OK;
}
You can also use a event group to set bits, which is recommended by freertos.

Code: Select all

xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
instead of wifi_connect and check_one_time

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Re: Wifi is getting reset after running continuously showing an error "wifi: bcn_timout,ap_probe_send_start "

Postby amalamal » Wed Jul 05, 2017 5:58 am

Thanks for the replay sir

I tried the way as you said, changed the event_handler .But still the same issue coming " wifi: bcn_timout,ap_probe_send_start". Please tell any other suggestion you know to fix it.

Thanks

Who is online

Users browsing this forum: Bing [Bot] and 213 guests