ESP NOT ABLE TO CONNECT TO WIFI : STA DISCONNECT: 201

vks007
Posts: 1
Joined: Mon Mar 06, 2017 1:03 am

ESP NOT ABLE TO CONNECT TO WIFI : STA DISCONNECT: 201

Postby vks007 » Mon Mar 06, 2017 1:10 am

I am having trouble with the ESP 01 connecting to WiFi in certain scenarios. The problem does not happen always but when it does, I am not able to set it right. The issue is that it keeps on trying to connect to WiFi and keeps on disconnecting with the error messages as shown below. I am using this chip on a circuit I have wired on the PCB. I have the same circuit wired on the breadboard. The strange part is that I have not got this error even once on the bread board. It always works fine there. At times the problem went away when I re-flashed my code on the ESP and then again it comes back after some time. At times I have waited for a long time and it successfully connects after trying for 5-10 minutes but not always. It has nothing to do with my code as the WiFiClient example also gives the same issue. Can somebody point me where should I debug this?
I dont think there is anything wrong with the ESP as I have experienced this with multiple ESPs. They would all work fine if I put them onto a circuit I have wired on the breadboard though.

Debug messages:
.wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2
....wifi evt: 1
STA disconnect: 201
.......wifi evt: 1
STA disconnect: 2
......wifi evt: 1
STA disconnect: 2

Her Majesty
Posts: 86
Joined: Mon Oct 27, 2014 11:09 am

Re: ESP NOT ABLE TO CONNECT TO WIFI : STA DISCONNECT: 201

Postby Her Majesty » Fri Mar 24, 2017 4:59 pm

Code: Select all

REASON_NO_AP_FOUND              = 201


Can other device connect to the AP when ESP CANNOT?

esp-link32
Posts: 2
Joined: Wed May 10, 2017 4:00 pm

Re: ESP NOT ABLE TO CONNECT TO WIFI : STA DISCONNECT: 201

Postby esp-link32 » Wed May 10, 2017 4:04 pm

You should check your router. May be firewall or access filter prevent esp to connect wifi. :P

ememberus
Posts: 6
Joined: Thu May 04, 2017 12:53 am

Re: ESP NOT ABLE TO CONNECT TO WIFI : STA DISCONNECT: 201

Postby ememberus » Thu May 11, 2017 10:04 pm

I also experience similar issue (in addition to memory leaks and crashes):

viewtopic.php?f=66&t=4245

My code is attached therein, so you can use it as your testbed.

The problem with connection happens when RF connection is unstable.
The initial connection is typically smooth.
After RF connection is lost first time:
- following reconnect attempts become slower (connection timeouts, maybe?)
- in some cases esp8266 client never reconnects again

The AP has nothing to do with it:
- it accepts other connections with no problem
- if rebooted, esp8266 can connect to AP again

All these issues - reconnect failures, memory leaks, CPU crashes - could be parts of the same problem.
A race condition in esp8266 connection state machine, for example?

Note: all these problem do not occur to me if RF signal is always (!) strong.

Who is online

Users browsing this forum: No registered users and 3 guests