New Zigbee Demo

Zigbee demo added to gr-rftap. See gr-rftap examples directory. Notice the RFtap “Signal Quality” metric available in Wireshark for every packet:

RFtap Zigbee demo

In order to achieve this result, available in the examples/zigbee_rftap.grc flowgraph, we add two blocks:

  • RFtap Encapsulation
  • LQI to qual
Zigbee flowgraph zoom - RFtap section

In the RFtap encapsulation block, we specify a Custom Data Link Type of 195 (Zigbee), as per this linktype list.

RFtap block properties

As for the Signal Quality property, we use the Link Quality Indicator (LQI) available from 802.15.4 block, and convert it to RFtap signal quality (qual) field using an embedded python block:

Embedded python block properties - "LQI to qual"

The embedded code:

import numpy as np
from gnuradio import gr
import pmt

class blk(gr.basic_block):
    """Convert Zigbee Link Quality Indicator (LQI) (0..255) 
       to RFtap signal quality field (qual) (0.0..1.0)"""

    def __init__(self):
        gr.basic_block.__init__(
            self,
            name='LQI to qual',   # will show up in GRC
            in_sig=[],
            out_sig=[]
        )
        self.message_port_register_in(pmt.intern('in'))
        self.set_msg_handler(pmt.intern('in'), self.handle_msg)
        self.message_port_register_out(pmt.intern('out'))

    def handle_msg(self, pdu):
        meta, data = pmt.to_python(pdu)
        meta['qual'] = meta['lqi'] / 255.0
        pduout = pmt.cons(pmt.to_pmt(meta), pmt.to_pmt(data))
        self.message_port_pub(pmt.intern('out'), pduout)

The modified Zigbee flowgraph is available in gr-rftap/examples.

The demo uses the GNU Radio 802.15.4 Zigbee module, part of the WiME project:

IEEE 802.15.4 ZigBee WiME project

What is RFtap?

RFtap is a simple protocol designed to provide RF (Radio Frequency) metadata about packets, such as:

  • Accurate signal and noise power
  • Accurate timing and phase information
  • Accurate Carrier and Doppler frequencies of every packet, and more.

You can think of RFtap as the “glue” between GNU Radio and Wireshark, allowing access to RF metadata from Wireshark or Scapy.

The RFtap protocol is designed to encapsulate any type of packet: Wi-Fi, Bluetooth, or packets from any proprietary protocol.