From charlesreid1

Arduino Zigbee Shield

The next step was figuring out how to interface with a Zigbee using an Arduino. Fortunately, there are a couple of handy sketches here: https://learn.sparkfun.com/tutorials/xbee-shield-hookup-guide

One of these is a "chat" program, that just sends/receives messages. The other sends/receives data to read/write voltage values to pins on the board.

Sending Messages with an Arduino Zigbee Shield

Beacon Program

The first step is to set up a Zigbee to act as a beacon, sending out messages periodically. We can then use the Zigbee connected directly to the computer to monitor the airwaves for received messages.

/*****************************************************************
XBee_Beacon.ino

Hardware: 
  Load the sketch onto the arduino.
  Connect the zigbee shield.
  Turn on the arduino.

*****************************************************************/

void setup()
{
  // Set up both ports at 9600 baud. This value is most important
  // for the XBee. Make sure the baud rate matches the config
  // setting of your XBee.
  XBee.begin(9600);
}

void loop()
{
  XBee.write("HELLO WORLD");
  delay(1000);
}

See https://learn.sparkfun.com/tutorials/xbee-shield-hookup-guide

Problems

I connected the computer to the Zigbee, which was seated in the Zigbee shield, which was attached to the Arduino Leonardo board, which was connected to the computer via a micro USB cable.

The first problem I experienced was due to the Arduino drawing a large amount of power. When the Arduino Leonardo was connected via USB to the computer (which was providing power), and the Arduino was running the beacon program (to transmit, then sleep), and the computer was on battery, the computer would randomly shut off completely and suddenly - and a "Message of Death" would appear saying the computer needed to reboot. The computer behaved okay once it rebooted, but it was worrisome.

It was a sign the board was trying to draw more power than was available to it, and was sucking power away from the motherboard.

The second problem was with the communication between the XCTU program and the Zigbee attached to the Arduino board. I had not carefully checked the settings of the Zigbee radio before mounting it onto the Arduino Leonardo, so before proceeding I decided to do that.

More Headings Go Here

(basics of transmitting messages)

(basics of receiving messages)

(transmitting and receiving between two zigbee devices)

(that's where the project picks up)

Link: https://learn.sparkfun.com/tutorials/exploring-xbees-and-xctu-retired