Skip to content

Conversation

@Columbo818
Copy link

Presented by @rbomze and myself, this PR updates the DetectionSensor module to use an interrupt-driven approach when the following conditions are met:

• The device is nRF52840-based
• The node role is Sensor
• Power saving mode is enabled

When these criteria are satisfied, the module uses GPIO interrupts instead of polling, allowing the device to reliably enter deep sleep for ultra-low power operation.

These changes are contained within an #ifdef ARCH_NRF52 to prevent build failures on other platforms, ensuring that they only affect nRF52 devices. Devices that do not meet all of the above conditions, including nRF52-based devices, continue using the existing polling behaviour to maintain compatibility.

All existing configuration values (sds_secs and min_wake_secs) continue to be respected, preserving expected module behaviour.

🤝 Attestations

  • [✅] I have tested that my proposed changes behave as described.
  • [✅] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • [✅] Heltec WiFi LoRa 32 (V2)
    • [✅] Heltec T114
    • [✅] Seeed Wio Tracker L1

rbomze and others added 10 commits November 26, 2025 03:56
Relocates the conditional setting of nRFSenseSleep for NRF52 architecture from runOnce() to the header section, ensuring it is set earlier in the module lifecycle. This change means that the sleep lib is only imported on supported platforms, reducing binary size on other platforms
Eliminated the explicit setting of BACKGROUND priority for non-sensor devices in sendCurrentStateMessage. This would otherwise affect all nodes using the DetectionSensor module in roles other than Sensor.
Minor tweaks to make the code play nice on other platforms
…uration configurable by setting "super duper sleep duration", but not less than 1h
@CLAassistant
Copy link

CLAassistant commented Nov 26, 2025

CLA assistant check
All committers have signed the CLA.

@thebentern thebentern added the enhancement New feature or request label Nov 27, 2025
@Columbo818
Copy link
Author

Some additional testing has revealed an issue where the nRF52 does not wake up.
Given this, we've had to revert to sleeping forever.

My feeling is to close the PR as sleeping forever ignores the SDS_Secs and will confuse inexperienced users, making them think their nodes are dead.
@rbomze - I think this works for your use case, but isnt ready to be made default until we can sort the wake issue.

@rbomze
Copy link

rbomze commented Nov 27, 2025

Yeah, trash the pull request, Colombo. I am about to finish what works in both cases.

  • sensing when sleeping indefinitely during a shutdown
  • low power polling during a sleep with timeout

@rbomze
Copy link

rbomze commented Nov 27, 2025

replaced by #8778, please drop PR.

@thebentern thebentern closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants