-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Issue
Unable to join with esp32 swl2001 + sx1262 radio.
Equipment available
- saleae logic analyzer connected to hardware 2.
- 100MHz oscilloscope
- Digital bench power supply
Stack info
- v4.8.0 swl2001 stack
- esp-idf v5.4.1
- spi at 8MHz
- TXCO NOT being used in hw 1 or hw 2.
System configuration
- US 915 lorawan device (the device being debugged)
- Oxit Carbon 8 lorawan gateway
- AWS LNS
Hardware configurations
- MBed SX1262 dev board (SX1262MB2CAS Shield) wired to esp32 module
- esp32-s3-devkitc-1 module
- Modem stack tests pass
- SPI and GPIO connections match hardware configuration rp_task_select_next mixing index and id #2
- Custom hardware with SX1262 radio and pcb antenna
- esp32-s3-wroom2
- Modem stack tests pass
- 32MHz crystal used with sx1262.
- Seeed studio Wio-E5 mini Dev Board (SX1262 module) (113990939) (https://www.seeedstudio.com/LoRa-E5-mini-STM32WLE5JC-p-4869.html)
- Controlled via AT commands
- Python program written to configure and interact with the gateway.
Stack configuration
- RP2_103 defined
- REGION_US_915 defined
- JoinEUI and AppKey defined the same across hardware 1, 2, and 3.
Behavior with Semtech stack (hardware 1 and hardware 2)
Same behavior on both hardware 1 and hardware 2.
- Hardware sends join request (confirmed by seeing traffic via SDR)
- Join request received by AWS LNS (Confirmed from AWS LNS logs)
- Join response sent by AWS LNS (Confirmed from AWS LNS logs and seeing response via SDR)
- SX1262 RX1 window results in ISR with a status of (Preamble + Timeout) far before the specified SetRx timeout.
- Stack reports 'Join failed'
- Join retry timeout completes and step 1 occurs again.
- Even after dozens of join attempts, no joins are successful
Behavior with Wio-E5 module (hardware 3)
- Device sends join attempts (confirmed by seeing traffic via SDR)
- Device joins after 1 to 3 attempts. (Confirmed from AWS LNS logs).
- Send data (confirmed via SDR)
- Data confirmed received (Confirmed from AWS side and via SDR).
Questions
Is DIO2 working as expected?

Wired to reference board to evaluate.

Yellow is DIO2, teal is ANT_SW.
The above capture is during a radio TX, the rest of the time DIO2 is low.
The RF switch is a PE4259. The datasheet indicates that if Pin 6 is pulled high then table 5 (single-pin control logic truth table) should be used.

Pin 4 high is RFC to RF1. RF1 is tied to the SX1262 RFO pin. SX1262 datasheet defines RFO as RF output so the polarity of the output looks correct.
I believe this rules out the concern that the TX/RX switch isn't being switched correctly.
Is the timing of RX1 window correct? Is the system timing accurate?

- Channel 1 - GPIO output from esp32, set high and then low when sx126x_hal_write() is called with a command of 0x83 (SetTx).
- Channel 2 - GPIO output from esp32, set high and then low when sx126x_hal_write() is called with a command of 0x82 (SetRx).
- Channel 3 - DIO2 signal
The RX1 window should be opened at or before 5 seconds from the completion of the join request (falling edge of DIO2) indicated by the left hand white cursor.
Note the time delta between cursors is 4.91s, indicating that the receive is opened in advance of the RX1 window.
Is the radio sending and receiving with the correct timing?
TODO: Measurement of radio current via scope is pending arrival of an INA169 module.
Remaining info from original post
- Calling smtc_modem_set_region() for US 915 and setting keys when the SMTC_MODEM_EVENT_RESET event of the application modem event handler occurs.
- Confirmed lora sync msg register (0x0740) is being written with 0x34 0x44
- Hackrf being used to confirm device is sending join and gateway is sending join response.
- Tested with another Seeed studio dev device with the same deveui, joineui, and appkey, and regional parameters 1.0.3 to confirm the gateway can be joined in OTAA mode.
- External Saleae analyzer being used.
- Confirmed that SetRx is passed 0x82 0xFF 0xFF 0xFF (I modified sx126x.c sx126x_set_rx() to use the max value)
- Confirmed frequencies are set correctly, status is being read. SetTx called.
- External analyzer shows that ~30ms after SetRx, the radio signals an interrupt
- Stack then does a GetIrqStatus() which returns 0x02 0x04 (indicating timeout + preamble detected)
- Signal strength looks good (gateway is very strong, device is ok).
- Enabled MODEM_HAL_DBG_TRACE_RP=1 so I can see the join manager re-attempting the joins. I've checked the various timings and RX1 is 5s after the completion of the send, RX2 is 6s after it.
I've also tried with the production board and a bench board using the Semtech sx1262 mbed reference board, both behave identically so I'm pretty confident in the hardware setup.
I've tried the 15.3.1 work around without any success.
I'm pretty happy with the bsp port and the simplified application code. Analyzer isn't showing any other pins being manipulated, ie. modem reset isn't being asserted by the mcu during the SetRx -> GetIrqStatus() timeframe so it seems sure that the modem is the one generating the interrupt.
Why could the SetRx in the radio be timing out after the preamble is detected even with a very long timeout? What could I be missing here?
Regards,
Chris