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.
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
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.
AT+CFGEX 1000 "12ab34cd5da0001" max datalength 8 Bytes
To read APPEUI
Then you need to reset the module to take its effect. Good luck, can you let us know if it worked?
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)
(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"
(read back AppEUI)
(read back DevEUI)
(read back AppKey)
Here I'm running the “cmd.loramac.rm1xx.sb” example, this is the output send back over the serial port:
>lora join (command I entered)
>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
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?
The module's API contains a command for lowering default datarate, but I'n not sure if this will work for JoinRequest.