embedded_raumsenor_lorawan/LoRaWAN_Payload_Description.md
2025-11-05 16:37:08 +01:00

61 lines
2.1 KiB
Markdown

# LoRaWAN Payload Description - Raumsensor Device
## Uplink Payload (Device → Network Server)
**Port:** 2
**Length:** 7 bytes
**Format:** Binary
| Byte | Field | Type | Unit | Description |
|------|-------|------|------|-------------|
| 0-1 | Room Temperature | int16_t | 0.01°C | SHT4x sensor reading (big-endian) |
| 2-3 | Floor Temperature | int16_t | 0.01°C | MLX90614 IR sensor reading (big-endian) * |
| 4-5 | Humidity | int16_t | 0.01% | SHT4x sensor reading (big-endian) |
| 6 | Relay State | uint8_t | - | Current relay status (0=OFF, 1=ON) |
**Example Uplink:**
- `08 34 0A 28 15 E0 01` = 21.00°C room, 26.00°C floor, 56.00% humidity, relay ON
## Downlink Payload (Network Server → Device)
**Port:** Any
**Format:** Binary
### Combined Configuration Packet
**Length:** 3 bytes
**Format:** `[heating_enable][room_temp_threshold][floor_temp_threshold]`
| Byte | Field | Type | Range | Description |
|------|-------|------|-------|-------------|
| 0 | Heating Enable | uint8_t | 0-1 | Heating control logic (0=DISABLED, 1=ENABLED) |
| 1 | Room Temperature Threshold | uint8_t | 0-255 | Target room temperature in °C |
| 2 | Floor Temperature Threshold | uint8_t | 0-255 | Target floor temperature in °C |
**Examples:**
- `01 16 19` = Enable heating, room 22°C, floor 25°C
- `00 14 18` = Disable heating, room 20°C, floor 24°C
### Send Interval Command
**Length:** 2 bytes
**Format:** `'i'[interval_minutes]`
| Byte | Field | Type | Range | Description |
|------|-------|------|-------|-------------|
| 0 | Command | ASCII | 'i' (0x69) | Send interval command identifier |
| 1 | Interval | uint8_t | 1-255 | Send interval in minutes |
**Examples:**
- `69 05` = Set send interval to 5 minutes
- `69 3C` = Set send interval to 60 minutes
## Data Conversion
- **Temperature:** `value = (int16_t)(temperature * 100)`
- **Humidity:** `value = (int16_t)(humidity * 100)`
- **Decoding:** `actual_value = received_value / 100.0`
## Special Cases
**\* Floor Temperature Sensor:** If the MLX90614 sensor is not available or not responding, the floor temperature will be transmitted as `-273.15°C` (hex: `95 5D`).