-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Reduce CPU usage at boot time #4233
Conversation
If many drivers has been enabled, there is a peak of CPU usage at boot time that it is translated as a peak in power consumption. This address to a wifi connection issue in poor power regulated devices like Sonoff Basic R2. This fix reduces cpu usage making the wifi connection to establish faster.
Interesting, but just to mention - I picked up some wemos boards from banggood which turned out to have either fake or rebranded esp8266 chips on them... marked as Eco Plug on the chip itself. These did not work with the 2.5.0 core due to overheating... with this PR even core 2.5.0 (previously did not work at all) connects to wifi so I think giving the delay(1) is providing more yield() time to the cpu to handle SDK issues in the background resulting in a smoother and faster wifi connect. |
Interesting! If wifi is connected Tasmota uses the SDK function sntp_get_current_timestamp() once every minute. This function seems to do three requests which is fine if it is only three requests ... |
6.3.0.9 20181118 * Moved command SetSensorXX to debugging driver freeing user code space * Add dynamic delay to main loop providing time for wifi background tasks * Remove delays introduced in 6.3.0.1 (#4233)
6.3.0.9 20181118 * Moved command SetSensorXX to debugging driver freeing user code space * Add dynamic delay to main loop providing time for wifi background tasks * Remove delays introduced in 6.3.0.1 (arendst#4233)
6.3.0.11 20181120 * Add delays removed in 6.3.0.9 (arendst#4233) * Allow user definition of defines WIFI_RSSI_THRESHOLD (default 10) and WIFI_RESCAN_MINUTES (default 44) * Add support for Fujitsu HVac and IrRemote (arendst#4387)
6.3.0.12 20181122 * Remove delays introduced in 6.3.0.11 (arendst#4233) * Add additional start-up delay during initial wifi connection * Add support for I2C MGC3130 Electric Field Effect sensor by Christian Baars (arendst#3774, arendst#4404) * Add initial support for Hass sensor discovery (arendst#4380)
If many drivers and sensors have been enabled, there is a peak of CPU usage at boot time that it is translated as a peak in power consumption. This address to a wifi connection issue in poor power regulated devices like Sonoff Basic R2. This fix reduces cpu usage making the wifi connection to establish. This don't degrate the actual performance due it is used only at boot time.
Also, it is noticed a faster wifi connection in other devices too.
This POC cames from an idea discussion with @andrethomas of delaying drivers at startup. Thanks for that! 👍