HELP WITH XBEE

I have a problem, I'm testing the library API and I can not make the modules communicate. The two modules are in AP = 2. Can anyone explain why nothing happens rx?

Tx

#include <XBee.h>

XBee xbee = XBee();

uint8_t payload[] = { 'H', 'i' };

XBeeAddress64 addr64 = XBeeAddress64(0x00000000, 0x00000000);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();

void setup() {
Serial.begin(9600);
xbee.begin(9600);
}

void loop()
{

xbee.send(zbTx);

delay(1000);
}

Rx

#include <XBee.h>
XBee xbee = XBee();
XBeeResponse response = XBeeResponse();
// create reusable response objects for responses we expect to handle
Rx16Response rx16 = Rx16Response();
Rx64Response rx64 = Rx64Response();
uint8_t option = 0;
uint8_t data = 0;
void setup() {
// start serial
Serial.begin(9600);
xbee.begin(9600);

}

// continuously reads packets, looking for RX16 or RX64
void loop() {
xbee.readPacket();
if (xbee.getResponse().isAvailable()) {
// got something
if (xbee.getResponse().getApiId() == RX_16_RESPONSE ||
xbee.getResponse().getApiId() == RX_64_RESPONSE) {
// got a rx packet
if (xbee.getResponse().getApiId() == RX_16_RESPONSE) {
xbee.getResponse().getRx16Response(rx16);
option = rx16.getOption();
data = rx16.getData(0);
for (int i=0; i< rx16.getDataLength(); i++)
{
Serial.print(rx16.getData(i), BYTE);
}
}
else {
xbee.getResponse().getRx64Response(rx64);
option = rx64.getOption();
data = rx64.getData(0);
for (int i=0; i< rx64.getDataLength(); i++)
{
Serial.print(rx64.getData(i), BYTE);
} }}}}

I have a problem, I'm testing the library API and I can not make the modules communicate.

Have you looked at Digi.com? Have you counted the number of XBee variations that they sell?

XBeeAddress64 addr64 = XBeeAddress64(0x00000000, 0x00000000);

This would be the address of the XBee that you want to talk to. Did you assign that address to an XBee?

                } }}}}

I can't even begin to read code that looks like this. Each { and each } goes on a separate line. The compiler doesn't care, but I do.

How did you configure the XBees? How are they connected to the Arduino? Which XBees are you using?

PaulS, I do not understand what you meant in the first question.
In AT mode everything is working perfectly.
I used XBeeAddress64 addr64 XBeeAddress64 = (0x00000000, 0x00000000) to send a broadcast, even putting the recipient's address is not working.

I'm using Pro 2.4 and DigiMesh Modules are all with the same ID and API set mode = 2, are connected to arduino uno

If the XBee.h library is from GitHub - andrewrapp/xbee-arduino: Arduino library for communicating with XBee radios in API mode, it's not immediately clear to me whether it supports the DigiMesh 2.4 modules. It's worked very well for me with the S2 XBee ZB low power ZigBee modules. Here's a post on my blog that might help, maybe compare the code: Adventures in Arduinoland: A "Minimal" Arduino/XBee/Pachube Sensor Network