ACK not received in class C
Opened this issue · 1 comments
Tested on HW: nrf52832+sx1262 module.
DIO1 used in interrupt mode, sx1262 used with TXCO, DIO3 as voltage source, DIO2 for TX/RX switch.
Tested stack version: v4.5.1, class C, US915 region
Network server: Comcast MachineQ server
LoraWAN gateway: Area8C
FW: no RTOS.
Facing issues with receiving ACK in confirmed messages mode.
Some words about our FW implementation:
- Node connects to NS, get Join response, sends empty packets to increase data rate to DR>=2. Our packet size is 121byte, so it is the reason why we need to increase DR.
- Node get UNIX timestamp from AS for internal use in FW.
- Node TX 2 packets every 5minutes with 5sec pause between them.
- All this time node samples data from ADC. Processing of LoRaMac events/radio interrupts execute in time when sampling is not done.
I have issue with receiving ACK from server for the second message, ACK for first message is ok.
I have IRQ_RX_TX_TIMEOUT
for 2nd message generated before actual timeout for RX2 window (~3sec) passes.
Processing for ADC takes around ~520ms.
If i decrease this time to ~430ms ACK received, but not in all cases.
Questions:
- Can anyone describe what is IRQ_RX_TX_TIMEOUT signal and why it can be generated? From the DS i see:
When SymbNum is different from 0, the modem will wait for a total of SymbNum LoRa symbol to validate, or not, the correct detection of a LoRa packet. If the various states of the demodulator are not lock at this moment, the radio will generate the RxTimeout IRQ.
- I dont understand difference between symbol timeout and lora header timeout. IRQ_RX_TX_TIMEOUT, as I understand, is symbol timeout, but RX cannot be performed if symbol timeout occur, so I dont understand how RX window will work in class C than.
In the RadioSetRxConfig function located in the radio.c file, please insert the following line after line 647:
Before:
if( rxContinuous == true ) { symbTimeout = 0; }
After:
if( rxContinuous == true ) { symbTimeout = 0; } symbTimeout = 0;
In the function:
static void RxWindowSetup(TimerEvent_t *rxTimer, RxConfigParams_t *rxConfig)
located in the LoRaMac file,
make sure to use:
CRITICAL_SECTION_BEGIN();
at the beginning of the function and
CRITICAL_SECTION_END();
Example:
`
static void RxWindowSetup(TimerEvent_t *rxTimer, RxConfigParams_t *rxConfig)
{
CRITICAL_SECTION_BEGIN();
TimerStop(rxTimer);
// Ensure the radio is Idle
Radio.Standby();
if (RegionRxConfig(Nvm.MacGroup2.Region, rxConfig, (int8_t *)&MacCtx.McpsIndication.RxDatarate) == true)
{
Radio.Rx(Nvm.MacGroup2.MacParams.MaxRxWindow);
MacCtx.RxSlot = rxConfig->RxSlot;
}
CRITICAL_SECTION_END();
}
`
at the end of the function.
With these modifications, your issue should be resolved.