Closed ghost closed 4 years ago
I think you are probably seeing an autoreconnect attempt. If you want to stay offline, set WiFi.setAutoReconnect(false)
. Otherwise, turn logging level to verbose so you can see the full transaction with the AP.
@lbernstone Thanks for your reply. Did try the WiFi.setAutoReconnect(false)
but the issue didn't stop. Here I'm posting the Serial Output for the Sketch runnin with Core Debug Level to Verbose.
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:8424
ho 0 tail 12 room 4
load:0x40080400,len:5868
entry 0x4008069c
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 2 - STA_START
[WiFi-event] event: 2 -> WiFi client started
[WiFi-event] event: 0 -> WiFi interface ready
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:379] _eventCallback(): STA IP: 172.20.10.2, MASK: 255.255.255.240, GW: 172.20.10.1
Disconnecting from WiFi...
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 7 - STA_GOT_IP
[W][WiFiGeneric.cpp:351] _eventCallback(): Reason: 8 - ASSOC_LEAVE
Going to sleep... Coming back in 5 Seconds
Wake duration: 970 ms
Also, here's the output as well without sending the ESP32 to deep-sleep:
Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:8424
ho 0 tail 12 room 4
load:0x40080400,len:5868
entry 0x4008069c
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 2 - STA_START
[WiFi-event] event: 2 -> WiFi client started
[WiFi-event] event: 0 -> WiFi interface ready
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:379] _eventCallback(): STA IP: 172.20.10.2, MASK: 255.255.255.240, GW: 172.20.10.1
[D][WiFiGeneric.cpp:336] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:379] _eventCallback(): STA IP: 172.20.10.2, MASK: 255.255.255.240, GW: 172.20.10.1
In both scenarios, the STA_GOT_IP
is triggered twice, but both connection parameters are displayed the same. Still wondering what could be the cause.
I had a similar occurrence in 'C', the client connection reported twice. The error was that the event loop got initialized twice. I suspect something similar going on here with the onevent / config combo.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
This stale issue has been automatically closed. Thank you for your contributions.
i am experiencing this issue too. anyone solved it ?
I get this problem as well when using a static IP
The newer IDFs do not have this error (3+)
On Mon, Feb 15, 2021 at 11:40 AM Richard Hamnett notifications@github.com wrote:
I get this problem as well when using a static IP
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/2856#issuecomment-779336928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMBG5CLI4FE7HB73WQOOQDS7FE7BANCNFSM4HS5Q74A .
-- -- Peter Glen Software developer. Author / Inventor of official US Patent 'Adaptive Alpha Blending'. (US20070103483). This email message and any attachments to it is hereby declared confidential under the Electronic Communications Privacy Act and the EU Lisbon Treaty.
I needed to use
SYSTEM_EVENT_AP_STAIPASSIGNED
Glad to hear it!
On Tue, Feb 16, 2021 at 11:36 PM Richard Hamnett notifications@github.com wrote:
I needed to use
SYSTEM_EVENT_AP_STAIPASSIGNED
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/2856#issuecomment-780291812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMBG5DWMTRBXHAK2DWUPUDS7NBVJANCNFSM4HS5Q74A .
-- -- Peter Glen Software developer. Author / Inventor of official US Patent 'Adaptive Alpha Blending'. (US20070103483). This email message and any attachments to it is hereby declared confidential under the Electronic Communications Privacy Act and the EU Lisbon Treaty.
Same problem here, I tried this:
I needed to use
SYSTEM_EVENT_AP_STAIPASSIGNED
but the problem persists.
SYSTEM_EVENT_AP_STAIPASSIGNED replaces SYSTEM_EVENT_STA_GOT_IP you should only get one message @juliangomp
I can reproduce SYSTEM_EVENT_STA_GOT_IP by restarting my AP, which simulates weak, flaky signal.
Hardware:
Board: ?node32? Core Installation version: ?1.0.2? IDE name: ?Arduino IDE? Flash Frequency: ?80MHz? PSRAM enabled: ?no? ?yes? Upload Speed: ?115200? Computer OS: ?Windows 10?
Description:
Guys, I'd like to share the issue I'm having looking for some advice/help you could provide:
The project I'm working on consists of a ESP32 mostly on Deep-Sleep with periodical wake-up intervals. I'm using the WiFiClientEvents example as starting point.
The scheme I'm implementing right now is the following: Boot (configure everything and start WiFi) -> Do nothing but waiting for "SYSTEM_EVENT_STA_GOT_IP" -> within that event, perform all the application-related actions (for now just printing WiFi parameters) and disconnect -> wait for "SYSTEM_EVENT_STA_DISCONNECTED" and within that event, go to deep-sleep and wake-up after N seconds.
The thing is that when I assign a Static IP for AP connection, the "SYSTEM_EVENT_STA_GOT_IP" gets triggered twice every time. The problem with that is that the actions I'm trying to perform during wake-up time, are repeated, and that messes up everything. Is this caused by any WiFi misconfiguration I could fix?
Some information that could help troubleshooting:
Sketch: (leave the backquotes for code formatting)
Debug Messages: