■ FIGURE 4. XCTU Serial Console.
■ FIGURE 3. XCTU Frames Generator.
packets, so let's do that.
Console can be open at the same time. This allows us to
create a test message, then add it to a list of packets that
can be saved in a file for later use. As you can see, I've
created a set of messages that test the basic node
features. I will include this file in the downloads that are
(node_test.xml) available at the article link.
A Simple XBee Network
For demonstration, we're going to create a very simple
node using the Propeller Activity Board (PAB; Figure 2)
that will let us set or read available digital I/O, read the
analog inputs, and access a local timer that runs in the
node. We will use API frame type 1 (TX to 16-bit address)
to send commands and data between nodes.
In the console log, you can see the transmitted (blue)
and received (red) packets. The message is $70 which I
use for reading the timer in the node. On the Propeller
side of the network, I add debugging information during
development so I can see everything the node sees.
Figure 5 is what the node produced from that message
sent from XCTU.
You'll remember that the packet will contain a single
command/control byte, followed by a four-byte data
packet. The organization of the data bytes allows us to
pass a long, two words, four bytes, or a word and two
bytes. I find this suitable for simple networks.
In the outgoing message (frame type $01), the
address is a single node, or $FFFF for all nodes within the
PAN ID. For my nodes, I add the node ID (0..255) to
$5200. Why? The ASCII value for “R” (remote) is $52. For
the master control node, I set its 16-bit (MY) address to
One of the tools inside XCTU that you'll want to be
comfortable with is the Frames Generator (Figure 3). This
lets us build an API frame that can be sent from XCTU
and copied into our applications. I always start my packet
tests with XCTU.
You can do what makes sense for your project; just
remember that $FFFF is the global address for frame type
On the XCTU side, I really like the Digi XStick1 which
is an XBee module in the form of a thumb drive; you
simply plug it into a USB port and go. Mind you, it doesn't
have a lot of range, but it's great for desktop testing.
Another thing you'll notice is that on the receiving
end, the frame type (byte 3) is changed to $81 (RX from
16-bit address); we use this as part of the verification of a
message received by the node.
Here's the top part of the remote node program (sans
So, how do we do that? Another tool in XCTU is the
Serial Console (Figure 4) which lets us do live testing.
pub main | id, len
What I like is that the Frames Generator and Serial
46 November 2017