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 1.2 18 = 2. Analyze the LoRaWAN packet =
Xiaoling 1.1 19
Xiaoling 13.1 20
Xiaoling 1.2 21 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 22
Xiaoling 14.2 23
Xiaoling 5.2 24 [[image:image-20220527090005-2.png]]
Xiaoling 1.1 25
Xiaoling 1.2 26 UDP Server
Xiaoling 1.1 27
28
Xiaoling 1.2 29 We can get one of the LoRaWAN packet and analyze it. See below
Xiaoling 1.1 30
Xiaoling 5.2 31 [[image:image-20220527090050-3.png]]
Xiaoling 1.1 32
Xiaoling 1.2 33 Analyze the data
Xiaoling 1.1 34
Xiaoling 5.2 35
Xiaoling 1.4 36 (((
Xiaoling 8.4 37 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 38 )))
Xiaoling 1.1 39
40
Xiaoling 1.5 41 (((
Xiaoling 1.2 42 Below is an example, from
Xiaoling 14.2 43
44
Xiaoling 1.5 45 )))
Xiaoling 1.1 46
Xiaoling 5.2 47 [[image:image-20220527090122-4.png]]
Xiaoling 1.2 48
49 Decode the packet
50
Xiaoling 6.2 51
Xiaoling 1.2 52 = 3. Difference between OTAA and ABP mode =
53
Xiaoling 13.1 54
Xiaoling 1.2 55 There are two mode for End Node:
56
Xiaoling 17.3 57 * (% style="color:blue" %)**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 1.2 58
Xiaoling 17.3 59 * (% style="color:blue" %)**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 17.2 60
61
Xiaoling 17.3 62
Xiaoling 1.2 63 = 4. Get and decode the packet =
64
Xiaoling 13.1 65
Xiaoling 1.2 66 According to above, it is possible to get the payload from sensor without LoRaWAN server:
67
Xiaoling 17.3 68 * Setting the end node to ABP mode
Xiaoling 1.2 69
Xiaoling 17.3 70 * 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 17.2 71
72
Xiaoling 17.3 73
Xiaoling 1.2 74 = 5. Use an unencrypt firmware =
75
Xiaoling 13.1 76
Xiaoling 1.2 77 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.
78
Xiaoling 1.4 79 (((
Xiaoling 8.3 80 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 81 )))
Xiaoling 1.2 82
Xiaoling 6.2 83 [[image:image-20220527090341-5.png]]
Xiaoling 1.2 84
85 Unencrypt packet
86
Xiaoling 14.1 87
Xiaoling 17.3 88 (% style="color:red" %)**Note: In some device's firmware . There is a AT Command to Disable Encryption. See below:**
Edwin Chen 15.1 89
Xiaoling 17.3 90 * (% style="color:blue" %)**AT+DECRYPT=1**(%%)  The payload is uploaded without encryption
Edwin Chen 15.1 91
Xiaoling 17.3 92 * (% style="color:blue" %)**AT+DECRYPT=0  **(%%) Encrypt when uploading payload (default)
Edwin Chen 15.1 93
Xiaoling 17.2 94
Xiaoling 17.3 95
Xiaoling 1.2 96 = 6. limitation =
97
Xiaoling 13.1 98
Xiaoling 1.2 99 * None standard LoRaWAN protocol, it is not compatible with LoRaWAN server.
Xiaoling 17.3 100
Xiaoling 1.2 101 * No device management / ADR management defined in LoRaWAN protocol
Xiaoling 17.3 102
Xiaoling 1.2 103 * No security.
Xiaoling 17.3 104
Xiaoling 1.2 105 * No Downlink
Xiaoling 17.3 106
Xiaoling 1.2 107 * Only use for ABP
Xiaoling 14.2 108
109
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0