Skip to content

Commit 00f3c87

Browse files
committed
latest update - still work in progress
1 parent c77bf7e commit 00f3c87

File tree

2 files changed

+92
-1
lines changed

2 files changed

+92
-1
lines changed

docs/data_encoding.md

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ The general structure of a packed value is:
1111

1212
\[ **Value Type** *{1 byte}* ][**Data Value** *{n bytes - network byte order }*]
1313

14-
1514
### Value Type
1615

1716
Key attributes of a "Value Type" tag/code:
@@ -38,3 +37,94 @@ The following table outlines how a data value is packed, based on it's data type
3837
| float | 4 | Network Byte Order (4 bytes) |
3938
| double | 8 | \[ Network Byte Order (4 bytes) ][ Network Byte Order (4 bytes) ] |
4039

40+
## Packet Encoding
41+
42+
When packing a data value in the LoRaWAN packet payload, which has a total of 11 bytes available, data values are formatted as described in the previous section and added to the payload until no further space is available. When the payload is *full* (no free space available for the next data value), it is sent to the LoRaWAN network.
43+
44+
So for a 11 byte LoRaWAN Payload buffer, the contents could be (note a Value Type is 1 byte):
45+
46+
* \[ **Value Type**][**Data Value** *{4 bytes}*]\[ **Value Type**][**Data Value** *{4 bytes}*]\[**empty** {1 byte}] = **10 bytes used**
47+
* \[ **Value Type**][**Data Value** *{2 bytes}*]\[ **Value Type**][**Data Value** *{4 bytes}*]\[**empty** {3 byte}] = **8 bytes used***
48+
* \[ **Value Type**][**Data Value** *{2 bytes}*]\[ **Value Type**][**Data Value** *{4 bytes}*]\[ **Value Type**][**Data Value** *{2 bytes}*] = **11 bytes used**
49+
50+
The general payload packing is as follows:
51+
52+
### *Initial Condition*
53+
54+
* Set the current position in the payload to position 0
55+
56+
### *Operation*
57+
58+
1) Data Packet is formatted
59+
1) If no room is available in the payload
60+
* The data payload is sent to the LoRaWAN
61+
* The payload buffer set to position 0
62+
1) The data packet is added to the payload buffer
63+
1) The current position in in the payload is incremented by the size of the data packet
64+
1) Repeat step 1) until all data is sent
65+
66+
### *End Condition*
67+
68+
* Flush the payload buffer - send any pending data to the LoRaWAN
69+
70+
## Sensor and Data Value Encodings
71+
72+
The following table outlines the sensors and data encoding used by the IoT Node - LoRaWAN firmware:
73+
74+
| Sensor | Parameter | Value Type | Value Type Code | Data Type |
75+
| -- | -- | -- | -- | -- |
76+
| BME688 | | | ||
77+
| | Humidity | Humidity_F | | float|
78+
| | Temperature C | TempC | | float|
79+
| | Pressure | Pressure_F | | float|
80+
| BME280 | ||||
81+
|| Humidity |Humidity_F | | float|
82+
|| Temperature F | TempF || float|
83+
|| Temperature C | TempC || float|
84+
|BMP384|||||
85+
|| Temperature C | TempC_D ||double|
86+
|| Presure (Pa)| Pressure_D || double|
87+
|BMP581|||||
88+
|| Pressure (Pa) | Pressure_F || float|
89+
|| Temperature C | TempC || float|
90+
|CCS811|||||
91+
|| CO2 | CO2_F || float|
92+
|| VOC| TVOC || float|
93+
|ENS160|||||
94+
|| Equivalent CO2 | CO2 || uint16|
95+
|| TVOC| VOC || unit16|
96+
||Ethanol Concentration | ETOH || uint16 |
97+
|| Air Quality Index | AQI || uint8 |
98+
|FS3000|||||
99+
|| Flow (MPS) | MPS || float|
100+
|| FLow (MPH) | MPH || float|
101+
|GNSS|||||
102+
|| Latitude in Degrees | Latitude || double|
103+
|| Longitude in Degrees| Longitude || double|
104+
|| Altitude (meters) | Altitude || double|
105+
|ISM330|||||
106+
|| Accelerometer X (milli-g)| AccelX || float|
107+
|| Accelerometer Y (milli-g)| AccelY || float|
108+
|| Accelerometer Z (milli-g)| AccelZ || float|
109+
|| Gyro X (milli-dps)| GyroX || float|
110+
|| Gyro Y (milli-dps)| GyroY || float|
111+
|| Gyro Z (milli-dps)| GyroZ || float|
112+
|LPS25HB|||||
113+
|| Pressure (hPa) | Pressure_F || float|
114+
|| Temperature C | TempC || float|
115+
|MAX17048|||||
116+
|| Voltage (V)| BatteryVoltage || float|
117+
|| State Of Charge (%) | BatteryCharge || float|
118+
|| Change Rate (%/hr) | BatteryChargeRate || float|
119+
|Micro Pressure|||||
120+
|| Pressure (Pa)| Pressure_F || float|
121+
|MS5637|||||
122+
|| Pressure (mBar) | Pressure_mBar || float|
123+
|| Temperature C | TempC || float|
124+
|NAU7802|||||
125+
|| Weight| WeightUserUnits|| float|
126+
|OPT4048|||||
127+
|| CIEx| CIE_X || double|
128+
|| CIEy | CIE_Y || double|
129+
|| CIET | CCT || double|
130+

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ extra_javascript:
249249
nav:
250250
- Getting Started:
251251
- Introduction: introduction.md
252+
- Advanced:
252253
- Data Encoding: data_encoding.md
253254
- Support:
254255
- Troubleshooting: troubleshooting.md

0 commit comments

Comments
 (0)