Many products set up their radio module every time they start: the network, the channels, the addresses, the baud rate. Those commands travel over two pins you can probe. Our example is a Digi XBee-PRO S3B; the method works for any module with a serial port.
Through-hole XBees share a 20-pin footprint (Digi's user guides 90002173, 90000982, 90001500):
| Pin | Name | What it is |
|---|---|---|
| 1 | VCC | Power: 2.1 to 3.6 V on the XBee-PRO S3B |
| 2 | DOUT | What the radio sends to the device (its replies) |
| 3 | DIN / CONFIG | What the device sends to the radio (its commands) |
| 10 | GND | Ground |
Surface-mount XBees and other makers' modules use other pins: the module's data sheet names its TX and RX.
AT command mode is readable text: a second of silence, +++, another second, and the radio answers OK. Then each command is AT, two letters and an optional hexadecimal value: ATID7FFF. ATCN leaves command mode.
API mode (AP = 1 or 2) uses binary frames starting with 0x7E: two length bytes, the frame data, a checksum. Setting the preamble ID to 2 looks like 7E 00 05 08 01 48 50 02 5C: type 0x08 (AT command), frame ID 01, the letters H and P, the value 02, and the checksum 0xFF minus the low byte of the sum. Decode API traffic in Hex.
For the XBee-PRO 900HP (S3B), from Digi's user guide 90002173; values are hexadecimal.
| Command | What it sets | Default |
|---|---|---|
| ATID | Network ID: radios talk only to the same ID | 0x7FFF |
| ATHP | Preamble ID, 0 to 7 | 0 |
| ATCM | Channel mask: one bit per frequency it may hop on | every channel but 19 |
| ATDH, ATDL | Destination address, high and low 32 bits | 0 and 0xFFFF (broadcast) |
| ATSH, ATSL | Ask the radio's own 64-bit address | read only |
| ATBD | Serial baud rate: 3 is 9600, 6 is 57,600, 7 is 115,200; it switches when command mode ends | 3 (9600) |
| ATAP | 0 transparent (AT), 1 API, 2 API with escaped characters | 0 |
| ATPL | Transmit power, 0 to 4 | 4 |
| ATWR | Save the settings, so they survive a power cycle | |
| ATCN | Leave command mode and apply the changes | |
| ATVR | Ask the firmware version | read only |
An illustration of a typical start-up, not a capture of any particular product:
| DIN (device to radio) | DOUT (radio to device) | Meaning |
|---|---|---|
+++ | OK | Command mode |
ATID1A2B | OK | Network ID 0x1A2B |
ATDH0, ATDLFFFF | OK, OK | Broadcast to the network |
ATBD6 | OK | 57,600 baud, from when command mode ends |
ATWR, ATCN | OK, OK | Saved; back to transparent mode at the new rate |
A start-up that changes rate partway needs each part decoded at its own rate (why).
Save the decoder's event table as a CSV file, which a spreadsheet opens.
On a through-hole XBee, DOUT (pin 2) is the radio's transmit line to the device and DIN (pin 3) its receive line. GND is pin 10.
Either the radio was configured once and saved with ATWR, so the device sends nothing, or it uses API mode: binary frames starting with 0x7E. Switch the decoder to Hex.
Whatever its BD setting says: 9600 from the factory (BD = 3). Measure it if unsure: how.