# XCTU problem with code

**URL:** <https://forums.digi.com/t/xctu-problem-with-code/15919>\
**Category:** XBee - Zigbee\
**Tags:** programming, xbee2, xctu, xbee\
**Created:** [December 9, 2015, 4:27pm UTC](https://forums.digi.com/t/xctu-problem-with-code/15919 "2015-12-09T16:27:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xd\_avid](https://avatars.discourse-cdn.com/v4/letter/x/ee59a6/32.png) [@xd\_avid](https://forums.digi.com/u/xd_avid)\
**Post date:** [December 9, 2015, 4:27pm UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/1 "2015-12-09T16:27:39Z")

</div>

Hi, I use this code and XCTU shows the action required message and I cant connect my xbee to xctu, I need set the blink program for connect the arduino to XCTU. How can i read the codes sended from my Raspberry?

```auto
/ *****************************************************************
XBee_Serial_Passthrough.ino

Set up a software serial port to pass data between an XBee Shield
and the serial monitor.

Hardware Hookup:
  The XBee Shield makes all of the connections you'll need
  between Arduino and XBee. If you have the shield make
  sure the SWITCH IS IN THE "DLINE" POSITION. That will connect
  the XBee's DOUT and DIN pins to Arduino pins 2 and 3.

***************************************************************** /
// We'll use SoftwareSerial to communicate with the XBee:
#include 
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX

void setup()
{
  // Set up both ports at 9600 baud. This value is most important
  // for the XBee. Make sure the baud rate matches the config
  // setting of your XBee.
  XBee.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    XBee.write(Serial.read());
  }
  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
  }
}

```

---

<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:** [December 10, 2015, 7:46am UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/2 "2015-12-10T07:46:27Z")

</div>

What is the Full part number of the XBee module you are working with?

Are you aware that in order for XCTU to read or write firmware, sometimes the DTR and RTS lines are also required?

---

<div class="post-metadata">

**Author:** ![xd\_avid](https://avatars.discourse-cdn.com/v4/letter/x/ee59a6/32.png) [@xd\_avid](https://forums.digi.com/u/xd_avid)\
**Post date:** [December 10, 2015, 2:23pm UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/3 "2015-12-10T14:23:04Z")

</div>

I’m using XBee 2 (XB24-ZB).

I use this configuration:  
Raspberry pi  
PANID 3001  
DH 13A200   
DL 40E7CEEE   
SH 13A200   
SL 40E922EC   
BD 57600 [6]   
ZigBee Coordinator AT

```
Arduino

```

PANID 3001  
DH 13A200   
DL 409026BB  
SH 13A200   
SL 40E7CEEE  
BD 57600 [6]   
ZigBee Router AT

---

<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:** [December 10, 2015, 3:20pm UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/4 "2015-12-10T15:20:16Z")

</div>

XCTU is by default trying to communicate with the radios at 9600 baud. Are you telling XCTU to look for the radios at the 57600bps rate? If you connect the XBee module via a USB level shifting board, are you able to talk to the radio?

---

<div class="post-metadata">

**Author:** ![xd\_avid](https://avatars.discourse-cdn.com/v4/letter/x/ee59a6/32.png) [@xd\_avid](https://forums.digi.com/u/xd_avid)\
**Post date:** [December 12, 2015, 12:27pm UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/5 "2015-12-12T12:27:57Z")

</div>

This was old code, i change the baud to 57600 and configure the serial monitor to scan in 57600 baud but nothing.

I use blink code, then I go to Tools -\> Serial Monitor. Now if i send a message from Raspberry to Arduino i can see this message on Serial Monitor.  
If i use the code of bottom, when i go to Tools -\> Serial Monitor and i send a message from Raspberry to Arduino i can’t see nothing on Serial Monitor.  
Please, can you provide me a code for xbee for turn on/off a led? Maybe i learn more if i can see a code more explicit.

```auto
#include 
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX

void setup()
{
// Set up both ports at 9600 baud. This value is most important
// for the XBee. Make sure the baud rate matches the config
// setting of your XBee.
  XBee.begin(57600);
  Serial.begin(57600);

}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee  
    XBee.write(Serial.read());
    Serial.println(Serial.read());
  }

  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
    Serial.println(Serial.read());
  }
}

```

---

<div class="post-metadata">

**Author:** ![manju](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@manju](https://forums.digi.com/u/manju)\
**Post date:** [March 11, 2016, 12:24am UTC](https://forums.digi.com/t/xctu-problem-with-code/15919/6 "2016-03-11T00:24:18Z")

</div>

I too have almost same problem.  
i am able to send data from arduino but reverse not happening. any solution?
