softwareserial problem in xbee library

#include <XBee.h>
#include <SoftwareSerial.h>

// Define NewSoftSerial TX/RX pins
#define ssRX 2
#define ssTX 3
SoftwareSerial nss(ssRX, ssTX);

//Create an XBee object
XBee xbee = XBee();

//Define the Destination address of the packets
XBeeAddress64 destaddress = XBeeAddress64(0x0013A200, 0x40C7A5D8);

char Hello[] = "Hello World\n";

void setup()

  //xbee.setSerial(nss); //error!!

  Serial.println("Goodnight moon!");

void loop()
  Serial.println("in the loop");
  ZBTxRequest zbtx = ZBTxRequest(destaddress, (uint8_t *)Hello, strlen(Hello));

I could communicate the software serial port with the xbee library. The xBee’s are in ap1 mode. serial monitor is meaningless flow of data. I could not find the reason.

can you help me please?

Don’t attach screen shots. Embed the receiver code in your post like you did for the transmitter.

To show us the output, simply select the text in the Serial Monitor window and paste it into a code block in your post.

SoftwareSerial is very inefficient, because it disables interrupts for loooong periods of time. This will interfere with other parts of your sketch or with other libraries. Although this page is written for connecting a GPS device, it applies to any serial device, like the XBee.

If you can use different pins besides 2 & 3, try the other alternatives.

If you can’t use different pins (are you sure?), NeoSWSerial is the best alternative.

All the alternatives are available from the Arduino IDE Library Manager, under the menu Sketch → Include Library → Manage Libraries.