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

Enables UPSV=1 low power mode for R510 when idle for >=9.2s #2674

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

technobly
Copy link
Member

⚠️ NOTE: First MERGE referenced MUXER PR, then before merging this PR, REBASE WITH MUXER master checked out and pulled.

Problem

  • R510 modem consumes more power than R410 modem by design. This is unexpected behavior for some customers migrating from R410 to R510.

Solution

  • Reduce power consumption for R510 based devices by enabling UPSV=1 mode which will automatically reduce power consumption after 9.2s of being idle. Note: Some extreme cases of the modem requiring over 2 minutes to drop into a low power state have been observed and are being investigated. Typically though, if the AT interface is idle, the modem will automatically reduce power consumption.

Steps to Test

  • Compile APP=tinker-serial1-debugging and observe after device is idle, power consumption drops from 30-38mA avg. down to 8-12mA avg.
  • Integration test - device-os-test run bsom wiring/no_fixture_long_running -v -- -fixture
  • Integration test - device-os-test run boron wiring/no_fixture_long_running -v -- -fixture
  • Integration test - device-os-test run esomx wiring/no_fixture_long_running -v -- -fixture

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

hal/network/ncp_client/sara/sara_ncp_client.cpp Outdated Show resolved Hide resolved
hal/src/nRF52840/sleep_hal.cpp Outdated Show resolved Hide resolved
user/tests/wiring/no_fixture_long_running/network.cpp Outdated Show resolved Hide resolved
Copy link
Member

@scott-brust scott-brust left a comment

Choose a reason for hiding this comment

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

Tests passed for me when I ran them locally on a boron:

device-os-test --test-dir ~/develop/device-os/user/tests/integration --device-os-dir ~/develop/device-os run wiring/no_fixture_power_saving boron -v -- -fixture
Test directory: /Users/scottbrust/develop/device-os/user/tests/integration
Device OS directory: /Users/scottbrust/develop/device-os
Firmware binaries directory: /Users/scottbrust/develop/device-os/build/integration
Generating test matrix
Initializing API client
URL: https://api.particle.io
Authenticating with access token
Signed in as device-os-ci@particle.io
Subscribing to device events
Initializing device manager
Enumerating USB devices
Retrieving devices from the cloud
Device pool:
e00fce6801bbf404f387daf9 (scott-us-brn404x-dvt3-mxic-1)
No fixtures configured
Running tests


  No fixture power saving
    boron
    Target device: e00fce6801bbf404f387daf9 (scott-us-brn404x-dvt3-mxic-1)
    Flashing application: no_fixture_power_saving.bin
    Getting device tests
      systemThread=disabled
        Initializing device test suite
        Running device test: POWER_SAVING_00_setup
        Device test passed
        ✓ POWER_SAVING_00_setup (7.1s)
        Running device test: POWER_SAVING_01_particle_publish_publishes_an_event_after_low_power_active
        Device test passed
        Waiting cloud event: my_event_low_power
        ✓ POWER_SAVING_01_particle_publish_publishes_an_event_after_low_power_active (44.2s)
        Running device test: POWER_SAVING_02_register_function_and_connect_to_cloud
        Device test passed
        ✓ POWER_SAVING_02_register_function_and_connect_to_cloud (37.6s)
        Running device test: POWER_SAVING_03_call_function_and_check_return_value_after_low_power_active
        Device test passed
        ✓ POWER_SAVING_03_call_function_and_check_return_value_after_low_power_active (1.5s)
        Running device test: POWER_SAVING_04_check_function_argument_value
        Device test passed
        ✓ POWER_SAVING_04_check_function_argument_value (5.9s)
        Running device test: POWER_SAVING_05_system_sleep_with_configuration_object_ultra_low_power_mode_wake_by_network
        Device test notified about expected reset
        Device test passed
        ✓ POWER_SAVING_05_system_sleep_with_configuration_object_ultra_low_power_mode_wake_by_network (85.4s)
        Running device test: POWER_SAVING_06_check_function_argument_value
        Device test passed
        ✓ POWER_SAVING_06_check_function_argument_value (5.9s)
        Running device test: POWER_SAVING_99_cleanup
        Device test passed
        ✓ POWER_SAVING_99_cleanup
      systemThread=enabled
        Initializing device test suite
        Running device test: POWER_SAVING_00_setup
        Device test passed
        ✓ POWER_SAVING_00_setup (7.2s)
        Running device test: POWER_SAVING_01_particle_publish_publishes_an_event_after_low_power_active
        Device test passed
        Waiting cloud event: my_event_low_power
        ✓ POWER_SAVING_01_particle_publish_publishes_an_event_after_low_power_active (75s)
        Running device test: POWER_SAVING_02_register_function_and_connect_to_cloud
        Device test passed
        ✓ POWER_SAVING_02_register_function_and_connect_to_cloud (36.6s)
        Running device test: POWER_SAVING_03_call_function_and_check_return_value_after_low_power_active
        Device test passed
        ✓ POWER_SAVING_03_call_function_and_check_return_value_after_low_power_active (2.4s)
        Running device test: POWER_SAVING_04_check_function_argument_value
        Device test passed
        ✓ POWER_SAVING_04_check_function_argument_value (5.9s)
        Running device test: POWER_SAVING_05_system_sleep_with_configuration_object_ultra_low_power_mode_wake_by_network
        Device test notified about expected reset
        Device test passed
        ✓ POWER_SAVING_05_system_sleep_with_configuration_object_ultra_low_power_mode_wake_by_network (85.5s)
        Running device test: POWER_SAVING_06_check_function_argument_value
        Device test passed
        ✓ POWER_SAVING_06_check_function_argument_value (5.9s)
        Running device test: POWER_SAVING_99_cleanup
        Device test passed
        ✓ POWER_SAVING_99_cleanup
    Resetting device


  16 passing (7m)

I also saw the device go into power save mode with the Otii power measurements
Screen Shot 2023-07-28 at 1 24 40 PM

How did you observe the CTS1 pin when in power save mode? Did you do testing on an EVK? I think the only board of ours that I might be able to probe is an esomx...

@scott-brust
Copy link
Member

I probed an ESOMX and can see the CTS pulses in power save mode 👍
Screen Shot 2023-07-28 at 4 25 22 PM

@technobly technobly force-pushed the feature/r510-upsv1 branch 3 times, most recently from 830f3c8 to e4f497d Compare August 2, 2023 04:35
Copy link
Member

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

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

Just the R410 waitResponse() thing is a bit worrying.

hal/network/lwip/wiznet/wiznetif_config.cpp Show resolved Hide resolved
hal/network/ncp_client/sara/sara_ncp_client.cpp Outdated Show resolved Hide resolved
hal/network/ncp_client/sara/sara_ncp_client.cpp Outdated Show resolved Hide resolved
@technobly technobly merged commit 5f833cb into develop Aug 3, 2023
1 check passed
@technobly technobly deleted the feature/r510-upsv1 branch August 3, 2023 18:50
@technobly technobly removed the 4.2.0 label Sep 18, 2023
@technobly technobly mentioned this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants