Home  >  Support  >  Support Forum  >  XBee S1 communication issue

XBee S1 communication issue

0 votes
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:
Code:
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:
Code:
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/ And I see TX LED flashing every second.

Receiver configuration is this:
Code:
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:
Code:
Serial terminal(USBTX, USBRX); while(1) { terminal.puts("Reading packet...\r\n"); xbee.readPacketUntilAvailable(); terminal.puts("Packet available\r\n"); 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("\r\n"); 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("\r\n"); } } wait(1); }

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

And the output of a console is:
Code:
Reading packet...
for all times. And RX LED is not flashing on receiver.
asked Jan 1 in IEEE 802.15.4 by vatulya New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
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.
answered May 12 by mvut Veteran of the Digi Community (2,147 points)
Contact a Digi expert and get started today! CONTACT US
...