XBeeParser

A utility to decode data packets sent to or received by Digi XBee modules

Latest Release: 1.0.4

 

About XBeeParser

This is an XBee packet decoder written in Python 3.

It is a work in progress. The current version decodes all the standard XBee packets, and provides further decoding of a limited (but growing) selection of Zigbee Device Object (ZDO) commands (eg. 16-bit network address request) and general (aka ‘global’) Zigbee Cluster Library commands (eg. Read Attribute).

How To Use XBeeParser

Run XBeeParser at the command line and provide a code XBee packet as a string of hexadecimal octets:

$ python xbp.py 7e0020950013a20040522baa7d84027d840013a20040522baa2000fffe0101c105101e1b

The XBee packet string need not be a single string; you can also include spaces:

$ python xbp.py 7e 95-20-00 00 00-a2-13 2-52-40b aa 7d 7-02-84d 13-00-84 a40-00-2 52 2b aa 20 00 ff fe 01 05-c1-01 1-1e-10b

Make XBeeParser Global

To simplify usage of XBeeParser, run the following commands:

  1. mv xbp.py /usr/local/bin/xbp
  2. chmod +x /usr/local/bin/xbp

Then you run XBeeParser from any location in your filesystem:

$ xbp 7e 88-05-00 45-45-05 00 e8

Escaping

By default, XBeeParser assumes packets have been escaped, but this can be disabled with the -e or --escape switch. Follow this with false to disable escaping (or true to be explicit about enabling escaping.

Options

XBeeParser has the following options:

ShortLongValuesDescription
-e--escapetrue or falseUse escaping when decoding packets. Default: true
-d--debugtrue or falseShow extra debug information. Default: false
-v--versionN/AShow version information
-h--helpN/AShow help information

Examples

Using Options

$ python xbp.py -d true -e false 7e0020950013a20040522baa7d84027d840013a20040522baa2000fffe0101c105101e1b

This generates the following output:

Extra debugging information will be printed during decoding
Packet decoding will not use escaping
7E0020950013A20040522BAA7D84027D840013A20040522BAA2000FFFE0101C105101E1B
XBee frame found
Frame length                  : 32 bytes
XBee command ID               : 95 "Node identification indicator response"
Address (64-bit)              : 0013A20040522BAA
Address (16-bit)              : 7D84
Status                        : Packet a Broadcast Packet
Address (16-bit)              : 7D84
Address (64-bit)              : 0013A20040522BAA
NI string                     : Default
Parent address (16-bit)       : FFFE
Device type                   : Router
Source event                  : Pushbutton
Digi Profile ID               : C105
Manufacturer ID               : 101E
Checksum                      : 1B

Zigbee

$ python xbp.py 7E 002D 40522-0013A200-91BAA 06FC 8038-00-00 01-01-0000 1-00F8FF07-00D10-0000-00 69-5E-54 5B 4B 48-44-48 57-55-55 41-51-46 6-4B-44E

This generates the following output:

XBee frame found
Frame length                  : 45 bytes
XBee command ID               : 91 "Zigbee explicit RX indicator"
Address (64-bit)              : 0013A20040522BAA
Address (16-bit)              : 06FC
Source endpoint               : 00
Destination endpoint          : 00
Cluster ID                    : 8038
Profile ID                    : 0000
Status                        : Packet acknowledged
Frame data                    : 010000F8FF071D00000010545E695B4B484448555557465141444B
  ZDO command                 : Management Network Update Response
  Transaction seq. number     : 01
  Response status             : Success
Checksum                      : 6E


Source Code

You can view XBeeParser’s source code at GitHub.


Release Notes

  • 1.0.4 9 January 2019
    • Add intro text on run.
    • Some code clean-up.
  • 1.0.3 8 November 2019
    • Fix ZDO address lookup response type check.
  • 1.0.2 6 November 2018
    • Add Discover Commands Received, Discover Commands Generated request decoders.
    • Add Discover Commands Received, Discover Commands Generated response decoders.
    • Add further XBee command constants.
    • Add XBee commands — 0xA4, register joining device status; 0xA5, join notification status.
    • Update help, version info.
    • Fix little endian byte order on ZCL frame decoders.
  • 1.0.1 5 November 2018
    • Fix incorrect attribute type display.
    • Fix attribute value display bug.
  • 1.0.0 2 November 2018
    • Initial release.

Related Software


smittytonesmittytone
Site and software copyright © 2024, Tony Smith