Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PowerManagement support#9083

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
tshcherban wants to merge28 commits intoespressif:master
base:master
Choose a base branch
Loading
fromtshcherban:power-management

Conversation

@tshcherban
Copy link

@tshcherbantshcherban commentedJan 9, 2024
edited
Loading

Description of Change

Enables Power Management support for arduino sketches.

API changes

ExtendedWiFi.setSleep function to accept listenInterval
AddedsetAutomaticLightSleep function to enable/disable automatic LightSleep (without changing the CPU frequency)

Tests scenarios

Tested WiFi connectivity, BLE scanning, OneWire, TwoWire, SPI, Serial on ESP32, ESP32-S3, ESP32-C3 boards.

Related links

Solves#6563 partially

lboue reacted with thumbs up emoji
@github-actions
Copy link
Contributor

github-actionsbot commentedJan 9, 2024
edited
Loading

Warnings
⚠️Please consider squashing your 28 commits (simplifying branch history).

👋Hello tshcherban, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by thePR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with eachpush event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
-Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manuallyretry these Danger checks, please navigate to theActions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫dangerJS against07046f8

@VojtechBartoskaVojtechBartoska added the Status: Review neededIssue or PR is awaiting review labelJan 9, 2024
@tshcherban
Copy link
Author

tshcherban commentedJan 9, 2024
edited
Loading

@SuGlider@VojtechBartoska is it possible to migrate from patching SDK-Config in github actions to just copy correspondingsdkconfig.defaults.target? that would be a bit more easy editing defaults, separate them for different targets and reuse for some other purposes (i.e. copy for examples, use in CMake build checks).

@CLAassistant
Copy link

CLAassistant commentedJan 9, 2024
edited
Loading

CLA assistant check
All committers have signed the CLA.

@SuGlider
Copy link
Collaborator

@SuGlider@VojtechBartoska is it possible to migrate from patching SDK-Config in github actions to just copy correspondingsdkconfig.defaults.target? that would be a bit more easy editing defaults, separate them for different targets and reuse for some other purposes (i.e. copy for examples, use in CMake build checks).

Actually we need to add this IDF sdkconfig changes to the Lib Builder scripts.
sdkconfig is used by Lib Builder to compile and build all IDF libraries, therefore, when using Arduino, all settings from sdkconfig are setled in the static IDF libs.

The only way to changed sdkconfig and test it is by using Arduino as IDF Component and then build some examples that will verify how PM and light sleep will work.

tshcherban reacted with thumbs up emoji

@tshcherban
Copy link
Author

tshcherban commentedJan 10, 2024
edited
Loading

Found anissue IDFGH-11870 with IDF's UART implementation , it prevents UART usage with automatic llight sleep in some cases.
It would work if we have WiFi/BLE active or some other tasks, which prevents CPU for sleeping too long, however that not seems reliable.
Also I might have a fix for it, so waiting for the IDF maintainers response.

@SuGliderSuGlider self-assigned thisJan 13, 2024
@VojtechBartoskaVojtechBartoska added this to the3.1.0 milestoneJan 30, 2024
@tshcherban
Copy link
Author

tshcherban commentedFeb 2, 2024
edited
Loading

@igrr@VojtechBartoska@SuGlider for a BLE PowerManagement - i dont have ESP32 board with an external crystal, so for that part I would need your help in testing. On an ESP32S3 I'm planning to use Main XTAL as low power source by default.

@SuGlider
Copy link
Collaborator

@tshcherban -
On top of this PR, I'd like to work on an API that will allow the user to set the source clock too.

This is part of another Task which also wants to add Power Management feature based on automatic Dynamic Frequency Scaling (DFS). The proposal is that the user will be able to set the Clock Source for each peripheral and also set it in a Global way whenever necessary in order to increase DFS applicability.

This should be ready for Arduino 3.0.0 final release.
Is that OK for you?

tshcherban reacted with thumbs up emoji

@tshcherban
Copy link
Author

tshcherban commentedFeb 14, 2024
edited
Loading

Yes, for sure.
Do i need to grant you an access to my repository? so all the changes come from the one codebase.
P.S. however i didnt noticed too much gain from DFS enabled, while just changing modem sleep pattern to the MAX_MODEM and enabling automatic light sleep improved the things significantly.
Also please beware we still have a bug coming from IDF uart implementation, which can lead sometimes to a dedlock (workaroundable viaSerial.Flush call).

@VojtechBartoskaVojtechBartoska added Status: In Progress ⚠️Issue is in progress and removed Status: Review neededIssue or PR is awaiting review labelsFeb 19, 2024
@me-no-devme-no-dev added the Status: Blocked upstream 🛑PR is waiting on upstream changes to be merged first labelApr 15, 2024
@github-actions
Copy link
Contributor

github-actionsbot commentedJun 6, 2024
edited
Loading

Test Results

 56 files   56 suites   5m 16s ⏱️
 21 tests  21 ✅ 0 💤 0 ❌
135 runs  135 ✅ 0 💤 0 ❌

Results for commit205db45.

♻️ This comment has been updated with latest results.

/**
* @brief Set modem sleep state
* @param sleepType Modem sleep type, one of WIFI_PS_NONE, WIFI_PS_MIN_MODEM, WIFI_PS_MAX_MODEM
* @param listenInterval Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

it would be good to indicate the units of this parameter. As written it could be interpreted as milliseconds, seconds, minutes, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Unit is specified here (AP beacon intervals). It is determined by the access point parameters, I've often seen a 102400us value during testing with different routers, however it can differ.

@safocl
Copy link
Contributor

safocl commentedSep 24, 2024
edited
Loading

API and its comments are incompatible:

bool setAutomaticLightSleep(bool enabled);

and

/** * @brief Set automatic light sleep state. CPU will go into light sleep if no ongoing activity (active task, peripheral activity etc.) * @param enabled true to enable automatic lightSleep * @return *      - ESP_OK on success *      - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig */

return type is bool (not [esp_return_type])

returnfalse;

wifi_config_t current_conf;
if(esp_wifi_get_config((wifi_interface_t)ESP_IF_WIFI_STA, &current_conf) != ESP_OK){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

from
(wifi_interface_t)ESP_IF_WIFI_STA
to
wifi_interface_t::WIFI_IF_STA
?


boolsetAutomaticLightSleep(boolenabled)
{
uint32_tcpuFreq=getCpuFrequencyMhz();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

from

uint32_t cpuFreq = getCpuFrequencyMhz();

to

const uint32_t cpuFreq = getCpuFrequencyMhz();

?


current_conf.sta.listen_interval = listenInterval;

if(esp_wifi_set_config((wifi_interface_t)ESP_IF_WIFI_STA, &current_conf) != ESP_OK){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

from
(wifi_interface_t)ESP_IF_WIFI_STA
to
wifi_interface_t::WIFI_IF_STA
?

@rftafasrftafas modified the milestones:3.1.0,3.1.1Jan 6, 2025
@rftafasrftafas modified the milestones:3.1.1,3.2.0Jan 14, 2025
@ParsaabasiParsaabasi modified the milestones:3.2.0,3.3.0Mar 10, 2025
@francisgariepy
Copy link

Anyone to resolve conflict and merge anytime soon? It's been more than 6 months and automatic light sleep is not working.

mvoss96 and txf- reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@SuGliderSuGliderAwaiting requested review from SuGlider

@me-no-devme-no-devAwaiting requested review from me-no-devme-no-dev will be requested when the pull request is marked ready for reviewme-no-dev is a code owner

@lucasssvazlucasssvazAwaiting requested review from lucasssvazlucasssvaz will be requested when the pull request is marked ready for reviewlucasssvaz is a code owner

2 more reviewers

@atanisoftatanisoftatanisoft left review comments

@safoclsafoclsafocl left review comments

Reviewers whose approvals may not affect merge requirements

At least 0 approving reviews are required to merge this pull request.

Assignees

@SuGliderSuGlider

Labels

Status: Blocked upstream 🛑PR is waiting on upstream changes to be merged firstStatus: In Progress ⚠️Issue is in progress

Projects

Status: Under investigation

Milestone

3.3.0

Development

Successfully merging this pull request may close these issues.

11 participants

@tshcherban@CLAassistant@SuGlider@safocl@francisgariepy@atanisoft@me-no-dev@rftafas@VojtechBartoska@Parsaabasi@lucasssvaz

[8]ページ先頭

©2009-2025 Movatter.jp