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

Reduce update when angle not changing and sleep esp modem #203

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nekomona
Copy link

Compare the angle with previous transmitted one after each imu data, and only transmit when the new angle is with significant difference.

Adopted method and parameter from the Arduino repo. Will leave radio inactive time at idle, thus reduce idle power consumption after modem sleep implemented in the protocol stack.

@nekomona nekomona requested a review from TheButlah as a code owner June 29, 2023 22:11
TheButlah
TheButlah previously approved these changes Jun 30, 2023
Copy link
Collaborator

@TheButlah TheButlah left a comment

Choose a reason for hiding this comment

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

Yay! New contributors :)))

Thanks for the PR <3

firmware/Cargo.toml Outdated Show resolved Hide resolved
TheButlah
TheButlah previously approved these changes Jun 30, 2023
@TheButlah
Copy link
Collaborator

TheButlah commented Jun 30, 2023

Looks like CI failed on autoformatting. If you could run cargo fmt to reformat the code, I'd appreciate it :3
Pro tip: You can enable formatOnSave in visual studio code to do this automatically (if you have the rust extension installed)

@nekomona
Copy link
Author

Formatting and modem sleep are added, could reduce power consumption when not moving from 110mA to 57mA

@TheButlah TheButlah changed the title Reduce update when angle not changing Reduce update when angle not changing and sleep esp modem Jun 30, 2023
@TheButlah
Copy link
Collaborator

ESP32 builds fail for some reason... I'll look into this later.

@nekomona
Copy link
Author

nekomona commented Jul 1, 2023

somehow the "weak" directive in floor inside https://github.com/esp-rs/esp-wifi/blob/main/esp-wifi/src/common_adapter/mod.rs is not followed, the linker just complains that there's two floors

@TheButlah
Copy link
Collaborator

TheButlah commented Jul 1, 2023

this can probably be fixed by bumping the esp-hal version to something newer. right now we are using a version that is two major versions out of date.

In the past, these updates have often taken a medium amount of effort to pull off the upgrade, as they usually also require updating esp-wifi and sometimes the embassy async stuff. If you want you can try it, otherwise I'll attempt the upgrade myself when I have time.

The good news is that almost always, the updates bring many new features and improvements.

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

Successfully merging this pull request may close these issues.

2 participants