Update MKRWAN.h to expose RX2 parameters #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The method setRX2DR is needed to allow receiving downlinks from TTN when using ABP in EU region with SF9-SF12. In this case, TTN chose not to follow the standard parameters for the RX2 window (that is, SF12 at 869.525KHz), but is sending at SF9.
Since the MKR WAN 1300 firmware implements the standard, to successfully send downlinks on TTN it is necessary to modify the RX2 data rate to SF9.
This fork adds methods to get and set data rate and, for completeness, frequency, for the RX2 receiving window:
getRX2DR()
, to get the current data rate for RX2getRX2Freq()
, to get the current frequency for RX2setRX2DR(uint8_t dr)
, to set data rate for RX2 (the only one really needed: usemodem.setRX2DR(3)
after joining with ABP to set the data rate to SF9)setRX2Freq(uint32_t freq)
to set the RX2 frequency (no need to change it at present).Please note that when joining with OTAA this is not needed because parameters are communicated back to the node by the network.