diff --git a/src/Comissioning.h b/src/Comissioning.h index 3768931..5fb04bb 100644 --- a/src/Comissioning.h +++ b/src/Comissioning.h @@ -47,8 +47,7 @@ Maintainer: Miguel Luis and Gregory Cristian /*! * AES encryption/decryption cipher application key */ -#define LORAWAN_APPLICATION_KEY { 0x2F, 0x12, 0x04, 0xBA, 0x76, 0xB8, 0xB9, 0x8F, 0xDF, 0x45, 0x7F, 0x3E, 0xF7, 0x05, 0xC8, 0x0F } - +//#define LORAWAN_APPLICATION_KEY { 0x6C, 0x66, 0xB4, 0x29, 0x31, 0x42, 0xCA, 0x74, 0x3E, 0x72, 0xEF, 0xD4, 0xC6, 0x14, 0x12, 0x90 } /*! * Current network ID */ @@ -61,16 +60,18 @@ Maintainer: Miguel Luis and Gregory Cristian * a pseudo random generator seeded with a value derived from * BoardUniqueId value if LORAWAN_DEVICE_ADDRESS is set to 0 */ -#define LORAWAN_DEVICE_ADDRESS ( uint32_t )0x2601E3E +#define LORAWAN_DEVICE_ADDRESS ( uint32_t )0x26011415 /*! * AES encryption/decryption cipher network session key */ -#define LORAWAN_NWKSKEY { 0x00, 0x31, 0x40, 0xBE, 0x96, 0x33, 0xB3, 0xCF, 0x7C, 0x8B, 0xDD, 0xAB, 0x57, 0xAE, 0xCC, 0x08 } +#define LORAWAN_NWKSKEY { 0x43, 0x43, 0x9A, 0x33, 0x4C, 0x89, 0xDB, 0x6A, 0x19, 0x4D, 0x6B, 0x35, 0xAF, 0x07, 0xB9, 0x34 } /*! * AES encryption/decryption cipher application session key */ -#define LORAWAN_APPSKEY { 0x2F, 0x12, 0x04, 0xBA, 0x76, 0xB8, 0xB9, 0x8F, 0xDF, 0x45, 0x7F, 0x3E, 0xF7, 0x05, 0xC8, 0x0F } +#define LORAWAN_APPSKEY { 0xB6, 0x64, 0x3D, 0x93, 0x86, 0xFE, 0xB4, 0xAB, 0x52, 0x50, 0x49, 0x90, 0x55, 0x5B, 0x81, 0x26 } + + #endif // __LORA_COMMISSIONING_H__ diff --git a/src/main.c b/src/main.c index a0b911b..1a6404a 100644 --- a/src/main.c +++ b/src/main.c @@ -16,14 +16,14 @@ #define APP_ADR_ON 1 // Whether we use Adaptive Data Rate or not #define APP_CONFIRMED_MSG_ON 0 // Whether this example will transmit confirmed or unconfirmed packets -static uint8_t DevEui[] = LORAWAN_DEVICE_EUI; -static uint8_t AppEui[] = LORAWAN_APPLICATION_EUI; -static uint8_t AppKey[] = LORAWAN_APPLICATION_KEY; - #if (OVER_THE_AIR_ACTIVATION == 0) static uint8_t NwkSKey[] = LORAWAN_NWKSKEY; static uint8_t AppSKey[] = LORAWAN_APPSKEY; static uint32_t DevAddr = LORAWAN_DEVICE_ADDRESS; +#else + static uint8_t DevEui[] = LORAWAN_DEVICE_EUI; + static uint8_t AppEui[] = LORAWAN_APPLICATION_EUI; + static uint8_t AppKey[] = LORAWAN_APPLICATION_KEY; #endif @@ -108,6 +108,7 @@ static void OnTxNextPacketTimerEvent(void) else // We need to join before we can send data DeviceState = DEVICE_STATE_JOIN; } + GpioToggle(&Led1); } @@ -204,7 +205,7 @@ int main( void ) MlmeReq_t mlmeReq; // Initialize LoRaMac device unique ID - BoardGetUniqueId(DevEui); + //BoardGetUniqueId(DevEui); mlmeReq.Type = MLME_JOIN; mlmeReq.Req.Join.DevEui = DevEui;