mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
636 stars 207 forks source link

Device should not assert when no channels are enabled #44

Open terrillmoore opened 6 years ago

terrillmoore commented 6 years ago

When we added random channel hopping, we added an assert if there is no 500 kHz channel enabled. This was a mistake, because the network can administratively disable 500 kHz and we should continue to work.

cstratton commented 5 years ago

My current workaround for this is just to clamp the DR to a maximum of 3 in both LMICcore_setDrJoin() and setDrTxpow() which prevents any attempt to utilize a 500 KHz BW.

I guess enabling one 500 KHz channel on the gateway (the sx1301 can only support one) could be more spec compliant, though have not tried it to see how it works in practice.

Perhaps the datarate could be clamped if no 500 KHz channel is configured, though that raises the question where it is safest to change the datarate - ie, if the 500 KHz channel is disabled while on 500 KHz things could still be bad, but I'm not sure changing the datarate from channel choosing code is safe either. And just declining to transmit means that recovery doesn't happen until ADR code scales back the datarate.