wpan¶
Previous: link · Up: Applications · Next: zstack
An IEEE 802.15.4 test shell for the ESP32-C6 and the ESP32-S3: it sends and receives test frames through any Zephyr 802.15.4 radio driver.
Overview¶
The wpan shell compares radios against each other: the C6’s native radio and the S3’s
esp-sdr software radio, whose PHY and driver are in
IEEE 802.15.4. Both send and count the same test frames
(Test frames).
Hardware¶
Chip |
Board |
Radio |
|---|---|---|
ESP32-C6 |
XIAO ESP32C6 |
the native radio ( |
ESP32-S3 |
XIAO ESP32S3 |
the |
Building and flashing¶
ESP32-C6, native radio, over USB-Serial-JTAG:
west build -b xiao_esp32c6/esp32c6/hpcore esp-sdr-zephyr/apps/wpan
west flash
ESP32-S3, software radio, with the shell on the OTG port and DFU updates as the other apps (Applications, “DFU updates”):
west build --sysbuild -b xiao_esp32s3/esp32s3/procpu esp-sdr-zephyr/apps/wpan
west flash # first install; later: west dfu -s <usb serial>
The S3 build uses the gapless ring receive (three dump banks), so its thread stacks and tables
live in ESP_SDR_HIGH_RAM (Code placement).
Usage¶
Shell¶
The commands follow the shared pattern (Applications, “Shell conventions”).
Command |
Effect |
|---|---|
|
radio, settings, receive and transmit counters (and the software radio’s counters on the S3, the ACK counters among them) |
|
settings, several at once; without arguments the keys (Settings) |
|
zero the receive and driver counters |
|
start or stop receiving (the S3 software radio starts off) |
|
send test frames (0: until |
|
stop a running |
|
one 1 ms capture: carrier offset, power, chip phase steps (S3) |
|
one 1 ms capture as base64 I/Q, for |
|
reset cause, driver event trail, stalled CPU 0, last crash (S3) |
|
system heap use (with |
|
one ACK on the air now (S3, receiving) |
|
ring decimation by 4 and PHY cost on synthetic data, or the ACK waveform build and front end
switch times (S3, radio off after one |
Settings¶
Key |
Values |
Radio |
|---|---|---|
|
11..26 (2405 + 5 (n - 11) MHz) |
both |
|
<dBm> |
both |
|
0, 1 |
both |
|
<PAN ID> |
both |
|
<short> (auto-ACK on both radios) |
both |
|
0, 1, 2: nothing, a line, a line and a hex dump per frame |
both |
|
auto, <index> |
S3 |
|
0, 1 |
S3 |
|
0, 1 |
S3 |
|
below, above |
S3 |
|
<pairs>: the ring unit length, default 1024 |
S3 |
|
<delay us>[,<limit us>]: the ACK timing, 192,512 |
S3 |
Example session¶
The C6 sends, the S3 receives on channel 15:
s3:~$ wpan set chan 15 print 0
s3:~$ wpan on
c6:~$ wpan set chan 15
c6:~$ wpan tx 1000 5 16
s3:~$ wpan status
Output format¶
Test frames¶
Test frames are data frames (PAN ID compression, short addresses).
Their payload starts with the magic
X154and a 32-bit counter, followed by a pattern derived from the counter.The receiver checks the pattern and counts frames, test frames, corrupt ones, duplicates and counter gaps (lost frames).
See also¶
IEEE 802.15.4: the software radio’s PHY, driver and ACKs.
Testing: the regression tests that use these frames.
zstack: a Zigbee coordinator on the C6’s radio.
Applications: shell conventions, DFU updates and USB access.
Previous: link · Up: Applications · Next: zstack