sx126x: add cold sleep support to set_mode_sleep action #3638
-
Describe the enhancementFeature RequestSummaryThe Cold sleep ( Proposed API- sx126x.set_mode_sleep:
cold: true # sleepConfig=0x00 (~0.6µA), default false = current behaviourOr equivalently expose the raw byte for full flexibility: - sx126x.set_mode_sleep:
sleep_config: 0x00Datasheet referenceSX1262 datasheet section 13.1.2 —
Use caseBattery-powered LoRa sender node:
Without cold sleep, the SX1262 alone consumes ~600µA during the entire Current workaroundUsers are forced to bit-bang the SPI bus manually after - sx126x.set_mode_standby
- delay: 2ms
- lambda: |-
gpio_set_direction(GPIO_NUM_9, GPIO_MODE_OUTPUT);
gpio_set_direction(GPIO_NUM_10, GPIO_MODE_OUTPUT);
gpio_set_direction(GPIO_NUM_8, GPIO_MODE_OUTPUT);
gpio_set_direction(GPIO_NUM_13, GPIO_MODE_INPUT);
gpio_set_level(GPIO_NUM_8, 1);
// ... wait BUSY low, bit-bang 0x84 0x00, etc.This should not be necessary for something as fundamental as low-power sleep. Implementation notesThe change is minimal — in Hardware tested
Use casesBattery-powered LoRa sensor nodes that wake, transmit one packet, and return Visual examplesNo response Anything else?https://github.com/jgromes/RadioLib/blob/master/src/modules/SX126x/SX126x.h |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
|
For SPI you should not have to do spi bus free and doubt you have to set the sx126x gpio directions. Not sure about the other stuff. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Following up on this discussion where I initially requested the Project context: Deep sleep soil sensor node (ESP32-S3, SX1261) that wakes on timer, reads battery voltage (ADC) + soil temp/moisture (Modbus RTU over RS485) + internal temperature, sends one LoRa packet, and goes back to deep sleep. The entire active window is ~4–5 seconds. Key radio config:
Pins: CS=GPIO8, BUSY=GPIO13, RST=GPIO12, DIO1=GPIO14
What I'm seeing: Immediately after Things I've tried:
Questions:
Happy to share full YAML or logs if helpful. Thanks! |
Beta Was this translation helpful? Give feedback.
For SPI you should not have to do spi bus free and doubt you have to set the sx126x gpio directions. Not sure about the other stuff.