-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WiFi very often will not connect to AP #1479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What flag do you supply to deepSleep to wake WiFi up? I think the issue is related to that. The documentation is kind of lacking, but AFAIK you should use WAKE_RFCAL in your case. |
@WereCatf i use WAKE_NO_RFCAL, i can try with WAKE_RFCAL, i understood that i don't have to do RFCAL everytime but i must have misunderstood something. |
@WereCatf i tried WAKE_RFCAL and i still get very often that the ESP can't connect to the WiFi. |
Any other ideas what i can do to make this stable ? |
I'm sorry, I completely forgot about this topic. Quite frankly, I'm at a bit of loss myself. You don't have a WiFi.mode(WIFI_STA); anywhere in the snippets you posted here, have you tried adding that before WiFi.begin()? |
@WereCatf , no i don't have it, i will try to add it and get back with the verdict later today |
@WereCatf so i added the line before begin and no change, the unit reboots few times (takes sensor measurement) and turns wifi on and sends data few time then it stops and goes into the loop ............. where it never connects again. Frustrating...... |
I have added |
I didn't even know about that. That's interesting. Technically, ESP.eraseConfig() does wear the flash down every single boot and as far as I know there is no wear-levelling on it, but you'd probably be looking at thousands of boots before it became an issue. That still makes me wonder... there's a function for enabling/disabling WiFi-persistence where it saves credentials and stuff on flash and it's enabled by default (personally I always turn persistence off since my sketch has the WiFi-credentials hardcoded anyways and thus writing them in flash every single boot is pointless), but I don't know if this persistence also includes RF-calibration or not -- the question is, does turning WiFi-persistence off also turn RF-calibration persistence off? If not, is there any other way of disabling it? I don't have any idea about the answer, to be honest. |
@WereCatf how do you disable the persistence ? |
WiFi.persistent(false); |
@donnib Do you use flash to save your data ? |
There is a parameter which tells SDK whether to store RF calibration if flash: |
@donnib I ran a test like yours (deepsleep/3sec/nowifi/WAKE_RF_DEFAULT * 10 ---> report --> repaet). With 457 reports/4 hours, no error(reset) occurred. https://gist.github.com/chaeplin/e78ecaa11ee05c62865c edited |
i have seen a similar behavior when using |
igrr, how should this parameter be set properly? |
@igrr what is proposed/documented way to solve these WiFi stability issues today, december 2016? |
What should we do with the core_esp8266_phy.c file in the link above? |
@igrr Could you please give a hint how to set |
I had the same problem. I need to connect to WLAN before the ESP8266 execute some 'long' operation. This doesnt work:
but this works:
|
I don’t see the different.
It supposed to be the same.
Do you still have problem?
Thanks,
Erez Mutzafi | www.RadGreen.com | Technical Director | Office +972- | 3-535-99-35Mobile +972-544-735-011
From: Simon Ludwig [mailto:[email protected]]
Sent: Wednesday, September 6, 2017 2:10 PM
To: esp8266/Arduino <[email protected]>
Cc: Erezmu <[email protected]>; Comment <[email protected]>
Subject: Re: [esp8266/Arduino] WiFi very often will not connect to AP (#1479)
I had the same problem. I need to connect to WLAN at the beggining in the setup method..
This doesnt work:
configSerial();
configLogging();
configDisplay();
configPins();
statusLED.blink(10, 50); //Blinks the LED 10 Time with a delay of 50 (so 1000ms delay total)
wifiClient.connect(DEFAULT_SSID, DEFAULT_PASSWORD);
but this works:
configSerial();
configLogging();
configDisplay();
configPins();
wifiClient.connect(DEFAULT_SSID, DEFAULT_PASSWORD);
statusLED.blink(10, 50);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1479 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AQpcbaFt4lZ_l28dSZjS34C3fIcrirWyks5sfn1tgaJpZM4HKLjg> . <https://github.com/notifications/beacon/AQpcbRU6NvGaIOAM1qHcU4TKArIY8CA9ks5sfn1tgaJpZM4HKLjg.gif>
|
In the first code sample the line
gets executed before
This statusLED.blink command took about 1000ms .. and these 1000 milliseconds are responsible for the error.. if I connect to the WLAN before this statement everything works fine... I'm using a Lolin V3 Nodemcu. But I will try this with an ESP-12E as soon as I get it! PS: I Wrote this to this thread because someone will maybe have a similar issue and can fix the problem then. |
There are different ways to wake up and connect to wifi, and the total time depends on how it is done, e.g.: call begin(), begin(ssid), begin(ssid,pass), begin(ssid, pass, bssid), do/don't do rf cal, etc. |
Hi,
I have a sensor where i take measurement -> deep_sleep (without wifi) -> take measurement -> deep_sleep (without wifi), i do this 10 times then i detect that 10 times past and i deep_sleep with 1 and turn the WiFi on so i can send my data to Cloud. When i wake up from deep_sleep i ran this method
which many times ended up in the serial console with .................................... meaning it was trying to connect but it went nowhere. This is unacceptable for me because the sensor deadlocks and will drain my battery within no time so i made a correction to the method and made this
and now i detect the reset and try to connect again to wifi and send my data and this works 99% if not 100% but i don't like this solution. I am hoping there is a better solution that does not require a
ESP.reset()
.I deepsleep(wake with WiFi by doing this)
ESP.deepSleep(3000000, WAKE_RFCAL)
and when i don't need WiFi (most of the time) i useESP.deepSleep(1, WAKE_RF_DISABLED)
Any ideas ?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: