ArduinoCore-stm32l0 icon indicating copy to clipboard operation
ArduinoCore-stm32l0 copied to clipboard

Downlink counter greater then uplink counter crashes the device

Open SloMusti opened this issue 5 years ago • 0 comments

This is a corner case which should not be happening if the lorawan server is working well, we found one however that makes some odd things with counters. While the communication should not work, the device should not crash to the point of the watchdog to trigger.

Steps to reproduce:

  • Make the network server send the downlink sequence number to be greater then the uplink counter number.
  • Observe the device to get stuck somewhere or crash such that watchdog triggers

Two examples that happened when a message with downlink counter greater then the uplink counter has been received. @GrumpyOldPizza can you advice where this could be happening and we can prepare a pull-request with a fix.

lorawan_send( TimeOnAir: 5686, NextTxTime: 0, MaxPayloadSize: 51, DR: 1, TxPower: 16.0dbm, UpLinkCounter: 52, DownLinkCounter: 1, Port: 2, Size: 6 )
RECEIVE( RSSI: -19, 
Ssetup(serial debug begin): resetCause: 3
fsm(0>0,-1,177) - device reet due to WDT
JOINED
lorawan_send( TimeOnAir: 0, NextTxTime: 0, MaxPayloadSize: 51, DR: 1, TxPower: 16.0dbm, UpLinkCounter: 53, DownLinkCounter: 1023, Port: 3, Size: 20 )
lorawan_send( TimeOnAir: 3214, NextTxTime: 0, MaxPayloadSize: 51, DR: 1, TxPower: 16.0dbm, UpLinkCounter: 57, DownLinkCounter: 1023, Port: 2, Size: 6 )
RECEIVE( RSSI: 
-23,setup(serial debug begin): resetCause: 3 -- reset happens here
lorawan_send( TimeOnAir: 0, NextTxTime: 0, MaxPayloadSize: 51, DR: 1, TxPower: 16.0dbm, UpLinkCounter: 58, DownLinkCounter: 1024, Port: 3, Size: 20 )
``

SloMusti avatar Nov 14 '19 10:11 SloMusti