Hi Everyone,
I’m seeing some interesting behavior from my CC-AB01 (V2s) devices. Basically the unit stops responding to LoRa messages but the board is still running (at least the light is on). This has been difficult to characterise as it seems pretty inconsistent and random. Sometimes it has issues a few mins after boot up, other times it runs fine for a while then stops. I’ve checked my power supply etc etc and all seems ok on that front. I did notice in my code that I was using Radio.Rx(RX_TIMEOUT_VALUE) where RX timeout val is 1000. However, I didnt explicitly handle the timeout.
Eg:
void setup()
{
Serial.begin(9600);
while (!Serial) ; // Wait for serial port to be available
// Initialize Radio with optimized parameters for HTCC-AB01
RadioEvents.TxDone = OnTxDone;
RadioEvents.RxDone = OnRxDone;
Radio.Init(&RadioEvents);
Radio.SetChannel(RF_FREQUENCY);
Radio.SetTxConfig(xxx);
Radio.SetRxConfig(xxx);
// Start receiving
Radio.Rx(RX_TIMEOUT_VALUE);
}
void loop()
{
// Handle radio events
Radio.IrqProcess();
}
void OnRxDone(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr)
{
DoSomeStuff…
// Return to receive mode
Radio.Rx(RX_TIMEOUT_VALUE);
}
void OnTxDone(void)
{
Serial.println(“TX done”);
// Return to receive mode after transmission
Radio.Rx(RX_TIMEOUT_VALUE);
}
What would be the likely impact of not explicitly handling the RxTimeouts? Could the radio get into a funky state and stop responding?
I’ve added a timeout handler to my code:
void setup()
{
// Initialize Radio with optimized parameters for HTCC-AB01
RadioEvents.TxDone = OnTxDone;
RadioEvents.RxDone = OnRxDone;
RadioEvents.RxTimeout = OnRxTimeout; // Add timeout handler
Radio.Init(&RadioEvents);
// … rest of existing setup code …
}
void OnRxTimeout(void)
{
Serial.println(“RX Timeout - restarting receive mode”);
Radio.Rx(RX_TIMEOUT_VALUE);
}
Do you think adding the RX time out handler is likely to address the issue? My problem is I dont have the foggiest as to what else could be causing the issue. I’ve seen a few other posts suggesting a radio re-initialise etc but I’d like to avoid getting the board to do more work than it really needs to.
Suggestions appreciated!