SlimeVR / SlimeVR-Rust

🦀 + SlimeVR = 💖
Apache License 2.0
70 stars 26 forks source link

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

Open nekomona opened 1 year ago

nekomona commented 1 year ago

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.

TheButlah commented 1 year ago

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 commented 1 year ago

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

TheButlah commented 1 year ago

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

nekomona commented 1 year ago

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 commented 1 year ago

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.