Serial encap by API
How to talk directly by Digi API frames
If you have a Digi Xtend or mesh radio box attached to a serial port or remote device server, here is an easy way to encapsulate serial packets to send to remote serial devices. This page documents a simple, lowest common denominator method - it does not show all possible solutions. It avoids being fancy and powerful; it is a method which does the basics.
Digimesh/rf-network types
Here is an enumeration of possible Digi mesh/rf-network types. At this simplest level, many types will share the same behavior for your encapsulated serial data code, yet programming in this knowledge will allow you to add fancier features in the future. To query the type of your mesh, use the AT Command DD which is documented on the XBee Product Codes page.
Notes on the table below:
- Name: a name or tag used by this page to refer to an rf-network type.
- Address Size: some rf-networks support other address forms, however the size listed is the one this example will use.
- Payload: the maximum serial message that can be moved - yet this is only a useful default. If options such as security or source-routing have been enabled, this payload size drops. On a few rf-networks, the size can be larger. You should allow customers/users to manually override this default at least on a full-network basis.
Codes | Name | Address Size | Payload | Description |
---|---|---|---|---|
XB24-ZB | Digi Zigbee | 64-bit | 84 | Digi's 3.x firmware supporting Zigbee 2007 |
XB24-B | Digi ZNet | 64-bit | 72 or 75 | Digi's 2.x firmware |
XB24-DM | Digi Mesh | 64-bit | 210 | Digi's proprietary mesh on 900Mhz and 2.4Ghz |
XB24-A | Digi 802.15.4 | 64-bit | 100 | Non-mesh star configured nodes on 2.4GHz |
XB09-DM | Digi XTend Mesh | 64-bit | 210 | Digi Mesh on Xtend hardware |
XB09-DP | Digi XTend | 16-bit | 2048 | Non-mesh star configured nodes on 900Mhz |
ASCII notations for Digi address types
- 64-bit addresses are normally coded as text like 00:13:a2:00:40:3e:19:c4!, with the '!' used to tag this as a 64-bit address for Mesh systems.
- 16-bit addresses are normally coded as hex like 0x1234
Full mesh RF-metworks
This includes the types “Digi Zigbee", "Digi Znet" and "Digi Mesh” (Find the newest Product Manual for your XBee here)
TRANSMIT; Client sends serial data
- API Identifier 0x10. API frame 0x11 can also be used. See also: Differences between API frame 0x10 and 0x11.
- Frame Id Byte = 0 unless client desires a Status report, then 0x01 to 0xFF
- 64-bit address of destination (USER MUST ENTER)
- 16-bit dest - set to 0xFFFE since in this example we only use the full 64-bit address
- Broadcast Radius set to 0
- Options set to 0
- Payload of serial protocol
TRANSMIT STATUS; Client receives
- API Identifier 0x8B
- Frame Id Byte = to match up to request TRANSMITTED above
- 16-bit dest - see manual, is ignored in this simple example
- Transmit retry Count - see manual
- Delivery Status - see manual
- Discovery Status - see manual
RECEIVE; Client receives serial response
- API Identifier 0x90. Setting the AT Command AO=1 allows your device to always receive 0x91 frames instead - see also: Differences between API frame 0x10 and 0x11.
- 64-bit address of source of response
- 16-bit dest - see manual, is ignored in this simple example
- Options - see manual
- Payload of serial protocol
Limited Mesh-like RF-Networks
This includes the types “Digi 802.15.4" and "Digi XTend Mesh” (Find the newest Product Manual for your XBee here)
TRANSMIT; Client sends serial data
- API Identifier 0x00
- Frame Id Byte = 0 unless client desires a Status report, then 0x01 to 0xFF
- 64-bit address of destination (USER MUST ENTER)
- Options set to 0
- Payload of serial protocol
TRANSMIT STATUS; Client receives
- API Identifier 0x89
- Frame Id Byte = to match up to request TRANSMITTED above
- Status - see manual
RECEIVE; Client receives serial response
- API Identifier 0x80
- 64-bit address of source of response
- RSSI signal strength - see manual
- Options - see manual
- Payload of serial protocol
Digi XTend, star network with 16-bit addressing
This includes the types “Digi XTend” (Find the newest Product Manual for your XBee here)
TRANSMIT; Client sends serial data
- API Identifier 0x01
- Frame Id Byte = 0 unless client desires a Status report, then 0x01 to 0xFF
- 16-bit address of destination (USER MUST ENTER) 0xFFFF is broadcast
- Options set to 0
- Payload of serial protocol
TRANSMIT STATUS; Client receives
- API Identifier 0x89
- Frame Id Byte = to match up to request TRANSMITTED above
- Status - see manual
RECEIVE; Client receives serial response
- API Identifier 0x81
- 16-bit address of source of response
- RSSI signal strength - see manual
- Options - see manual
- Payload of serial protocol