Skip to content
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

Using esp_light_sleep_start() can break WiFi, should be configurable to use delay()/xTaskNotifyWait() instead. #191

Open
ranma opened this issue Sep 29, 2024 · 3 comments

Comments

@ranma
Copy link

ranma commented Sep 29, 2024

With the default of esp_light_sleep_start() I see WiFi connection problems.

Using delay() can still noticeably reduce the SoC temperature. In my limited testing, the temperature reported by CpuTemperature.read() reduced from ~58 °C to ~52 °C after enabling -D_TASK_SLEEP_ON_IDLE_RUN=1 and hacking it to use delay() instead of esp_light_sleep_start().

@arkhipenko
Copy link
Owner

Hi,
Which version of TaskSxheduler are you running.
I believe I disabled light sleep in the latest version since yes, it causes WiFi issues.
Simple delay(1) (or vTaskDelay(1) ) works better.

@ranma
Copy link
Author

ranma commented Sep 29, 2024

Which version of TaskSxheduler are you running.

The master branch: https://github.com/arkhipenko/TaskScheduler/blob/master/src/TaskSchedulerSleepMethods.h#L61

@ranma
Copy link
Author

ranma commented Oct 6, 2024

Simple delay(1) (or vTaskDelay(1) ) works better.

One problem with a simple delay is that when using StatusRequest to wake from an interrupt, the delay is not interrupted.

So for ESP32 even better is to use xTaskNotifyWait() to sleep and xTaskNotify()/xTaskNotifyFromISR() to interrupt the sleep.

@ranma ranma changed the title Using esp_light_sleep_start() can break WiFi, should be configurable to use delay() instead. Using esp_light_sleep_start() can break WiFi, should be configurable to use delay()/xTaskNotifyWait() instead. Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants