I have a couple of XBeePRO modules. The X-CTU software checked online and updated their firmwares to 10CD. (I can see that there’s now a 10E6 version, and some people say I need to downgrade firmware first to use it, but I’ll leave 10CD for the time being unless there’s some known problem with it).
I have the following setup:
PC – USB Cable – XBIB-U-DEV – XBeePro (slotted into the socket provided)
PC – USB Cable – DeviceSolutions TahoeII Development Board – XBeePro (slotted into the socket, as per the XBIB-U-DEV board)
I first used the X-CTU software, with both the RS232 and USB boards connected to my computer, to do the range test. That worked fine (as per the quick start guide that shipped with the development kit).
I then connected one of the XBee modules to the TahoeII development board and found some simple C# code to run on the device (which is at the bottom of this post).
When I run the TahoeII application on the device, and then run the range test in the X-CTU software I can see that the TahoeII is receiving the test data through XBee module. Wahay!
(why it’s receiving 7 characters at a time I’m not sure, but I’ll figure that one out later)
My problem is that the X-CTU software doesn’t say “Timeout waiting for data” anymore, but rather can see the same test data that it sent out. The code below only prints the data received into a debug window - there’s nothing there to tell it to reply/send the data back.
So is the XBee still in some test mode, or will it always automatically responde to X-CTU range tests, or am I miles off the mark?
public static SerialPort sp;
public static void Main()
{
sp = new SerialPort("com2", 9600, Parity.None, 8, StopBits.One);
sp.Open();
sp.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived);
for (int i = 0; i < 1000; i++) { Thread.Sleep(1000); }
sp.Close();
}
static void sp_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
byte[] readbuff = new byte[sp.BytesToRead];
sp.Read(readbuff, 0, readbuff.Length);
sp.Write(readbuff, 0, readbuff.Length);
Debug.Print(DateTime.Now.ToString() + " " + new string(Encoding.UTF8.GetChars(readbuff)));
}