LoRaWAN
LoRaWAN, which stands for Long Range Wide Area Network, is a wireless communication protocol designed for low-power IoT devices. It enables secure and scalable data transmission over long distances while consuming minimal power. This makes it well-suited for widespread use in smart cities, industrial IoT, and agricultural applications.
This document describes LoRaWAN protocol support and payload structure for data transmission.
Protocol Specifications
The latest firmware complies with the following LoRaWAN specifications.
LoRaWAN Version
1.0.4
Regional Parameters Version
RP002 Regional Parameters 1.0.4
Available Frequency Plans
EU868 (Europe) US902-928 (USA, Canada, and South America)
Payload Format
Uplink Frame Ports
The frame port is a data frame field specifying the application-specific commands or data payload type. For instance, Device firmware uses the frame port field to tell the payload formatter how to decode the transmitted message.
1
System
Device state
2
Telemetry
Periodic sensor readouts
3
Telemetry Alert
Alarm state
4
Telemetry Log
Periodic historical sensor readouts
Uplink Payload Structure
The firmware may dynamically change the telemetry payload according to its sensor configuration. Each sensor reading data, e.g., vibration, contains 4 bytes. This structure includes sensor type, statistics mode, and 24-bit sensor reading.
For example, the firmware encodes an average of 100 Hz vibration on the x-axis as 00111001 00000001 10000110 10100000 where; - Bits [31:26] indicate the sensor data type (x-axis vibration), - Bits [25:24] indicate the statistics type (average), - And bits [23:0] indicate sensor reading (100,000 Hz).
When the device reads more than one sensor data, it adds another 4-byte structure with the same logic for each reading. The illustrated sensor data structure is as follows.
Sensor Data
[31:26]
Data Type
Sensor readout type, e.g., temperature or light intensity
[25:24]
Statistics Type
Statistical type of the readout, e.g., actual, average, min, or max
[23:0]
Value
Sensor readout
Data Types
Position: Bits [31:26]
0
Null / Terminator
N/A
N/A
N/A
Indicates no reading
1
Temperature
Yes
4
C
Ambient temperature
2
Relative Humidity
No
4
%
Ambient relative humidity
3
Pressure
No
4
hPa
Air pressure
4
Gas Estimation
No
4
%
Classified gas estimation
5
IAQ
No
4
AQI
Indoor air quality index
6
VOC
No
4
ppm
Total volatile organic compounds
7
NOX
No
2
ppb
NOX Index
8
CO2
No
2
ppm
CO2
9
Particulate Matter
No
2
μm
Particles in the air
10
Dew Point
Yes
4
C
Dew Point
11
Visible Light
No
0
Human visible light
12
IR Light
No
0
Infrared light
13
UV Index
No
4
UV Index
Ultraviolet index
14
RGB
No
0
bits
RGB color channels
15
Light Custom
No
0
N/A
Application specific data
16
Angle
Yes
4
deg
Device angle
17
Vibration
No
4
Hz
Vibration of the device
18
RPM
No
2
Ticks
Revolutions per minute
19
Speed
No
4
Km/h
Current speed
20
Latitude
Yes
4
deg
Current latitude
21
Longitude
Yes
4
deg
Current longitude
22
Altitude
Yes
2
m
Current altitude
23
Heading
Yes
4
deg
Current heading
24
Weight
No
0
g
Measured weight
25
Distance
No
0
mm
Distance to an object
26
Contact
No
0
bits
Contact sensor state
27
Movement Detect
No
0
bits
PIR sensor state
28
Wind Speed
No
4
Km/h
Current wind speed
29
Wind Direction
Yes
4
deg
Current wind degree
30
Precipitation
No
2
mm
Current rainfall
31
Soil Moisture
No
4
%
Soil moisture level
32
Water Flow
No
0
Ticks
Amount of water flow
33
Water Conductivity
No
0
µmhos/cm
Water EC
34
pH
No
4
pH
Water pH
35
Salinity
No
4
ppt
Concentration of salt in water
36
TDS
No
4
ppm
Total dissolved solids
37
Water Custom 1
No
0
N/A
Application specific data
38
Water Custom 2
No
0
N/A
Application specific data
39
Water Custom 3
No
0
N/A
Application specific data
40
Voltage
No
4
V
Voltage reading
41
Current
No
2
A
Current passing
42
Frequency
No
4
Hz
Mains frequency
43
Real Power
No
2
W
Energy consumption
44
Apparent Power
No
2
VA
Voltage Current
45
Reactive Power
No
2
VAR
Voltage-Current phase shift
46
Power Factor
No
4
%
Real power ratio
47
Phase Angle
No
4
deg
Angular time-shift
48
Custom 1
No
0
N/A
Application specific data
49
Custom 2
No
0
N/A
Application specific data
50
Custom 3
No
0
N/A
Application specific data
51
Custom 4
No
0
N/A
Application specific data
52
Sound Pressure
Yes
4
dB
Sound pressure
53
Solar Radiation
No
2
W/m²
Solar power to panel area ratio
54
Probe Temperature
Yes
3
C
Probe temperature
55
Probe Pressure
No
2
hPa
Probe pressure input
56
UID
No
0
Bytes
Unique Id
57
Time
No
0
N/A
Event timestamp
58
Battery Voltage
No
4
V
Battery input Voltage
59
Solar Voltage
No
4
V
Solar panel input Voltage
60
Counter
No
0
Ticks
Digital input change counter
61
Duty Cycle
No
4
%
Digital input duty cycle
62
Analog Input
No
4
V
Analog input reading
63
Digital Input
No
0
Bits
Digital input port state
Statistics Types
Position: Bits [25:24]
0
Actual
Latest sensor reading
1
Average
Average of the historical data
2
Minimum
Minimum of the historical data
3
Maximum
Maximum of the historical data
Value
Position: Bits [23:0]
The value field carries the actual sensor readout. The payload formatter encodes the value according to the "signed" and "fraction" specifications of the data type.
Uplink Payload Formatter
Use the following Javascript code as the custom payload formatter script.
Last updated