Home/Support/Support Forum/Setup XBee Series 1: 1 Coordinator, 2 End Device on Arduino

Setup XBee Series 1: 1 Coordinator, 2 End Device on Arduino

0 votes

I have a problem to setup a Coordinator and 2 End Device attached to Arduino Uno.

Setup in XCTU
CH: E, ID: 3332, DH:111, DL: 111, MY: 111, CE: 1, A2: 4, NI: Master, AP: 1
End Device 1:
CH: E, ID: 3332, DH:222, DL: 222, MY: 222, CE: 0, A1: 4, NI: Sensor1, AP: 1
End Device 2:
CH: E, ID: 3332, DH:333, DL: 333, MY: 333, CE: 0, A1: 4, NI: Sensor2, AP: 1

On the controller, I have the following code:
#include <XBee.h> #include <SoftwareSerial.h> SoftwareSerial mySerial(2, 3); XBee xbee=XBee(); ZBRxResponse zbRx=ZBRxResponse(); void setup () { Serial.begin(9600); delay(1000); mySerial.begin(9600); delay(1000); xbee.begin(mySerial); Serial.println("End Setup"); } void loop () { xbee.readPacket(); if(xbee.getResponse().isAvailable()) { if(xbee.getResponse().getApiId() == ZB_RX_RESPONSE) { xbee.getResponse().getZBRxResponse(zbRx); for(int i=0; i<zbRx.getDataLength(); i++) { Serial.print("payload ["); Serial.print(i, DEC); Serial.print("] is "); Serial.print(zbRx.getData(i)); } } } }

On the End Device, I have the following code:
#include <XBee.h> #include <MicroView.h> uint8_t text[]={'S', 'e', 'n', 's', 'o', 'r', '_', 'X'}; XBee xbee=XBee(); XBeeAddress64 remoteAddress=XBeeAddress64(0x111, 0x111); ZBTxRequest zbTx=ZBTxRequest(remoteAddress, text, sizeof(text)); void setup() { Serial.begin(9600); xbee.setSerial(Serial); } void loop() { xbee.send(zbTx); delay(5000); }

Is this right?

I see the transmit LED blinking every 5sec on both End Device and nothing on the Coordinator. Also, I don't see any traffic in the Console of XCTU and in the Network Working mode, the End Device appears with a ? in stead of E.

Any help is welcome!
asked Sep 21, 2015 in IEEE 802.15.4 by Renaud New to the Community (0 points)
edited Sep 21, 2015 by Renaud

Please log in or register to answer this question.

1 Answer

0 votes
Your addressing is incorrect. For using 16 bit addressing, you only set the DL to equal the MY of the remote. DH would be 0.

If you are going to use API mode and issue API frames, you need to make sure that you issue the proper API frame and match the address field it wants. If you are doing remote AT commands (0x17), then you need to use the SL and Sh of the remote module as the source address.
answered Sep 21, 2015 by mvut Veteran of the Digi Community (13,077 points)
This is a Code problem now.  At this point, you are going to need to talk to someone who understand the Arduino and the Code you are using to address this.
Thanks for your help, XBee is a great product!
Hi i have also one issue similar like that ,
actually i want to communicate in same way but at the end device side i dont have controller where as at cordinator side i have controller.
i need to program such way that at reciver side both the end device send data packet to co ordinator.

can anyone provide me the solution or some code for which i can do that..i am using Xbee series2 module???

i want to write program which recieves data from both ebd device and store in the varibales at co ordinator side,,just have a look and tell???
That is something you need to write your self or hire someone to write for you.

As for the configuration of the XBee's, just use their default configuration and you will be fine.
Hello! Did you solve your issue?