esp8266 loses AP connection after restart

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Koenig
Normal user
Posts: 14
Joined: 16 Jun 2019, 11:20

esp8266 loses AP connection after restart

#1 Post by Koenig » 19 Jan 2020, 18:46

The following problem: My ESP8266 12E loses the WiFi access data after every power failure and becomes an access point. When I have entered this, "Warning: Connected via AP" appears. Who knows advice?


----
0
Uptime: 0 days 0 hours 6 minutes
Load: 6.40% (LC=2993)
CPU Eco Mode: false
Free Mem: 20048 (16456 - sendContentBlocking)
Free Stack: 3600 (1824 - sendContentBlocking)
Heap Max Free Block: 15320
Heap Fragmentation: 23%
Boot: Manual reboot (1)
Reset Reason: Exception
Last Task: Background Task
SW WD count: 0
Network ❔
Wifi: 802.11N (RSSI -74 dB)
IP Config: DHCP
IP / Subnet: 10.0.1.123 / 255.255.255.0
Gateway: 10.0.1.1
Client IP: 10.0.1.15
DNS: 10.0.1.1 / (IP unset)
Allowed IP Range: 10.0.1.0 - 10.0.1.255
STA MAC: 2C:F4:32:11:44:32
AP MAC: 2E:F4:32:11:44:32
SSID: kaisernet (80:2A:A8:94:D6:E1)
Channel: 6
Connected: 1 m 37 s
Last Disconnect Reason: (8) Assoc leave
Number Reconnects: 1
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 50
Firmware
Build:⋄ 20104 - Mega
System Libraries:⋄ ESP82xx Core bc204a9b, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄ mega-20191208
Plugins:⋄ 46 [Normal]
Build Md5: ffde61316ff9abf294525d4375efceb
Md5 check: passed.
Build Time:⋄ Dec 8 2019 18:04:38
Binary Filename:⋄ ESP_Easy_mega-20191208_normal_ESP8266_4M1M.bin
System Status
Syslog Log Level: None
Serial Log Level: Info
Web Log Level: None
ESP Board
ESP Chip ID: 1131570 (0x114432)
ESP Chip Frequency: 80 MHz
ESP Board Name: PLATFORMIO_ESP12E
Storage
Flash Chip ID: Vendor: 0x68 Device: 0x4016
Flash Chip Real Size: 4096 kB
Flash IDE Size: 4096 kB
Flash IDE Speed: 40 MHz
Flash IDE Mode: DIO
Flash Writes: 8 daily / 8 boot
Sketch Size: 833 kB (2236 kB free)
Max. OTA Sketch Size: 1019 kB (1044464 bytes)
OTA possible: true
OTA 2-step Needed: false
SPIFFS Size: 934 kB (841 kB free)
Page size: 256
Block size: 8192
Number of blocks: 116
Maximum open files: 5
Maximum path length: 32

Rob Muller
Normal user
Posts: 8
Joined: 05 Nov 2018, 17:02

Re: esp8266 loses AP connection after restart

#2 Post by Rob Muller » 21 Jan 2020, 13:27

I had a similar issue
See here viewtopic.php?f=6&t=6610

hope that helps
Thanks for reading,
regards,

Rob

TD-er
Core team member
Posts: 2110
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: esp8266 loses AP connection after restart

#3 Post by TD-er » 21 Jan 2020, 23:44

Do you have multiple accesspoints with the same SSID in range?

Koenig
Normal user
Posts: 14
Joined: 16 Jun 2019, 11:20

Re: esp8266 loses AP connection after restart

#4 Post by Koenig » 25 Jan 2020, 10:10

Yes, I have a Unify-Network with 4 Access-Points.

Koenig
Normal user
Posts: 14
Joined: 16 Jun 2019, 11:20

Re: esp8266 loses AP connection after restart

#5 Post by Koenig » 26 Jan 2020, 17:26

Rob Muller wrote:
21 Jan 2020, 13:27
I had a similar issue
See here viewtopic.php?f=6&t=6610

hope that helps
Thank you. Already included it, but unfortunately this does not help :(

Koenig
Normal user
Posts: 14
Joined: 16 Jun 2019, 11:20

Re: esp8266 loses AP connection after restart

#6 Post by Koenig » 26 Jan 2020, 17:26

TD-er wrote:
21 Jan 2020, 23:44
Do you have multiple accesspoints with the same SSID in range?
Yes, I have a Unify-Network with 4 Access-Points. But I does not have this problems with other ESP-items.

TD-er
Core team member
Posts: 2110
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: esp8266 loses AP connection after restart

#7 Post by TD-er » 26 Jan 2020, 23:18

Koenig wrote:
26 Jan 2020, 17:26
TD-er wrote:
21 Jan 2020, 23:44
Do you have multiple accesspoints with the same SSID in range?
Yes, I have a Unify-Network with 4 Access-Points. But I does not have this problems with other ESP-items.
Well I doubt you can compare other ESP firmwares with ESPEasy with regards to WiFi.
ESPEasy does store the last used BSSID (at least on recent builds) in RTC memory, so it will use that for the initial WiFi connection.
N.B. this only applies with a warm reboot like from a crash or deep sleep.

If it will boot from a cold boot, then it will just use the first (not always the strongest ! ) SSID that matches.
However, at the initial scan for WiFi, it is not guaranteed the best BSSID will be used here as it may have been missing during the scan.

Apart from this connection logic, other issues may be happening here.
The connection cycle is quite fast and I have seen issues where switching from AP 1 to AP 2 in a short time may lead to very strange issues.
The ESP does look to be connected, but it will not receive an IP, or any answer to packets being sent.

It looks like the ARP cache in the switches does need some time to get synced again, so packets sent to the ESP's MAC address may never arrive there.
The ESP does detect it cannot use the connection, so it may already try to attempt a new connection and ending up at another AP, with a different BSSID.
Maybe the switches already have updated their MAC tables, but the ESP's packets have to be re-routed to the other AP so they never arrive at the ESP.

If you leave the ESP powered off for a while (some minutes), does the connection get lost right after booting?

Post Reply

Who is online

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