Problem sending Xbee RemoteATCommand using XBee Library

Problem sending remote AT command to Wireless device…

Hello All,

I’m having a problem trying out to test of the remote AT command to configure a remote. All I am trying to do in my example is send a simple configuration to the D4 pin to set it to output high.

  1. So here is my setup…

i. I’m using an Arduino Mega 2560 board. Connected to this board is an Arduino Wirless SD board.
ii. I have installed a Wireless XBee coordinator on this Board and remotely I have a Wireless XBee ZB Router End device. Both are Series 2.
Coordinator address: 0x13a200 0x40710752
Router / End device address: 0x13a200 0x407a2547

The AT Remote command is ATD4 with value 0x5 which in theory should set the output to HIGH and light up the LED I have attached to it.
Problem encountered: The error I’m getting consistently is ‘no response from the remote device’ and also, the command does not work and the LED does not light up.

  1. The Serial Ports

Initially, I configured the XBee to use Serial 3 and setting up the boards to use this port. (I still wanted to use Serial for my terminal IO Debugging, but this didn’t work and therefore I went back to using just Serial on the board.
When running the program I had the Switch in Micro mode and out of desperation I have also used USB mode.

  1. The Program

To trial this out I have taken the remote AT Command example and modified this to send the D4 Command with a value of 5. Here is the setup I use. Yes, in my program I’ve recreated the command line by line to be sure.

// Set DIO0 (pin 20) to Analog Input
uint8_t d4Cmd[] = { 'D', '4' };
uint8_t d4Value[] = { 0x5 };

// SH + SL of your remote radio
XBeeAddress64 remoteAddress = XBeeAddress64(0x0013a200, 0x407a2547);

// Create a remote AT request with the D4 command
RemoteAtCommandRequest remoteAtRequest = RemoteAtCommandRequest(remoteAddress, d4Cmd, d4Value, sizeof(d4Value));

Void loop()
{
// Create a Remote AT response object
RemoteAtCommandResponse remoteAtResponse = RemoteAtCommandResponse();
remoteAtRequest.clearCommandValue();
// now reuse same object for DIO4 command
remoteAtRequest.setCommand(d4Cmd);
remoteAtRequest.setCommandValue(d4Value);
remoteAtRequest.setCommandValueLength(sizeof(d4Value));
remoteAtRequest.setFrameId(0x5);
DisplayFrame();
sendRemoteAtCommand();
while(1) { }
}

This simply returns No response from the ‘Remote Device’

  1. What I have tried..

First of all I had suspicions about the packet I was sending so I’ve worked out the raw packet values here:

7E 00 10 17 05 00 13 A2 00 40 7A 25 47 FF FE 02 44 34 05 8C - Turns DIO 4 On
7E 00 10 17 05 00 13 A2 00 40 7A 25 47 FF FE 02 44 34 04 8D - Turns DIO 4 Off
7E 00 0F 17 05 00 13 A2 00 40 7A 25 47 FF FE 02 57 52 60 - Writes the config

I have then ensured the xbee library is sending out the right values by using a function with displays the frame.

I have also used the XTCU program with the XBEE Explorer and Coordinator to run the above frames and these work perfectly. The LED turns off/on and I’m able to write the config.

I have also used the Arduino Mega and Wireless SD Shield connected directly the computer (with a blank Arduino program) and this also works.

So the only thing I can conclude is that there’s something in the library or the way I'm using the XBEE Wireless shield.

  1. Questions?

i. Has anyone encountered this issue?
ii. Is there a problem with my program?
iii. Is there a problem with this library not working correctly?
iv. Is there a possible issue with the Serial port?
v. Does anyone have the answer to this?

Thanks in advance,

Richard