Skip to content

Dragino PB01 LoRaWAN Button Integration Guide

Model catalog

Search for these models in ThinkLink by name or ID.

Model typeNameid_namePlatform model ID
RPC[PB01 GET] 21312pb01_get_21312134020096518418432
RPC[PB01 SET] 21312pb01_set_21312134020095729889280
TemplatePB01PB01_21312134020093183946752
Thing Model[PB01]pb01_21312134020094186385408
Parameter Thing Model[PB01-PARA]pb01_para_21312134020094945554432

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.

ItemValue
ProjectDRAGINO-21312-PB01
Business code21312
Vendor / ModelDragino / PB01
TenantPUBLIC
RadioLoRaWAN 1.0.3, Class A
Default regionCN470; it must match the device firmware
Default uplink period1200 s
Default downlink FPort2; 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.1 FPort 2 Real-time Data

FPort 2 contains a fixed 8-byte payload:

Byte PositionFieldEncodingConversion
0–1batteryuint16BEmV ÷ 1000 = V
2 bit0button_soundbit1=enabled, 0=disabled
2 bit1ack_soundbit1=enabled, 0=disabled
3 bit0button_alarmbit1=button event, 0=periodic uplink
4–5temperatureint16BE÷ 10 °C
6–7humidityuint16BE÷ 10 %RH

Official example:

text
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 %RH

The 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=bit0 and ack_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 PositionFieldEncoding / Meaning
0sensor_modelPB01 marker 0x35
1–2firmware_versionversion nibbles
3frequency_bandregion enumeration
4sub_bandsub-band; 0xFF means not applicable
5–6status_batteryuint16BE, mV ÷ 1000

Example:

text
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 V

The 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

FieldTypeUnitDescription
batterynumberVReal-time battery voltage
button_soundnumberButton sound state, 0/1
ack_soundnumberACK sound state, 0/1
button_alarmnumberButton event state, 0/1
temperaturenumber°CSigned ambient temperature
humiditynumber%RHRelative humidity
rssinumberdBmRSSI from the first gateway
snrnumberdBSNR 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.

SettingParametersRangeDownlink
Uplink periodperiod_up1–16777215 s01 + uint24BE
Soundsbutton_sound, ack_soundeach 0–1A1 BB AA
Button press durationbutton_press_duration0–1000 msA2 + uint16BE
Buzzer melodybuzzer_music_type0–4A3 MM

Examples:

text
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 03

The 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:

text
26 01

The 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:

  1. Ensure standard matches the device firmware and LoRaWAN network. The template default is CN470.
  2. Register the OTAA device with the DevEUI, JoinEUI/AppEUI, and AppKey printed on its label. Never store these credentials in the integration project.
  3. The default downlink_port is 2. Change it to another value from 1 to 223 only when required by the network server or firmware.
  4. Wait for an uplink before sending a Class A downlink.
  5. On first deployment, request device status and verify the reported band and firmware.

Template shared-attribute defaults:

AttributeDefault
class_modeClassA
standardCN470
period_up1200 s
downlink_port2
button_sound1
ack_sound1
button_press_duration0 ms
buzzer_music_type3

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