SX1262¶
SX1262 LoRa radio telemetry service implemented as an SPP consumer. It receives packets through PUBSUB and transmits each one as a 64-byte binary payload. The current driver implements transmission only; radio reception is not supported.
Files¶
| File | Description |
|---|---|
sx1262.h |
Public consumer contract, configuration constants and transmission context. |
sx1262.c |
Radio initialization, packet mailbox, TX state machine and hardware communication. |
Registration¶
The service exposes a consumer contract:
const SPP_SERVICE_ConsumerContract_t *SPP_SERVICES_SX1262_getConsumerContract(void);
In main/custom.c, Solaris registers this contract through SPP_SERVICES_PUBSUB_registerConsumer(). The SX1262 subscribes to BMP390, ICM20948 and FSM telemetry packets. Its build option, SPP_SX1262, is enabled by default in the ESP-IDF integration.
Transmission and buffering¶
- Incoming packets are copied to a static circular mailbox of 100 packets. If it fills up, the oldest entry is overwritten.
- When a transmission starts with more than 50 packets queued, the oldest excess packets are discarded.
- The
consumeData()callback advances the TX state machine throughIDLE,WRITE_BUFFER,SET_PARAMS,SET_TXandWAIT_TX_DONE. - TX completion is detected through DIO1 and confirmed by reading the SX1262 IRQ status.
- A BUSY timeout (1,000 ms) or transmission-completion timeout (2,000 ms) clears the mailbox and resets the software TX state. This does not reset the radio hardware.
Execution timing
TX processing is split into states, but some SPI command helpers synchronously wait for the BUSY pin. The driver is therefore not fully non-blocking.
LoRa configuration¶
| Parameter | Value |
|---|---|
| RF frequency | 869.25 MHz |
| Spreading factor | SF7 |
| Bandwidth | 250 kHz |
| Coding rate | 4/5 |
| Preamble | 8 symbols |
| Packet payload | 64 bytes |
| Header mode | Explicit |
| Radio CRC | Enabled |
| Sync word | 0x1424 (private network) |
These settings are currently defined in sx1262.c, not through a public runtime configuration API.
Hardware configuration (ESP32-S3)¶
- SPI device index:
2(K_SX1262_SPI). - BUSY: GPIO 5.
- DIO1: GPIO 6.
- NRESET: GPIO 7.
SPI transactions, GPIO access and timing use the SPP HAL interfaces. The physical SPI bus and chip-select mapping are configured in the ESP32-S3 platform port.