Home/Support/Support Forum/Unable to Read Xbee API with Serial Arduino Mega 2560

Unable to Read Xbee API with Serial Arduino Mega 2560

0 votes
Hi,

I have a problem with reading API frame by using serial port with firstly activating on XCTU

1.XB S3B : API MODE : coordinator
2.Parallax mini USB xbee adapter

Info of Xbee adapter

I connect DIN(xbee) to Rx(Mega) and DOUT(xbee) to Tx (Mega) with Voltage divider

by Xbee is connected to serial2 of Mega and the serial0 of mega is connected to USB port (Labtop )

below is the code and it works perfectly
__________________________________________________________________________


int value = 0;
// the setup routine runs once when you press reset:
void setup()
{
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
Serial2.begin(9600);
}

// the loop routine runs over and over again forever:
void loop()
{
if(Serial2.available()>25)
//> 25 byte = is equal to 26 byte (22 byte standard + 4 byte for 2ADC ( 2 byte /1 ADC)
{
for (int i=0;i<26;i++) /
/<26 byte means that equal to 26 byte (0 to 25)
{
Serial.print(Serial2.read(),HEX);
Serial.print(",");
//value = Serial2.read();


}
Serial.println();

}

}

__________________________________________________________________________

but the problem is that
I can see the API frame when I connect Xbee module with XCTU.
I can read API frame as in XCTU as the same as in Arduino Serial monitoring.
This is because I directly connect DIN and DOUT PIN to serial2 Mega.

After that I closed the XCTU " without RESET XBEE ",
the serial monitoring can still read API frame.

but when i disconnect Xbee from XCTU and " press RESET on xbee " or
"re-energize power supply "
There is nothing out from DIN and DOUT of Xbee


What should I do if I want to read API frame by Serial Mega2560 only and "without using XCTU" ?
Which pins that to have to activate by 3.3V ot 0V ?

https://drive.google.com/open?id=0B7ju_domgVlVRGx3RFJsN2hIMjQ
https://drive.google.com/open?id=0B7ju_domgVlVVHdTZGliMHBCTW8

thanks for comments
asked Oct 9, 2017 in XBee Programmable Development by rakkykung New to the Community (3 points)

Please log in or register to answer this question.

1 Answer

0 votes
Try disconnecting the DTR and RTS lines from your processor.
answered Oct 9, 2017 by mvut Veteran of the Digi Community (11,302 points)
...