can't find Couldn't find the remote XBee device with 'REMOTE' Node Identifier.


I’m using netbeans and compiled this code ;
public class XbeeTest2 {

    private static final String PORT = "COM4";
// TODO Replace with the baud rate of your sender module.
private static final int BAUD_RATE = 9600;

private static final String DATA_TO_SEND = "Hello XBee!";
private static final String REMOTE_NODE_IDENTIFIER = "REMOTE";
 * @param args the command line arguments
public static void main(String[] args) {
            System.out.println(" +--------------------------------------+");
	System.out.println(" |  XBee Java Library Send Data Sample  |");
	System.out.println(" +--------------------------------------+


	XBeeDevice myDevice = new XBeeDevice(PORT, BAUD_RATE);
	byte[] dataToSend = DATA_TO_SEND.getBytes();
	try {;
		// Obtain the remote XBee device from the XBee network.
		XBeeNetwork xbeeNetwork = myDevice.getNetwork();
		RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
		if (remoteDevice == null) {
			System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
		System.out.format("Sending data to %s >> %s | %s... ", remoteDevice.get64BitAddress(), 
				new String(dataToSend));
		myDevice.sendData(remoteDevice, dataToSend);
	} catch (XBeeException e) {
	} finally {


however this is what I get

| XBee Java Library Send Data Sample |

WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Couldn’t find the remote XBee device with ‘REMOTE’ Node Identifier.


the Xbee works fine with the Xctu


I am not fully sure but I think that the Java Lib uses the radios in API mode. you may want to check the document for the Java lib to verify this.

thanks for your answer, I’ve modifyed the API mode

I would strongly recommend reading over

I think you may find that you need to use the ND command to discover the network.