Over The Air Activation (OTAA)

  • 10 August 2016
  • 5 reacties
  • 3815 keer bekeken

Reputatie 2
Badge +1
This post has become obsolete as it was incorporated in the Over the air activation (OTAA) of devices topic.

With Over The Air Activation (OTAA) a device joins a specific LoRa network using the DevEUI and an AppEUI together with an AppKey. The DevEUI is an End Device Unique Identifier DevEUI (64 bits) and must be unique for all LoRaWAN networks. The DevEUIs are administrated by the IEEE. The AppEUI is a global application ID in IEEE EUI64 address space that uniquely identifies the application provider (i.e., owner) of the end-device. The AppKey is an AES key, used only when joining the network with OTAA.

The Join Procedure:
  • The device sends an unencrypted LoRa join request with the AppEUI, DevEUI, and a random generated and unique DevNonce.
  • If the network allows the device, then a join accept is sent to the device containing a random generated and unique AppNonce, a NetID, a DevAddr and some additional variables with network info ( used delays, frequencies & data rates). The join accept is encrypted with the AppKey.
  • The device and the join server can now both calculate the NwkSkey & AppSKey using the AppKey, AppNonce, DevNonce and NetID
  • The device and network communicate this session using the NwkSKey and AppSKey for encryption

DevEUI, AppEUI & AppKey can be implemented in the device without knowledge about any specific LoRa network, enabling automation. NwkSKey & AppSKey can be renewed by forcing a new join session. This should be done regularly to increase security.

5 reacties

Hello, I'm having trouble to use OTAA with a RM186-SM LORA tranceiver from LairdTech.
I'm trying to register to the KPN LORA network by means of OTAA. I received an email from KPN to connect a maximum of 10 LORA devices. This email contains a DevAddr, DevEUI, NwsKey and AppsKey for 10 different LORA devices. The manual for the RM186-SM says for OTAA you need a AppEui, DevEui and AppKey. Where do I find the AppEui? A LairdTech engineer told me KPN should provide it.


link to manual: http://cdn.lairdtech.com/home/brandworld/files/Interfacing%20with%20LoRaWAN%20-%20RM186.pdf
Reputatie 7
Badge +11
Hello jossmilde,

You need to register the AppEui inside the device. So you need to write the firmware with the Appeui. According to the Laird Manual you should do this Serial.

The write command is: AT+CFGEX |1000|"Hex key string"
The Read command is: AT+CFGEX |1000| ?

You can make your own random hexstring as long it meets the
IEEE EUI64 standard. Thats also why the name is APP(EUI64).
1000 is the store ID. you can set it as you wish.

For example:
AT+CFGEX 1000 "12ab34cd5da0001" max datalength 8 Bytes
To read APPEUI
AT+CFGEX 1000?

Then you need to reset the module to take its effect. Good luck, can you let us know if it worked?
Hello Tim,

Thanks for your input!
I made up my own AppEui and I still can't connect to the KPN LORA network by means of OTAA. This is exactly how I configured my RM186-SM LORA device with the following AT commands:

(erase all non volatile settings)
at&f *

(made up AppEUI, all characters from DevEUI incremented with 1. So: 0->1, A->B and F->0....)
at+cfgex 1000 "116ABD1111289EBF"

(DevEUI from KPN mail)
at+cfgex 1001 "0059AC0000178DAE"

(made up AppKey, all characters from AppEUI incremented with 1, and repeated two times.)
at+cfgex 1002 "227BCE222239AFC0227BCE222239AFC0"

(reset device)
atz

(read back AppEUI)
at+cfgex 1000?
116ABD1111289EBF

(read back DevEUI)
at+cfgex 1001?
0059AC0000178DAE

(read back AppKey)
at+cfgex 1002?
227BCE222239AFC0227BCE222239AFC0

Here I'm running the “cmd.loramac.rm1xx.sb” example, this is the output send back over the serial port:

OK
>lora join (command I entered)

OK
>Attempting to join the LoRa network
Failed to join the LoRa network (response from RM186-SM)


Attached screenshot shows how I configured the device in the “Thingpark Wireless”
Here you will find the example code I used: https://github.com/LairdCP/RM1xx-Applications/blob/master/cmd.loramac.rm1xx.sb




Reputatie 7
Badge +11
Hi Jos,

Basicly you're not doing anything wrong I can see. To be sure you're not having any reception problems, do you experience the same issue on another location?
Reputatie 1
Badge
As far as I see from the doc, by default that module transmits JoinRequest message with SF7. This may be the root couse of your troubles, if you're located far enough from a base station.

The module's API contains a command for lowering default datarate, but I'n not sure if this will work for JoinRequest.

Reageer