difficulties setting output of remote unit


New to Xbee’s/Zigbee’s.
Using XBee S2 units.
Having difficulties receiving messages from coordinator to remote.
Coordinator configured as Coordinator -API, and remote is configured Router-AT
Communication from router to coordinator is working fine.
But the router does not seem to receive messages from coordinator.

Here is the code snippet inteded to Set P1 (D11 on pin 7) low.
(P1 is configured sd a digital output as default high (5)

Serial1.print(0x73, HEX); //Start byte
Serial1.print(0x0, HEX); //Hi byte of number of bytes transmitted from length defintion to checksum
Serial1.print(0x10, HEX); //Lo byte of number of bytes transmitted from
Serial1.print(0x17, HEX); //Packet tyoe - in this case AT command to remote
Serial1.print(0x0, HEX); //Frame ID set to 0 for no reply / acknowledge
Serial1.print(0x0, HEX); //ID of receipient 8 bytes or 0xFFFF for broadcast
Serial1.print(0x13, HEX);
Serial1.print(0xA2, HEX);
Serial1.print(0x00, HEX);
Serial1.print(0x40, HEX);
Serial1.print(0x8C, HEX);
Serial1.print(0x53, HEX);
Serial1.print(0x27, HEX); //End of ID of recipient
Serial1.print(0xFF, HEX); //Hi byte of 16 bit nework address or 0xFFFE Serial1.print(0xFE, HEX); //Lo byte of network address
Serial1.print(0x02, HEX); //Option to apply changes immediately in remote
Serial1.print(‘P’, HEX); //reflects AT command ATP1 where PI is D11, pin 7 on remote
Serial1.print(‘1’, HEX);
Serial1.print(bDigOut, HEX); // remote data output value - bDigOut value alternates between 0x4 and 0x5 every 5 sconds
//Checksumis 0xFF-all bytes from end of length deifition
lSum= 0x17 + 0x0
+0x0 + 0x13 + 0xA2 + 0x0 + 0x40 + 0x8C + 0x53 + 0x27
+ 0x20 + 0x01
+ 0x02
+‘P’+‘1’+ bDigOut;
iChkSum=0xFF-(lSum & 0xFF);
Serial1.print(iChkSum, HEX);

P1 (D11) status does not change at all.

Additionally for debugging, is there an API example that will output through serial port the data sent from a coordinator to a remote.

A quick reply will be greatly appreciated.

(Technically, this is on the wrong forum - the 802.15.4 Xbee don’t support P1 as a digital output. The ZigBee/S2 do.)

Whenever doing serial you should try to build the message first, then send in 1 call. The above method risks delays between bytes causing the message to be discarded.

Also, the XBee has no ability to ‘pull an output high’. So 0x04 really means pull-to-ground, and 0x05 means let float. You will need some form of pull-up on D011 or it may always seem low. The PR command can be used to add a weak internal pull-up.

Or if you wish to power an LED, then you’d use reverse logic. Connect the LED to 3.3vdc power with the appropriate step-down resister linked to DO11/P1. Then 0x04 (low) turns the LED on by drawing power when the output is shunted to ground, and 0x05 (high) turns the LED off because no power is drawn.