Replies: 7 comments 6 replies
-
A few questions:
If you are using a version newer or equal to v4.4.7 (LoRaWAN 1.0.3), v.4.5.1 (LoRaWAN 1.0.4) or master (1.0.4)/develop(1.0.4/1.1.1) branch you have the possibility to erase the NVM data through the serial interface by pressing ESC then shift N keys. |
Beta Was this translation helpful? Give feedback.
-
If you don't mind I move this issue to the Discussions tab. |
Beta Was this translation helpful? Give feedback.
-
Version: d02b2f8 I can still reproduce this:
|
Beta Was this translation helpful? Give feedback.
-
These are the local changes that I have made: $ git diff
diff --git a/src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c b/src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c
index 89bb63bd..031090c4 100644
--- a/src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c
+++ b/src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c
@@ -73,7 +73,7 @@
*
* \remark Please note that LORAWAN_DEFAULT_DATARATE is used only when ADR is disabled
*/
-#define LORAWAN_DEFAULT_DATARATE DR_0
+#define LORAWAN_DEFAULT_DATARATE DR_5
/*!
* LoRaWAN confirmed messages
diff --git a/src/peripherals/soft-se/se-identity.h b/src/peripherals/soft-se/se-identity.h
index 872167b4..c9abc932 100644
--- a/src/peripherals/soft-se/se-identity.h
+++ b/src/peripherals/soft-se/se-identity.h
@@ -66,17 +66,17 @@ extern "C" {
* When set to 1 DevEui is LORAWAN_DEVICE_EUI
* When set to 0 DevEui is automatically set with a value provided by MCU platform
*/
-#define STATIC_DEVICE_EUI 0
+#define STATIC_DEVICE_EUI 1
/*!
* end-device IEEE EUI (big endian)
*/
-#define LORAWAN_DEVICE_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+#define LORAWAN_DEVICE_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 }
/*!
* App/Join server IEEE EUI (big endian)
*/
-#define LORAWAN_JOIN_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+#define LORAWAN_JOIN_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 }
/*!
* Secure-element pin
@@ -112,8 +112,8 @@ extern "C" {
* WARNING: FOR 1.0.x DEVICES IT IS THE \ref LORAWAN_APP_KEY \
*/ \
.KeyID = NWK_KEY, \
- .KeyValue = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, \
- 0x3C }, \
+ .KeyValue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x04 }, \
}, \
{ \
/*! |
Beta Was this translation helpful? Give feedback.
-
Only ESC & shift+N + power-cycle will wipe the old context data from the EEPROM. So if you want to change the soft-se keys, flash the new keys, then run ESC & shift+N + power-cycle. |
Beta Was this translation helpful? Give feedback.
-
Hi, When I observed this behavior I tried with erasing the NVM in the start of the application using To solve this can't we take a decision about the restoring the nvm data after comparing it with the data provided in the "se-identity.h" . Is there any way I can pass ESC + N. My project is having a continuous power supply and for this I want to store the data in NVM only when I intended to power off the node. Is there any way to achieve this? |
Beta Was this translation helpful? Give feedback.
-
I couldn't get soft-se to work either (latest stack). It seems there is a problem in the LmHandlerInit code, it first calls LoRaMacInitialization which does a wipe of the soft-se NVM, then it proceeds to
which, of course, then reads out 0's and puts in CommissioningParams.JoinEui no matter what. What I really wanted to do was to use SecureElementSetJoinEui(eui); to setup the Join EUI before LmHandlerInit but that won't work as that function re-initializes the soft-se module and wipes whatever you wrote there first. I ended up having to monkeypatch a callback inside LmHandlerInit into my main code, which does the SetJoinEui there... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It looks like when
CONTEXT_MANAGEMENT_ENABLED
is enabled, together with the soft-se option, that changing the keys inse-identity.h
has no effect. I noticed this after updating theLORAWAN_JOIN_EUI
andNWK_KEY
. After (re)flashing, the device kept using the oldLORAWAN_JOIN_EUI
(and I assume as well theNWK_KEY
, as the device failed to join).I tried removing the
build
folder,make clean
etc... but none of my changes had any effect. Then I noticed the###### =========== CTXS RESTORED =========== ######
message. After disablingCONTEXT_MANAGEMENT_ENABLED
, rebuild and reflash, the device succesfully joined using the newLORAWAN_JOIN_EUI
andNWK_KEY
.Beta Was this translation helpful? Give feedback.
All reactions