Skip to content

Commit

Permalink
Fix ABP mode initialization
Browse files Browse the repository at this point in the history
A modem initialized to factory defaults should be implicitly configured
to operate in the ABP mode with default session keys. This requires
invoking (internal) MLME join to properly initialize the LoRaMac
library. This patch modifies the modem to perform the internal join in
this corner case.

Without this modification, LoRaMac used the wrong application session
key until a mode switch (AT+MODE=1 followed by AT+MODE=0) was performed.
  • Loading branch information
janakj committed Aug 24, 2022
1 parent bf130c6 commit 1a02ab9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,7 @@ static void set_defaults(void)
#endif

// The original firmware configures the node in ABP mode by default
r.Type = MIB_NETWORK_ACTIVATION;
r.Param.NetworkActivation = ACTIVATION_TYPE_ABP;
LoRaMacMibSetRequestConfirm(&r);
lrw_set_mode(0);

// Disable LoRaWAN certification port by default
r.Type = MIB_IS_CERT_FPORT_ON;
Expand Down

0 comments on commit 1a02ab9

Please sign in to comment.