0

I'm trying to setup a simple wireless link between two Arduinos, using two XBee modules and the XBee shield.

I configure the coordinator with:

ATID 2001
ATDL 4079D623
ATDH 0013A200

and the end device with

ATID 2001
ATDL 4079D621
ATDH 0013A200

I then upload simple code to the two Arduino platforms. On the end device:

#include <SoftwareSerial.h>

SoftwareSerial xbee(2, 3); // RX, TX

void setup() {
    Serial.begin(9600);
    xbee.begin(57600);
}

void loop() {
    xbee.write("A");
    delay(500);
}

and on the coordinator:

#include <SoftwareSerial.h>

SoftwareSerial xbee(2, 3); // RX, TX

void setup() {
    Serial.begin(9600);
    xbee.begin(57600);
}

void loop() {
    Serial.write(xbee.read());
    delay(500);
}

But no data is passing from the end device to the coordinator. Am I missing something obvious?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lbedogni
  • 7,917
  • 8
  • 30
  • 51
  • Please provide some more info. Which Arduino version are you working with? And what version of the Xbee shield? – djf May 25 '13 at 10:27
  • Hi, I'm using an Arduino UNO. I also use the Xbee shield, but where can I find the version number? – lbedogni May 25 '13 at 11:08
  • On the receiver side, what output are you seeing on the serial console? Also, Check out [this thread](http://forum.arduino.cc/index.php/topic,28560.0.html). There seems to be a problem with 57600bps on the SoftwareSerial on the Arduino UNO. Have you tried another speed for the Xbee? – djf May 25 '13 at 11:16
  • I see some weird chars, not the one I'm sending. I tried 9600 too, with the same results. – lbedogni May 25 '13 at 13:46
  • My solution: config with X-CTU: http://translate.googleusercontent.com/translate_c?depth=1&hl=es&ie=UTF8&prev=_t&rurl=translate.google.es&sl=es&tl=en&u=http://www.nishilua.com/alfonso.nishikawa/pfcan/%3Fp%3D136&usg=ALkJrhg9Apk57ng5QJsfmegt5zrZCjqjrw and configuration: http://translate.googleusercontent.com/translate_c?depth=1&hl=es&ie=UTF8&prev=_t&rurl=translate.google.es&sl=es&tl=en&u=http://www.nishilua.com/alfonso.nishikawa/pfcan/%3Fp%3D161&usg=ALkJrhjGkcyz0GruZpo7-G3Umb1Pb66IfA – Alfonso Nishikawa May 28 '13 at 15:23
  • If you see weird chars, try changing xbee.begin(57600) to xbee.begin(9600). Also, try changing Serial.write(xbee.read()) to Serial.print(xbee.read()). – Noah Aug 10 '13 at 13:39

1 Answers1

0

I haven't worked with Zigbees since college, but I think you might have mixed up your addressing modes. There's local addressing and there's global addressing. For local addressing, ATDH should be set to 0. You only have to specify ATID, ATMY, ATDL. When using global addressing, on the other hand, you have to specify ATID, ATDL and ATDH.

See this thread explaining how to connect to XBee modules over at electronics.stackexchange.

Community
  • 1
  • 1
djf
  • 6,592
  • 6
  • 44
  • 62
  • I tried to follow the tutorial, but whenever I try to change the address with ATMY it gives me an error. – lbedogni May 25 '13 at 18:08
  • You can't set ATMY, it's read only. Set ATDH and ATDL of the first XBee to the ATSH and ATSL values of the second XBee and vice versa. As a shortcut, you can set ATDH and ATDL both to 0 on the router to have the radio send to the coordinator. Try setting ATBD to 3 (9600 baud) on both XBee modules, and open that serial port at 9600 baud to see if it works correctly. – tomlogic May 26 '13 at 01:40
  • ATDH is always 0013A200 for xbees I think the issue is in SC-Scan Channel – MAZux Feb 19 '15 at 07:25