Dragino PB01 LoRaWAN Button Integration Guide
Model catalog
Search for these models in ThinkLink by name or ID.
| Model type | Name | id_name | Platform model ID |
|---|---|---|---|
| RPC | [PB01 GET] 21312 | pb01_get_21312 | 134020096518418432 |
| RPC | [PB01 SET] 21312 | pb01_set_21312 | 134020095729889280 |
| Template | PB01 | PB01_21312 | 134020093183946752 |
| Thing Model | [PB01] | pb01_21312 | 134020094186385408 |
| Parameter Thing Model | [PB01-PARA] | pb01_para_21312 | 134020094945554432 |
1. Device Overview
The PB01 is a native LoRaWAN Class A wireless button from Dragino, powered by two AAA batteries. It reports a button event immediately and periodically reports battery voltage, sound settings, temperature, and humidity. Its buzzer supports configurable button sound, server ACK sound, press duration, and melody.
This integration covers the LoRaWAN variant only. It does not include NB-IoT, EdgeBus, or an external DTU.
| Item | Value |
|---|---|
| Project | DRAGINO-21312-PB01 |
| Business code | 21312 |
| Vendor / Model | Dragino / PB01 |
| Tenant | PUBLIC |
| Radio | LoRaWAN 1.0.3, Class A |
| Default region | CN470; it must match the device firmware |
| Default uplink period | 1200 s |
| Default downlink FPort | 2; configurable through a template shared attribute |
2. Typical Applications
- One-button assistance or manual event reporting in facilities and campuses.
- Exception marking in warehouses, equipment rooms, and work areas.
- Non-medical assisted calling in accessibility and elder-care scenarios.
- Low-power deployments that need both a button event and ambient temperature/humidity.
The button is not a substitute for a life-safety or medical alarm system. The deployment owner should connect button events to an appropriate notification, work-order, or alarm workflow.
3. LoRaWAN Uplink Protocol
3.1 FPort 2 Real-time Data
FPort 2 contains a fixed 8-byte payload:
| Byte Position | Field | Encoding | Conversion |
|---|---|---|---|
| 0–1 | battery | uint16BE | mV ÷ 1000 = V |
| 2 bit0 | button_sound | bit | 1=enabled, 0=disabled |
| 2 bit1 | ack_sound | bit | 1=enabled, 0=disabled |
| 3 bit0 | button_alarm | bit | 1=button event, 0=periodic uplink |
| 4–5 | temperature | int16BE | ÷ 10 °C |
| 6–7 | humidity | uint16BE | ÷ 10 %RH |
Official example:
FPort: 2
Payload: 0C EA 03 01 01 11 02 A8
Result: battery=3.306 V, button_sound=1, ack_sound=1,
button_alarm=1, temperature=27.3 °C, humidity=68.0 %RHThe parser also reads rssi and snr from the first gateway reception. An empty payload, a port other than 2, or a payload that is not exactly 8 bytes is ignored.
The sound bits follow the latest PB01 manual:
button_sound=bit0andack_sound=bit1. An older official Dragino decoder labels these fields in the opposite order; this integration treats the device manual as authoritative.
3.2 FPort 5 Device Status
After a status request, the device sends a fixed 7-byte FPort 5 payload:
| Byte Position | Field | Encoding / Meaning |
|---|---|---|
| 0 | sensor_model | PB01 marker 0x35 |
| 1–2 | firmware_version | version nibbles |
| 3 | frequency_band | region enumeration |
| 4 | sub_band | sub-band; 0xFF means not applicable |
| 5–6 | status_battery | uint16BE, mV ÷ 1000 |
Example:
FPort: 5
Payload: 35 01 00 0B FF 0C DE
Result: sensor_model=PB01, firmware_version=1.0.0,
frequency_band=CN470, sub_band=N/A, status_battery=3.294 VThe parameter model also synchronizes button_sound and ack_sound from normal FPort 2 uplinks into shared attributes. An invalid FPort 5 length or a model byte other than 0x35 is rejected.
3.3 Excluded FPort
PB01 uses FPort 3 for historical data, with 11 bytes per record. Historical replay is not included in this common-use integration. Add a dedicated historical model if offline replay needs to be displayed; do not mix it with the real-time stream.
4. Telemetry Fields
| Field | Type | Unit | Description |
|---|---|---|---|
battery | number | V | Real-time battery voltage |
button_sound | number | — | Button sound state, 0/1 |
ack_sound | number | — | ACK sound state, 0/1 |
button_alarm | number | — | Button event state, 0/1 |
temperature | number | °C | Signed ambient temperature |
humidity | number | %RH | Relative humidity |
rssi | number | dBm | RSSI from the first gateway |
snr | number | dB | SNR from the first gateway |
The status model exposes sensor_model, firmware_version, frequency_band, sub_band, and status_battery.
5. RPC
5.1 Common Settings
pb01_set_21312 uses a setting variant and sends one setting per invocation. A Class A device normally receives downlinks only in receive windows following an uplink, so unrelated configuration commands should not be queued together.
| Setting | Parameters | Range | Downlink |
|---|---|---|---|
| Uplink period | period_up | 1–16777215 s | 01 + uint24BE |
| Sounds | button_sound, ack_sound | each 0–1 | A1 BB AA |
| Button press duration | button_press_duration | 0–1000 ms | A2 + uint16BE |
| Buzzer melody | buzzer_music_type | 0–4 | A3 MM |
Examples:
period_up=300 -> 01 00 01 2C
button_sound=0, ack_sound=1 -> A1 00 01
button_press_duration=1000 -> A2 03 E8
buzzer_music_type=3 -> A3 03The protocol does not define a common immediate echo for these settings. RPC completion confirms that the platform constructed and submitted the downlink; it does not by itself prove that the device applied it. Sound state can be checked in a subsequent FPort 2 uplink.
5.2 Device Status Request
pb01_get_21312 always sends:
26 01The device then reports firmware, frequency band, sub-band, and battery data on FPort 5.
6. Template Deployment
Select the following PUBLIC template:
- Template:
PB01 - id_name:
PB01_21312 - Template ID:
134020093183946752
Before deployment:
- Ensure
standardmatches the device firmware and LoRaWAN network. The template default is CN470. - Register the OTAA device with the DevEUI, JoinEUI/AppEUI, and AppKey printed on its label. Never store these credentials in the integration project.
- The default
downlink_portis 2. Change it to another value from 1 to 223 only when required by the network server or firmware. - Wait for an uplink before sending a Class A downlink.
- On first deployment, request device status and verify the reported band and firmware.
Template shared-attribute defaults:
| Attribute | Default |
|---|---|
class_mode | ClassA |
standard | CN470 |
period_up | 1200 s |
downlink_port | 2 |
button_sound | 1 |
ack_sound | 1 |
button_press_duration | 0 ms |
buzzer_music_type | 3 |
7. Testing and Troubleshooting
The local protocol test is test/pb01.test.mjs. It covers:
- The official FPort 2 sample and a negative-temperature sample.
- Sound-bit semantics, invalid ports, and invalid lengths.
- FPort 5 status decoding and model validation.
- Exact payload bytes for all four SET variants.
- The GET status command
2601. - Model/RPC metadata, template references, and the public sensor index.
If no data arrives, check the DevEUI/JoinEUI/AppKey, regional band, gateway coverage, and uplink FPort. If a downlink appears ineffective, wait for the next uplink and then check the Class A receive window, configured downlink FPort, and network-server queue before validating the result through a later uplink or status response.
8. References
- Dragino PB01 product page: https://www.dragino.com/products/lorawan-nb-iot-door-sensor-water-leak/item/333-pb01-lorawan-button.html
- Dragino PB01 online manual: https://wiki.dragino.com/docs/LoRaWAN-End-Node/trackers-buttons-beacons/pb01/
- Dragino PB01 official decoder: https://github.com/dragino/dragino-end-node-decoder/tree/main/PB01