-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Update to the last version of nonos-sdk V2, WiFi addons #5210
Conversation
WPA working, WEP+Open disabled by default. Need API change.
…P, DTIM-value) with new getter: .getListenInterval() / .isSleepLevelMax()
@@ -86,6 +86,7 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh | |||
// ----------------------------------------------------------------------------------------------------------------------- | |||
|
|||
bool ESP8266WiFiSTAClass::_useStaticIp = false; | |||
bool ESP8266WiFiSTAClass::_useInsecureWEP = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this here on purpose, or did it slip in? I'm ok with what I see of the code, but given the nature of this functionality I suggest splitting it into its own PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All points above are addressed your way.
About WEP, it is a requirement to set this value in sdk structures for initialization.
Hi, I have tested the actual Stage Core with this PR in order to check the Modem Sleep Feature and works very good. No crashes if using lwIP 1.4. |
Hi, After performing several tests of the actual stage core with @d-a-v's PR, it results that it is working really good for Sonoff-Tasmota. All functions are working very good and also the sleep feature finally works in a core different than 2.3.0 ! I have tested with lwIP 1.4, lwIP 2 (low memory) and also lwIP (high bandwidth) and works very stable in all those, with and without sleep enabled. So, I hope this Pull Request got merged ASAP into the core, and also that a new core got released ASAP. Thanks a lot for all the hard work you all have done here, and thanks @d-a-v for this solution! |
Hello @d-a-v |
This is really good news - will be very good if these fixes can be included to finally solve the sleep problem on 2.4.2! |
It would be great if this PR could be implemented really soon as currently most Tasmota users are forced to use core 2.3.0 for light sleep functionality while so many new features have been released in later core versions. |
I would like to have it too, because by 193 sonoff devices you have a lot of power use and that is pricy. So please don't waste time and money. Add it where we need it. |
documentation overview |
Just a question: this actually updated to Nonos SDK V3.0.0 not V2 ? At least the libraries in the tools/sdk/lib directory show V3... |
It is called "V3-dev" by espressif.
It is not V3 but their latest commit that can be currently used with the
arduino core.
It brings some useful updates and fixes regarding WiFi sleep modes which
were broken around arduino core v2.4.0.
Official V3 will come later when the arduino core will be updated to
reliably boot with it.
|
It seems that the problem has been solved, so it's probably my mistake, but I still have problems with LIGHT_SLEEP, and I can't find any document around. I use the Arduino IDE 1.8.7, and installed the ESP8266 package v2.5.0 (stable) using the File->Preferences way. Doing of my best with many suggestions that I found googling around I produced the following testing sketch: #include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include "secret.h" //defines MYSSID and MYPASSWD
int joinAP(){
Serial.print("Connecting");
WiFi.begin(MYSSID, MYPASSWD);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Connected as ");
Serial.println(WiFi.localIP());
}
void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN,LOW);
WiFi.setSleepMode(WIFI_LIGHT_SLEEP,10);
}
void loop()
{
WiFiClient client;
HTTPClient http;
joinAP();
digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN));
if (http.begin(client, "http://www.example.com")) {
Serial.print(" - return code: "); Serial.println(http.GET());
}
unsigned long t0=millis();
WiFi.forceSleepBegin(5000000UL);
Serial.println(millis()-t0);
} However there is no 5 seconds delay: the output is as follows:
The 91 is the difference in ms. In fact, there is no visible delay. Thank you. |
I did an experiment today replacing the WiFi.forceSleepBegin(5000000) with a plain
The result is that the delay time is measured correctly, and power consumption drops around 15mA, with short (20ms) spikes around 60mA every one second. Outside the delay time power consumption is around 60mA with spikes around 200mA. |
I haven't had any luck making lightsleep work yet either. We need a good example that works with a specific version of the esp8266 code. |
edited
New feature / API update:
WiFi.setSleepMode(WIFI_LIGHT/MODEM_SLEEP, listen-interval)
Default value in FW is 3 - documentation
see also: https://routerguide.net/dtim-interval-period-best-setting/
note: I'm not a radio expert
With new api:
WiFi.getListenInterval()
/WiFi.isSleepLevelMax()
(
the setters are here but should not be used,preferWiFi.setSleepMode()
)This is interesting for at least #2330 #1381 #4485
This WiFi issue with light or modem sleep modes does not happen for everybody,
so testing testers (with current-meter or not) are needed.
How to try the git way:
Revert to master:
In case of updates in the PR, do this before restarting the above.