firmware icon indicating copy to clipboard operation
firmware copied to clipboard

[Feature Request]: GPIO trigger to wake from deep sleep in SENSOR role

Open redfast00 opened this issue 8 months ago • 5 comments

Platform

ESP32

Description

(this might also be applicable for the NRF and RP2040 platform)

I would like to build a meshtastic letterbox notifier: when the lid is opened, a switch is pressed. This switch is connected to a GPIO pin of the Meshtastic device. It would then wake from deep sleep, send a message containing some telemetry (state of the switch, battery percentage), and go back to deep sleep. That way, it could last a very long time on battery.

Currently, you can set a power saving intervl for sensors, but not yet a GPIO trigger to wake it from deep sleep.

See https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/sleep_modes.html#api-reference-wakeup-source for how this could be implemented.

redfast00 avatar Apr 23 '25 02:04 redfast00

I know the user button wakes ESP32 devices from deep sleep. I haven't dug into its exact behavior with the sensor role, but I wonder if it might already be suitable for your application?

todd-herbert avatar Apr 23 '25 02:04 todd-herbert

@todd-herbert Thanks for the suggestion. I don't think it is suitable, since the user button does a lot more than just trigger to send a message; it is also not configurable how you want to trigger (trigger high vs trigger low)

redfast00 avatar Apr 24 '25 18:04 redfast00

The detection sensor module exists for this purpose, the sensor role is for waking up and periodically sending out sensor readings.

garthvh avatar Apr 24 '25 18:04 garthvh

Indeed the DetectionSensor module is suited for a letterbox detector, but it's based on polling and cannot yet be used for waking a device from sleep (interrupt-based).

GUVWAF avatar Apr 24 '25 19:04 GUVWAF

Did a human decide 'not planned', or was this automatically done by github-actions?

redfast00 avatar Jun 16 '25 08:06 redfast00

I am interested in this feature too. I spent countless hours assuming this was already implemented (using GPiO17 or 34 in my rak4631 case) but nothing is able to wake up the device.

RootPathFinder avatar Jul 12 '25 10:07 RootPathFinder

Also very interested in this capability. We have third party devices which we plan to connect using the serial module over GPIO. They are triggered from time to time, and we want to wake up the attached sensor module on that event.

Beauchaj avatar Nov 06 '25 21:11 Beauchaj