Open utkarshshah007 opened 6 years ago
I was able to discover the source of this issue.
For US-915, the datarate for joining is set in lmic.c as follows:
if( LMIC.datarate != DR_SF8C ) {
LMIC.txChnl = 64+(LMIC.txChnl&7);
setDrJoin(DRCHG_SET, DR_SF8C);
} else {
LMIC.txChnl = os_getRndU1() & 0x3F;
s1_t dr = DR_SF7 - ++LMIC.txCnt;
if( dr < DR_SF10 ) {
dr = DR_SF10;
failed = 1; // All DR exhausted - signal failed
}
setDrJoin(DRCHG_SET, dr);
}
When LMIC.txCnt
reaches 132, dr
becomes -129.
However, dr
is an 8-bit signed integer, which means that it’s minimum value is -128. Therefore, it overflows and becomes +127.
Here's a PR that solves this issue: #197
After running for about an hour using a slight modification of ttn-otaa (just sending unheard join requests, the TTN gateway I'm using is disconnected), my LoRa end node hits:
FAILURE /.../Arduino/libraries/IBM_LMIC_framework/src/lmic/radio.c:429
This corresponds to an early assert in the txfsk() method. However, this node should be running in Lora mode, not FSK mode.
I assume this means that
getSf(LMIC.rps) == FSK
must be true. I've set my downlink datarate to SF9, as suggested in the ttn-otaa example.Why might my end node be in FSK mode? How do I change this?