helium / router

router combines a LoRaWAN Network Server with an API for console, and provides a proxy to the Helium blockchain
Apache License 2.0
70 stars 31 forks source link

Downlink RX2 channel is using incorrect parameters #214

Closed illperipherals closed 3 years ago

illperipherals commented 3 years ago

working on this sparkfun board: https://www.sparkfun.com/products/17506?_ga=2.63543343.1013225684.1613409402-1824805981.1610045593

For US915, the downlink channels can only use DR8 – DR13 (all 500kHz). Furthermore, the second receive window (RX2) must only use 923.3/DR8. It would seem that the Join Accept may have specified the RX2 Data Rate as DR0.

image image

lthiery commented 3 years ago

Another useful table from the regional spec

image

FYI: RX1DROffset defaults to 0.

The uplink in @illperipherals 's logs is (SF10BW125 = DR0) which means you should be downlink in ( DR10 = SF10BW500). I believe your datarate look up works fine since this unit test looks good, so you're likely not implementing the table I've attached here to change data rate.

I assume you are following the default behavior noted from the main spec document: image

Vagabond commented 3 years ago
1> rr(lorawan_mac_region).
[area,connector,device,gateway,group,handler,ignored_node,
 multicast_channel,network,node,pending,profile,queued,
 rxframe,rxq,txdata,txq]

2> lorawan_mac_region:rx2_window('US915', #rxq{tmms=0, codr= <<"4/5">>}).
#txq{freq = 923.3,datr = <<"SF12BW500">>,codr = <<"4/5">>,
     time = 2000000,powe = undefined}

It's possible something is ignoring the datarate returned from the regional parameters code but the rx2 window parameters here look correct?

jdgemm commented 3 years ago

@macpie any thoughts?

macpie commented 3 years ago

Is miner touching those params? I can look

macpie commented 3 years ago

We are hard coding according to specs https://github.com/helium/routerv3/blob/master/src/lora/lorawan_mac_region.erl#L61 and https://github.com/helium/routerv3/blob/master/src/lora/lorawan_mac_region.erl#L102

I also checked that the miner is not touching data rate and it is not.

michaeldjeffrey commented 3 years ago

@illperipherals, @lthiery and I looked into this today, and it seems to have fixed itself. Can you confirm?

illperipherals commented 3 years ago

After 15 minutes of Join Request/Join Accept, it Joined and started Uplink/Downlink... I have not, however, been able to replicate the join (even after running for hours)...

macpie commented 3 years ago

Curious, @illperipherals mind if I close this (feel free to reopen if it happens again)

jdgemm commented 3 years ago

Unable to replicate, will open again if appears.