Skip to content

Commit 03ec06b

Browse files
Reduce the default channel list
By default, LMIC uses 6 standard channels for joining and 3 standard channels for normal operation which are defined in the LoRaWAN specification. On top of that, it defines 3 additional channels. However, in practice it turns out that 3 of the 6 joining channels are not actually used by gateway, and neither are the 3 additional channels for normal operation. To maximize default operability, this commit reduces the default channels list to just (the same) 3 channels for both joining and normal operation (but at different duty cycles). Extra channels can be configured from the sketch, using LMIC_setupChannel(), and the example sketches will be modifed according to this.
1 parent f19d2cb commit 03ec06b

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/lmic/lmic.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -526,32 +526,25 @@ void LMIC_setPingable (u1_t intvExp) {
526526
//
527527
// BEG: EU868 related stuff
528528
//
529-
enum { NUM_DEFAULT_CHANNELS=6 };
530-
static CONST_TABLE(u4_t, iniChannelFreq)[12] = {
529+
enum { NUM_DEFAULT_CHANNELS=3 };
530+
static CONST_TABLE(u4_t, iniChannelFreq)[6] = {
531531
// Join frequencies and duty cycle limit (0.1%)
532-
EU868_F1|BAND_MILLI, EU868_J4|BAND_MILLI,
533-
EU868_F2|BAND_MILLI, EU868_J5|BAND_MILLI,
534-
EU868_F3|BAND_MILLI, EU868_J6|BAND_MILLI,
532+
EU868_F1|BAND_MILLI, EU868_F2|BAND_MILLI, EU868_F3|BAND_MILLI,
535533
// Default operational frequencies
536534
EU868_F1|BAND_CENTI, EU868_F2|BAND_CENTI, EU868_F3|BAND_CENTI,
537-
EU868_F4|BAND_MILLI, EU868_F5|BAND_MILLI, EU868_F6|BAND_DECI
538535
};
539536

540537
static void initDefaultChannels (bit_t join) {
541538
os_clearMem(&LMIC.channelFreq, sizeof(LMIC.channelFreq));
542539
os_clearMem(&LMIC.channelDrMap, sizeof(LMIC.channelDrMap));
543540
os_clearMem(&LMIC.bands, sizeof(LMIC.bands));
544541

545-
LMIC.channelMap = 0x3F;
546-
u1_t su = join ? 0 : 6;
547-
for( u1_t fu=0; fu<6; fu++,su++ ) {
542+
LMIC.channelMap = 0x07;
543+
u1_t su = join ? 0 : 3;
544+
for( u1_t fu=0; fu<3; fu++,su++ ) {
548545
LMIC.channelFreq[fu] = TABLE_GET_U4(iniChannelFreq, su);
549546
LMIC.channelDrMap[fu] = DR_RANGE_MAP(DR_SF12,DR_SF7);
550547
}
551-
if( !join ) {
552-
LMIC.channelDrMap[5] = DR_RANGE_MAP(DR_SF12,DR_SF7);
553-
LMIC.channelDrMap[1] = DR_RANGE_MAP(DR_SF12,DR_FSK);
554-
}
555548

556549
LMIC.bands[BAND_MILLI].txcap = 1000; // 0.1%
557550
LMIC.bands[BAND_MILLI].txpow = 14;

0 commit comments

Comments
 (0)