Quantcast
Channel: The Things Network - Latest posts
Viewing all articles
Browse latest Browse all 115657

Node with ESP8266 and RFM95W

$
0
0

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.


Viewing all articles
Browse latest Browse all 115657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>