# XBee S1 communication issue

**URL:** <https://forums.digi.com/t/xbee-s1-communication-issue/12339>\
**Category:** XBee - 802.15.4\
**Tags:** s1, xbee\
**Created:** [January 1, 2014, 11:30pm UTC](https://forums.digi.com/t/xbee-s1-communication-issue/12339 "2014-01-01T23:30:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vatulya](https://avatars.discourse-cdn.com/v4/letter/v/4af34b/32.png) [@vatulya](https://forums.digi.com/u/vatulya)\
**Post date:** [January 1, 2014, 11:30pm UTC](https://forums.digi.com/t/xbee-s1-communication-issue/12339/1 "2014-01-01T23:30:08Z")

</div>

I have 2 XBee S1 modules configured in API mode 1. XBee module 1 is a transmitter of a signal and XBee module 2 is a receiver of a signal. And the issue is that receiver does not receives anything from transmitter (or so it seems).

Transmitter configuration is this:

```auto

AP 1
MY 1
ID 1984
DL 2
CH C

```

Everything else is left by default. Transmitter is attached to XBee Explorer. XBee Explorer is connected to PC via USB.

Following piece of code sends signal each 1 second:

```auto

public class Main {

    private Main() {
        XBee xbee = new XBee();
        try {
            xbee.open("/dev/ttyUSB0", 9600);
            final XBeeRequest request = new TxRequest16(new XBeeAddress16(0, 2), new int[] { 1 });

            //noinspection InfiniteLoopStatement
            while (true) {
                xbee.sendSynchronous(request);
                Thread.sleep(1000);
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            xbee.close();
        }
    }

    public static void main(String[] args) {
        new Main();
    }
}

```

Java XBee API library was used: [https://code.google.com/p/xbee-api/](https://code.google.com/p/xbee-api/) And I see TX LED flashing every second.

Receiver configuration is this:

```auto

AP 1
MY 2
ID 1984
DL 1
CH C

```

Everything else is left by default. Receiver is attached to the breadboard via XBee Explorer. Continuity test shows that current flows fine between XBee RX and mbed P27, as well as between XBee TX and mbed P28.

And following code on an mbed (LPC1768) runs to receive packets:

```auto

Serial terminal(USBTX, USBRX);

while(1) {
    terminal.puts("Reading packet...
");
    xbee.readPacketUntilAvailable();
    terminal.puts("Packet available
");

    XBeeResponse response = xbee.getResponse();
    if (response.isAvailable()) {
        char tmp[20];
        sprintf(tmp, "0x%02X", response.getApiId());
        terminal.puts("Response available at API: ");
        terminal.puts(tmp);
        terminal.puts("
");
        uint8_t api = response.getApiId();
        if (api == RX_16_RESPONSE) {
            Rx16Response rx16 = Rx16Response();
            response.getRx16Response(rx16);
            uint8_t len = rx16.getDataLength();
            char l[20];
            sprintf(l, "%d", len);

            terminal.puts("We have data: ");
            terminal.puts(l);
            terminal.puts("
");
        }
    }
    wait(1);
}

```

Popular Arduino/mbed library for an XBee API mode was used. Sources are located here: [http://mbed.org/users/okini3939/code/XBee/](http://mbed.org/users/okini3939/code/XBee/)

And the output of a console is:

```auto
Reading packet...

```

for all times. And RX LED is not flashing on receiver.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [May 12, 2014, 11:09am UTC](https://forums.digi.com/t/xbee-s1-communication-issue/12339/2 "2014-05-12T11:09:46Z")

</div>

The code you are using states that it requires API mode 2 instead of 1. You will need to change your modules AP command accordingly to work.
