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

Add ps_min_ modem feature #103

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Add ps_min_ modem feature #103

merged 1 commit into from
Dec 22, 2022

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Dec 21, 2022

  • on ESP32-C3 the example sometimes runs into a timeout - seems like it's more an issue in the socket util since at least there are data-packets received/sent
  • not yet mentioning it in the README since it needs a bit more testing
  • definitely the ping gets worse when using the power-safe mode (which is pretty much expected)

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Looks good to me! Tested on a C3 and I could see the ping differences when ps_min_modem is enabled. I have a couple of comments, but nothing to stop this from merging.

By the way do you have an idea of the power saved in the mode? Just curios :)

@@ -474,6 +474,7 @@ impl<'s, 'n: 's> Socket<'s, 'n> {
.network_interface()
.get_socket_and_context::<TcpSocket>(self.socket_handle);
let remote_endpoint = (addr, port);
sock.set_ack_delay(Some(smoltcp::time::Duration::from_millis(100)));
Copy link
Member

Choose a reason for hiding this comment

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

Is this something that should only be used with the ps_min_modem feature, or just a general improvement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it shouldn't hurt in any case - the default 10ms are also somewhat optimistic but not really sure t.b.h

*
****************************************************************************/
#[no_mangle]
pub unsafe extern "C" fn esp_timer_get_time() -> i64 {
trace!("esp_timer_get_time");
(crate::timer::get_systimer_count() / crate::timer::TICKS_PER_SECOND / 1_000) as i64
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct by the way? Can't the "time since boot" actually get lower when the systimer wraps around?

Maybe we need a proper rolling timer instead (don't worry about it for this PR though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's probably not really good this way - I think we have a few places where the wrapping isn't correctly handled - I should create an issue for that 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

created issue #104 for that

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Dec 22, 2022

By the way do you have an idea of the power saved in the mode? Just curios :)

I haven't measured anything t.b.h.

@bjoernQ bjoernQ merged commit 4808b31 into main Dec 22, 2022
@bjoernQ bjoernQ deleted the allow-wifi-ps-min-modem branch December 22, 2022 13:14
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.

None yet

2 participants