-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnrc/lorawan: support for single channel gateways #13590
base: master
Are you sure you want to change the base?
gnrc/lorawan: support for single channel gateways #13590
Conversation
@@ -96,6 +96,10 @@ uint32_t gnrc_lorawan_pick_channel(gnrc_lorawan_t *mac) | |||
|
|||
void gnrc_lorawan_process_cflist(gnrc_lorawan_t *mac, uint8_t *cflist) | |||
{ | |||
#ifdef GNRC_LORAWAN_SINGLE_CHANNEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you checked if the Join Procedure sends the channel list?
If so, there's no need add this guard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, tested with TTN. The Join_Accecpt contains the optional channel list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah true, it's the same network server :)
#ifdef GNRC_LORAWAN_SINGLE_CHANNEL | ||
(void)mac; | ||
(void)cflist; | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef GNRC_LORAWAN_SINGLE_CHANNEL | |
(void)mac; | |
(void)cflist; | |
#else | |
if(!IS_USED(GNRC_LORAWAN_SINGLE_CHANNEL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can be done. As I understand, @gschorcht proposes that GNRC_LORAWAN_SINGLE_CHANNEL
holds the single frequency value, so it would not be a boolean switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, GNRC_LORAWAN_SINGLE_CHANNEL
defines a value. IS_USED
and IS_ACTIVE
test for a macro that is 1, 0 or not defined. So they are not applicable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, misread and though it was a boolean
please squash |
6e858d5
to
3f54b94
Compare
Squashed |
@@ -29,11 +29,16 @@ extern "C" { | |||
* @brief Default LoRaWAN channels for current region (EU868) | |||
*/ | |||
static const uint32_t gnrc_lorawan_default_channels[] = { | |||
#ifdef GNRC_LORAWAN_SINGLE_CHANNEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation on this option should be added.
@gschorcht @leandrolanzieri any progress? |
@miri64 Thanks for going through all these PR and pushing them a bit 👍 As I see it, only the option needs to be documented. I will try to do it in next days. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
3f54b94
to
5d48995
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This PR allows the use of
gnrc/lorawan
with single channel gateways.There are a number of cheap single/dual channel gateways on the market, for example the Dragino LG02. Although they are not recommended for LoRaWAN use, they are inexpensive tools for playing with and testing RIOT's LoRa functions. However, the use of different channels for the join procedure and the send function avoids the use of such a single-channel gateway.
Therefore, this PR introduces a compile time variable
GNRC_LORAWAN_SINGLE_CHANNEL
, which can be used to define a single frequency. When this variable is defined, only this frequency is set ingnrc_lorawan_default_channels
during initialization and the channel configuration ingnrc_lorawan_process_cflist
after joining is disabled.Testing procedure
Set
ENABLE_DEBUG
to 1 indrivers/sx127x/sx172x_getset.c
and flashexamples/gnrc_lorawan
for any LoRa-Board withUse command
ifconfig 4 up
to join andsend 4 RIOT
afterwards. Allsx172x_set_channel
calls should show the configured frequency.Issues/PRs references