AN-306 LoRaWAN Radar Presence Sensor User Guide
Device Information: Model AN-306, devEui ffffff100004bd16, gateway IP 192.168.31.193, Modbus Slave ID 7, BACnet Device ID 106
1 Protocol Overview
The AN-306 reports radar presence state, radar event, battery voltage, tamper status, and signal quality on Fport 210.
1.1 Uplink Data Protocol (Fport 210)
Payload format (Fport 210):
| Byte | Field | Description |
|---|---|---|
| 0 | Reserved | Always 0x00 (protocol version) |
| 1 … N | TLV pairs | [Type(1 B)][Value(N B)] … repeating until end |
Each Type byte determines the field name and the number of following value bytes:
| Type | Value Bytes | Field Name | Encoding | Scale | Unit | Notes |
|---|---|---|---|---|---|---|
0x01 |
1 | model |
uint8 | — | — | Model code = 0x44 |
0x6D |
1 | packetType |
uint8 | — | — | 0x00=heartbeat 0x01=data report |
0x77 |
1 | tamperState |
uint8 | — | — | 0=normal 1=tampered |
0xBD |
1 | presenceStatus |
uint8 | — | — | 0=no person 1=person present (status) |
0xBE |
1 | presenceEvent |
uint8 | — | — | 0=no event 1=presence event triggered |
0x03 |
1 | tamperEvent |
uint8 | — | — | 0=normal 1=tamper event |
JavaScript Decoder Example:
// AN-306 Radar Presence Sensor — Fport 210 uplink decoder
function decodeUplink(bytes) {
var i = 1, r = {};
while (i < bytes.length) {
var t = bytes[i++];
switch (t) {
case 0x01: r.model = bytes[i++]; break;
case 0x03: r.tamperEvent = bytes[i++]; break;
case 0x6D: r.packetType = bytes[i++]; break;
case 0x77: r.tamperState = bytes[i++]; break;
case 0xBD: r.presenceStatus= bytes[i++]; break; // 0=no person 1=person
case 0xBE: r.presenceEvent = bytes[i++]; break; // 0=no event 1=event
default: i++; break;
}
}
return r;
}
// Example payload (hex): 00 01 44 6D 01 77 00 BD 01 BE 01
// → { model:68, packetType:1, tamperState:0, presenceStatus:1, presenceEvent:1 }
Script download: LPP.zip
Compatibility note: LPP.js is developed and tested against ChirpStack v4.17.0. The ChirpStack JavaScript codec API may differ across versions — if you are running a different ChirpStack version, review and adjust the script as needed before deployment.
2 Getting Uplink Data
⚠️ The IP addresses (192.168.31.205/192.168.31.193), ChirpStack API token, Slave ID, BACnet Device ID, and devEui in the examples below are for demonstration only. Replace them with your actual gateway IP, ChirpStack API token, and device parameters.
2.1 ChirpStack MQTT Subscription
Subscribe to the MQTT topic to receive real-time uplink frames:
Application ID —3ef9e6b9-ec54-4eda-86b8-a5fb46899f39is the factory-default ChirpStack
application built into the gateway. Replace it with your actual application
ID if you have created a different one.
Gateway IP —192.168.31.193is the gateway WAN port IP shown as an
example. Replace it with your actual gateway IP address.
Device EUI —ffffff100004bd16is the EUI of the example device.
Replace it with the EUI shown in the gateway device list, or use+
as a wildcard to subscribe to all devices at once.
# Subscribe to one specific device
mosquitto_sub -h 192.168.31.193 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff100004bd16/event/up"
# Subscribe to ALL devices on ALL applications (wildcard)
mosquitto_sub -h 192.168.31.193 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/+/device/+/event/up"
Example uplink payload (JSON):
{
"devEui": "ffffff100004bd16",
"fPort": 210,
"object": {
... (decoded LPP fields)
}
}
2.2 IoT Hub HTTP API
Send a GET request to retrieve the latest device state:
curl -s "http://192.168.31.193:8070/api/getStatus?devEui=ffffff100004bd16"
{
"success": true,
"result": {
"presence": false,
"tamper": 0,
"presenceEvent": 0,
"isHeartbeat": false,
"model": "AN-306"
}
}
2.3 IoT Hub Modbus TCP — Python Script
Script download: modbus_tcp_read.py
Use modbus_tcp_read.py to poll all registers at once:
python3 modbus_tcp_read.py --ip 192.168.31.193 --port 502 \
--slaveId 7 --sensorType AN-306
Target: 192.168.31.193:502 | Slave ID: 7 | Sensor: AN-306
================================================================================================================================================================
Attribute | Addr | FC | Format | Order | Cnt | Scale | Raw(Hex) | Value | Unit
----------------------------------------------------------------------------------------------------------------------------------------------------------------
online | 6 | 03 | Bit/Bool | Big(ABCD) | 1 | x1 | 0001 | true | none
lastOnlineTime | 7 | 03 | UnixTime | Big(ABCD) | 2 | x1 | 69CC CEC5 | 1775029957 | second
presence | 9 | 03 | Bit/Bool | Big(ABCD) | 1 | x1 | 0000 | false | none
tamper | 10 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
presenceEvent | 11 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
tamperEvent | 12 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
isHeartbeat | 13 | 03 | Bit/Bool | Big(ABCD) | 1 | x1 | 0000 | false | none
model | 38 | 03 | String(24B) | ASCII | 12 | x1 | 414E 2D33 3036 0000 ... | AN-306 | none
rssi | 50 | 03 | Int16 | Big(ABCD) | 1 | x1 | FFC1 | -63.0 | none
snr | 51 | 03 | Int16 | Big(ABCD) | 1 | x1 | 000D | 13.0 | none
2.4 IoT Hub Modbus TCP — Modbus Poll
Tool download: Modbus Poll 9.5.0.1507.zip
- Open Modbus Poll, connect to
192.168.31.193:502, Slave ID7 - Menu Setup → Read/Write Definition, set Function Code = FC03, Start Address =
6, Length =46 - Click OK — values update in real-time
2.5 IoT Hub BACnet BIP — Python Script
Script download: bacnet_read.py
Use bacnet_read.py to read all BACnet objects:
python3 bacnet_read.py --ip 192.168.31.193 --port 47808 --id 106
Target: 192.168.31.193:47808 | BACnet ID: 106 | Scan: 10600-10699
------------------------------------------------------------
Type | Instance | Offset | Value | Object Name
------------------------------------------------------------
BI | 10602 | 2 | active | ffffff100004bd16.online
AI | 10603 | 3 | 1775030016.00 | ffffff100004bd16.lastOnlineTime
BI | 10604 | 4 | inactive | ffffff100004bd16.presence
AI | 10605 | 5 | 0.00 | ffffff100004bd16.tamper
AI | 10606 | 6 | 0.00 | ffffff100004bd16.presenceEvent
AI | 10607 | 7 | 0.00 | ffffff100004bd16.tamperEvent
BI | 10608 | 8 | inactive | ffffff100004bd16.isHeartbeat
CV | 10612 | 12 | AN-306 | ffffff100004bd16.model
AI | 10613 | 13 | -63.00 | ffffff100004bd16.rssi
AI | 10614 | 14 | 13.00 | ffffff100004bd16.snr
2.6 IoT Hub BACnet BIP — YABE
Tool download: SetupYabe_v2.1.0.exe
- Open YABE, connect to
192.168.31.193:47808 - Expand Device 106 in the device tree
- Browse AI/BI/AV/BV/CV objects to view real-time values