ESP32 getting disconnected after some data transaction with AZURE IOT

david@mandy
Posts: 8
Joined: Tue May 22, 2018 4:59 am

ESP32 getting disconnected after some data transaction with AZURE IOT

Postby david@mandy » Wed May 23, 2018 5:40 am

Hi,
I am using ESP32 with ESP-IDF v3.0 (stable version). My device has to send and receive messages over Azure IOT server.
But after some few data transactions for about 30 to 40 minutes, my device is getting disconnected from the router and retrying for connection.
But the re-connection is not happening. Only after restarting the module it will connect to the router again and the problem repeats. I am getting the following error.

I (2525809) wifi: bcn_timout,ap_probe_send_start
I (2528309) wifi: ap_probe_send over, resett wifi status to disassoc
I (2528309) wifi: state: run -> init (1)
I (2528309) wifi: pm stop, total sleep time: 0/-1797020403
I (2528309) wifi: n:9 0, o:9 0, ap:255 255, sta:9 0, prof:1

This is something that is disturbing the flow of my application and need to be fixed.

Thanks and regards.

ESP_Alvin
Posts: 195
Joined: Thu May 17, 2018 2:26 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby ESP_Alvin » Thu May 24, 2018 6:42 am

Hi, david@mandy

Would you please help provide logs for this?

Thanks.

sumesh
Posts: 16
Joined: Fri Dec 22, 2017 12:11 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby sumesh » Thu May 24, 2018 6:44 am

Dear Admins,

we are also facing the same issue, please do let me know if you have any findings

flyric123
Posts: 1
Joined: Thu May 24, 2018 6:44 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby flyric123 » Thu May 24, 2018 6:47 am

Hi,

We are having the same issue. Something to add here is: when the wifi disconnects, we can not start BLE either.

Is this a known issue? Any fix or work around?

Thanks,
Ric

ESP_Alvin
Posts: 195
Joined: Thu May 17, 2018 2:26 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby ESP_Alvin » Thu May 24, 2018 8:05 am

Hi, Sumesh, and flyric123

Would your provide any logs for the issues you found? That would help a lot.

Thanks.

david@mandy
Posts: 8
Joined: Tue May 22, 2018 4:59 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby david@mandy » Thu May 24, 2018 12:12 pm

ESP_Alvin wrote:Hi, david@mandy

Would you please help provide logs for this?

Thanks.
Hi ESP_Alvin,
Thank you for your reply.
ESP32 is giving this error repeatedly. After giving this error, the module is trying to reconnect with the router, but it fails every time.
Below is the log. Here, we have disabled the LOG other than "wifi"..

"2018-05-21 21:00:29",CONNECT OK
"2018-05-21 21:00:29",192.168.43.87
"2018-05-21 21:00:30",SEND OK
"2018-05-21 21:00:31",SEND OK
"2018-05-21 21:00:31",I (586170) wifi: pm start, type:0

"2018-05-21 21:00:32",SEND OK
"2018-05-21 21:00:34",SEND OK
"2018-05-21 21:00:36",SEND OK
"2018-05-21 21:00:48",I (602910) wifi: bcn_timout,ap_probe_send_start
"2018-05-21 21:00:51",I (605410) wifi: ap_probe_send over, resett wifi status to disassoc
"2018-05-21 21:00:51",I (605410) wifi: state: run -> init (1)
"2018-05-21 21:00:51",I (605410) wifi: pm stop, total sleep time: 0/19242893

"2018-05-21 21:00:51",I (605410) wifi: n:7 0, o:7 0, ap:255 255, sta:7 0, prof:1
"2018-05-21 21:00:51",WIFI DISCONNECTED
"2018-05-21 21:00:53",WIFI DISCONNECTED
"2018-05-21 21:00:55",WIFI DISCONNECTED
"2018-05-21 21:00:58",WIFI DISCONNECTED
"2018-05-21 21:01:00",WIFI DISCONNECTED
"2018-05-21 21:01:03",WIFI DISCONNECTED
"2018-05-21 21:01:05",WIFI DISCONNECTED
"2018-05-21 21:01:05",OK
"2018-05-21 21:01:05",OK
"2018-05-21 21:01:05",OK
"2018-05-21 21:01:06",OK
"2018-05-21 21:01:06",DEFAULTS
"2018-05-21 21:01:06",Connecting to
"2018-05-21 21:01:06",My_ssid
"2018-05-21 21:01:06",FAIL TO CONNECT

"2018-05-21 21:01:06",OK
"2018-05-21 21:01:06",OK
"2018-05-21 21:01:06",OK
"2018-05-21 21:01:07",OK
"2018-05-21 21:01:07",DEFAULTS
"2018-05-21 21:01:07",Connecting to
"2018-05-21 21:01:07",My_ssid
"2018-05-21 21:01:07",FAIL TO CONNECT

"2018-05-21 21:01:07",OK
"2018-05-21 21:01:07",OK
"2018-05-21 21:01:07",OK
"2018-05-21 21:01:08",WIFI DISCONNECTED
"2018-05-21 21:01:08",OK
"2018-05-21 21:01:08",DEFAULTS
"2018-05-21 21:01:08",Connecting to
"2018-05-21 21:01:08",My_ssid
"2018-05-21 21:01:08",FAIL TO CONNECT

"2018-05-21 21:01:08",OK
"2018-05-21 21:01:08",OK
"2018-05-21 21:01:08",OK
"2018-05-21 21:01:09",OK
"2018-05-21 21:01:09",DEFAULTS
"2018-05-21 21:01:09",Connecting to
"2018-05-21 21:01:09",My_ssid
"2018-05-21 21:01:09",FAIL TO CONNECT

"2018-05-21 21:01:09",OK
"2018-05-21 21:01:09",OK
"2018-05-21 21:01:09",OK
"2018-05-21 21:01:10",OK
"2018-05-21 21:01:10",DEFAULTS
"2018-05-21 21:01:10",Connecting to
"2018-05-21 21:01:10",My_ssid
"2018-05-21 21:01:10",FAIL TO CONNECT

"2018-05-21 21:01:10",WIFI DISCONNECTED
"2018-05-21 21:01:12",WIFI DISCONNECTED
"2018-05-21 21:01:15",WIFI DISCONNECTED
"2018-05-21 21:01:17",WIFI DISCONNECTED
"2018-05-21 21:01:20",WIFI DISCONNECTED
"2018-05-21 21:01:22",WIFI DISCONNECTED
"2018-05-21 21:01:24",WIFI DISCONNECTED
"2018-05-21 21:01:27",WIFI DISCONNECTED
"2018-05-21 21:01:29",WIFI DISCONNECTED
"2018-05-21 21:01:32",WIFI DISCONNECTED
"2018-05-21 21:01:34",WIFI DISCONNECTED
"2018-05-21 21:01:35",OK
"2018-05-21 21:01:35",OK
"2018-05-21 21:01:35",OK
"2018-05-21 21:01:36",OK
"2018-05-21 21:01:36",DEFAULTS
"2018-05-21 21:01:36",Connecting to
"2018-05-21 21:01:36",My_ssid
"2018-05-21 21:01:36",FAIL TO CONNECT

"2018-05-21 21:01:36",OK
"2018-05-21 21:01:36",OK
"2018-05-21 21:01:36",OK
"2018-05-21 21:01:37",WIFI DISCONNECTED
"2018-05-21 21:01:37",OK
"2018-05-21 21:01:37",DEFAULTS
"2018-05-21 21:01:37",Connecting to
"2018-05-21 21:01:37",My_ssid
"2018-05-21 21:01:37",FAIL TO CONNECT

"2018-05-21 21:01:37",OK
"2018-05-21 21:01:37",OK
"2018-05-21 21:01:37",OK
"2018-05-21 21:01:38",OK
"2018-05-21 21:01:38",DEFAULTS
"2018-05-21 21:01:38",Connecting to
"2018-05-21 21:01:38",My_ssid
"2018-05-21 21:01:38",FAIL TO CONNECT

bk@iot
Posts: 5
Joined: Thu May 24, 2018 12:18 pm

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby bk@iot » Thu May 24, 2018 12:22 pm

Hello @david,
Did u got the resolution..???
I also getting the same issue with esp32 on esp-idf v3.0..plz let me know..Thanks in advance.

ESP_Alvin
Posts: 195
Joined: Thu May 17, 2018 2:26 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby ESP_Alvin » Fri May 25, 2018 9:03 am

Hi,

Could you help print the WiFi disconnect reason? And capture some WiFi packets if you are able to do this.

Thanks

david@mandy
Posts: 8
Joined: Tue May 22, 2018 4:59 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby david@mandy » Fri May 25, 2018 12:42 pm

ESP_Alvin wrote:Hi,

Could you help print the WiFi disconnect reason? And capture some WiFi packets if you are able to do this.

Thanks
Hi ESP_Alvin,

How to capture the WiFi packets and how to get the WiFi disconnect reason?
Because it looks like the above log that I shared is not giving enough information and that is all I am getting.
Please let me know if there is anything I have to enable to get a detailed log.

Thanks.

littlesky
Posts: 51
Joined: Fri Jun 09, 2017 7:49 am

Re: ESP32 getting disconnected after some data transaction with AZURE IOT

Postby littlesky » Sun May 27, 2018 2:58 am

First, you need a WiFi card which can capture WiFi packets. Second, install software Omnipeek or Wireshark on your PC. Then you can use it to capture WiFi packets.
The disconnect reason can be obtained when receiving SYSTEM_EVENT_STA_DISCONNECTED event. It is defined in struct in esp_event.h:
typedef struct {
uint8_t ssid[32]; /**< SSID of disconnected AP */
uint8_t ssid_len; /**< SSID length of disconnected AP */
uint8_t bssid[6]; /**< BSSID of disconnected AP */
uint8_t reason; /**< reason of disconnection */
} system_event_sta_disconnected_t;

Who is online

Users browsing this forum: Google [Bot], HighVoltage and 126 guests