[Feature Request]: GPIO trigger to wake from deep sleep in SENSOR role
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.
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 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)
The detection sensor module exists for this purpose, the sensor role is for waking up and periodically sending out sensor readings.
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).
Did a human decide 'not planned', or was this automatically done by github-actions?
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.
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.