That actually didn't work for me.
Huh, turns out the lmic.cpp LMIC_disableChannel(u1_t channel) for CFG_us915 I got from https://github.com/things4u/LoRa-Thing/tree/master/libraries/lmic-v1.5 is broken - for
struct lmic_t {
#elif defined(CFG_us915)
u2_t channelMap[(72+MAX_XCHANNELS+15)/16]; // enabled bits
that should be an array of 5 16 bit values (80 bits, to cover 74 total channels), which when initialized is:
LMIC.channelMap[0] = 0xFFFF 16
LMIC.channelMap[1] = 0xFFFF 32
LMIC.channelMap[2] = 0xFFFF 48
LMIC.channelMap[3] = 0xFFFF 64
LMIC.channelMap[4] = 0x00FF 72 bits
However, LMIC_disableChannel() for CFG_us915 is modulo 4???
LMIC.channelMap[channel/4] &= ~(1<<(channel&0xF));
should be 16. As it is, when you disable channel 4, you actually get 20!
4: channelMap[0]: ffff
channelMap[1]: ffef 1110 1111 wtf??
LMIC_disableChannel(8) turns off the bit for 40, etc. Changed it to:
LMIC.channelMap[channel/16] &= ~(1<<(channel&0xF));
in my little test file and got expected results - will try it out in the actual code later tonight.