Home/Support/Support Forum/XCTU problem with code

XCTU problem with code

0 votes
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?
Code:
/***************************************************************** 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 <SoftwareSerial.h> // 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()); } }
asked Dec 9, 2015 in ZigBee PRO Featureset (and legacy ZNet 2.5) by xd_avid New to the Community (2 points)

Please log in or register to answer this question.

2 Answers

0 votes
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?
answered Dec 10, 2015 by mvut Veteran of the Digi Community (11,965 points)
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
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?
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.

[code]#include <SoftwareSerial.h>
// 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());
  }
}[/code]
0 votes
I too have almost same problem.
i am able to send data from arduino but reverse not happening. any solution?
answered Mar 11, 2016 by manju New to the Community (5 points)
...