Version 17.1 by Edwin Chen on 2022/08/23 12:02

Hide last authors
Xiaoling 13.1 1 **Table of** **Contents: **
Xiaoling 1.6 2
3 {{toc/}}
4
Xiaoling 7.2 5
6
Xiaoling 1.2 7 = 1. Introduce =
Xiaoling 1.1 8
Xiaoling 13.1 9
Xiaoling 1.2 10 A standard LoRaWAN packet via UDP packet forward to LoRaWAN server is AES128 encryption. In this chapter, we will show how this packet looks like in the server and see the possibility to get the content of this packet.
Xiaoling 1.1 11
Xiaoling 13.1 12
Xiaoling 2.2 13 [[image:image-20220527085838-1.png]]
Xiaoling 1.1 14
Xiaoling 1.2 15 Unencrypt Network modified from LoRaWAN
Xiaoling 1.1 16
Xiaoling 2.2 17
Xiaoling 14.2 18
Xiaoling 1.2 19 = 2. Analyze the LoRaWAN packet =
Xiaoling 1.1 20
Xiaoling 13.1 21
Xiaoling 1.2 22 If the gateway is connected to LoRaWAN server via UDP packet fordward. We can set the server address to a UDP server to get the LoRaWAN packets.
Xiaoling 1.1 23
Xiaoling 14.2 24
Xiaoling 5.2 25 [[image:image-20220527090005-2.png]]
Xiaoling 1.1 26
Xiaoling 1.2 27 UDP Server
Xiaoling 1.1 28
29
Xiaoling 1.2 30 We can get one of the LoRaWAN packet and analyze it. See below
Xiaoling 1.1 31
Xiaoling 5.2 32 [[image:image-20220527090050-3.png]]
Xiaoling 1.1 33
Xiaoling 1.2 34 Analyze the data
Xiaoling 1.1 35
Xiaoling 5.2 36
Xiaoling 1.4 37 (((
Xiaoling 8.4 38 From above screen shot, we can see most of the meaning except this** (% style="color:#4f81bd" %)"data":"QHxqASaAygwCXrumS1oFsgRq"(%%)**(% style="color:#4f81bd" %).(%%) This is the AES128 encryption data we mention above, it is base64 format. To decode this data, we need to have the** (% style="color:#4f81bd" %)APP Session Key(%%)**(% style="color:#4f81bd" %) (%%)and (% style="color:#4f81bd" %)**Network Session Key**(%%) of this end node. If we have these two keys, we are able to decode this packet by some LoRaWAN decode website like: [[LoRaWAN Decode Website>>url:https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/]].
Xiaoling 1.4 39 )))
Xiaoling 1.1 40
41
Xiaoling 1.5 42 (((
Xiaoling 1.2 43 Below is an example, from
Xiaoling 14.2 44
45
Xiaoling 1.5 46 )))
Xiaoling 1.1 47
Xiaoling 5.2 48 [[image:image-20220527090122-4.png]]
Xiaoling 1.2 49
50 Decode the packet
51
Xiaoling 6.2 52
Xiaoling 14.1 53
Xiaoling 1.2 54 = 3. Difference between OTAA and ABP mode =
55
Xiaoling 13.1 56
Xiaoling 1.2 57 There are two mode for End Node:
58
59 * OTAA: Over the air activation. In this mode, the end node will send a Join Request to server, server will reply with a Join Accept and the end node will parse this Join Accept message to get the Dev Addr / APP Session Key(AppSkey / Network Session Key(NwkSKey). Because the AppSkey and NwkSkey is dynamic, OTAA mode provide more security.
Xiaoling 11.4 60 * ABP: Activation by personalization. There is no hand-shake with LoRaWAN server for activition. The end node will use fix Dev Addr / APP Session Key(AppSkey / Network Session Key(NwkSKey) to upload the packet. So the packet can be decode if someone know these fix keys
Xiaoling 1.2 61
62 = 4. Get and decode the packet =
63
Xiaoling 13.1 64
Xiaoling 1.2 65 According to above, it is possible to get the payload from sensor without LoRaWAN server:
66
67 1. Setting the end node to ABP mode
Xiaoling 11.2 68 1. Add decode program and add the keys of the sensor. So to get the payload. There is an example for such application, see [[Communication with ABP End Node>>Communicate with ABP End Node without LoRaWAN Network Server --- LG308]]
Xiaoling 1.2 69
70 = 5. Use an unencrypt firmware =
71
Xiaoling 13.1 72
Xiaoling 1.2 73 If user doesn't care about the security of the data and use Dragino end node, it is possible that we provide a firmware without AES128 encrytion, so the server no need to decode packet. Please note this software is no LoRaWAN compatible and no security.
74
Xiaoling 1.4 75 (((
Xiaoling 8.3 76 The software will disable encryption, so the LoRaWAN payload raw** (% style="color:#4f81bd" %)"data":"QHxqASaAygwCXrumS1oFsgRq"(%%)** will looks like (% style="color:#4f81bd" %)**"data":"4068370126000000000c9e11223361898841"**(%%), and the meaning is as below:
Xiaoling 1.4 77 )))
Xiaoling 1.2 78
Xiaoling 6.2 79 [[image:image-20220527090341-5.png]]
Xiaoling 1.2 80
81 Unencrypt packet
82
Xiaoling 14.1 83
Edwin Chen 17.1 84 Note: In some device's firmware . There is a AT Command to Disable Encryption. See below:
Edwin Chen 15.1 85
Edwin Chen 16.1 86 * AT+DECRYPT=1 The payload is uploaded without encryption
87 * AT+DECRYPT=0 Encrypt when uploading payload (default)
Edwin Chen 15.1 88
89
Xiaoling 1.2 90 = 6. limitation =
91
Xiaoling 13.1 92
Xiaoling 1.2 93 * None standard LoRaWAN protocol, it is not compatible with LoRaWAN server.
94 * No device management / ADR management defined in LoRaWAN protocol
95 * No security.
96 * No Downlink
97 * Only use for ABP
Xiaoling 14.2 98
99