Search code examples
serial-portarduinoxbee

Receive XBee signals on Arduino


Side A:

  • Arduino Uno R3 with Wireless Proto shield powered with USB
  • With XBee Pro S1, DH 0 DL FFFF MY 0 API 0
  • Wireless Proto shield has the serial select switch on the 'micro' position

side B:

  • XBee Explorer USB connected to a PC with XCTU software
  • With XBee Pro S1, DH 0 DL FFFF MY 0 API 0

(When I put both XBee modules in the USB explorer boards, connected with two PC's, I can send data back and forth without any problems, so I reckon the XBee settings are good.)

The Problem

Now I want the Arduino to capture the input from the B side (send with the XCTU terminal), but when I type anything in the terminal, the RSSI LED on side A just turns on for 5 seconds, but the Arduino does not seem to capture any data since it does not send data back like it should (Serial.print("I received: ");

Arduino sketch:

int incomingByte = 0;

void setup() {
    Serial.begin(19200);  //Both XBee chips are configured at 19200 Baud
    Serial.print("start echo machine");  //This is received just fine on the B side
}


void loop() {
    if (Serial.available() > 0) {
        // Read the incoming byte:
        incomingByte = Serial.read();

        // Say what you got:
        Serial.print("I received: ");  //This never shows on the B-side
        Serial.println(incomingByte, DEC);
    }
}

How do I fix this problem?


Solution

  • Many of the boards require the pull-up resistor on DIN to be enabled. According to some sources this pull-up is enabled by default on the Digi Xbee module.

    To ensure it is enabled or to enable it:

    Put your Xbee module in a USB explorer and use X-CTU to check the PR configuration. DIN is on bit 7 for the Xbee Pro S1, so in that case you need the last bit to be 1.

    I put it like this: 00000001

    Than you convert it to hex (01 in my case) and write that value to the Xbee module with X-CTU.

    So it is an electronics issue and not a programming issue.