Xbee tutorials

Please help me,
I follow the tutorials,but it does not work.
The panda can’t receive anything.

#1 for receiving use panda

using System;
using System.Threading;
using System.Text;
using System.IO.Ports;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;

namespace DominoXbee
{
    public class Program
    {
        public static int read_count = 0;
        public static byte[] rx_data = new byte[10];
        public static byte[] tx_data;
        public static SerialPort UART = null;
        public static void Main()
        {
            UART = new SerialPort("COM1", 115200);
            UART.Open();
            UART.DataReceived += new SerialDataReceivedEventHandler(UART_DataReceived);

            Thread.Sleep(Timeout.Infinite);
        }

        private static void UART_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            // read the data
            read_count = UART.Read(rx_data, 0, rx_data.Length);
            if (read_count != 6)
            {
                // we sent 6 so we should have 6 back
                Debug.Print("Wrong size: " + read_count.ToString());
            }
            else
            {
                Debug.Print("Perfect data!");
                String receivedDataAsString = new String(Encoding.UTF8.GetChars(rx_data));
                Debug.Print(receivedDataAsString);
            }
            Thread.Sleep(100);
        }
    }
}

#2 for sending use chipworkx

using System;
using System.Threading;
using System.Text;
using System.IO.Ports;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;

namespace CobraXbee
{
    public class Program
    {
        public static SerialPort UART = null;
        public static byte[] tx_data;

        public static void Main()
        {
            UART = new SerialPort("COM2", 115200);
            UART.Open();
            tx_data = Encoding.UTF8.GetBytes("Foekie");

            while (true)
            {
                // flush all data
                UART.Flush();
                Debug.Print("Writing data");
                // send some data
                UART.Write(tx_data, 0, tx_data.Length);
                // wait to make sure data is transmitted
                Thread.Sleep(1000);
            }
        }

    }
}

Did you connect a wire from chipworkx to Xbee TX (com out) to panda com in?

Dear Robert:
The chipworkx has Xbee connector, so do not need wire.
And the Panda, yes, com1 in to Tx and com1 out to Rx.
I was trying two days, I don’t know what’s wrong, it make me dispirited.
Setting for Xbee:
#1
CH= F
Pan ID=3335
DH=0
DL=1
MY=0
BD=115200
#2
CH= F
Pan ID=3335
DH=0
DL=0
MY=1
BD=115200

anything else need to set ?

Thanks

I’m not an XBee expert but my advise would be to reset both XBee’s so you get them back to factory setting first.
You probably have an XBee explorer or something so you can connect one to your PC then via a terminal program change the ATID for one of them, let the other remain in default factory settings.
[url]http://www.arduino.cc/en/Guide/ArduinoXbeeShield[/url]

Then make a small program on the FEZ to just print characters to the com port and see if anything comes up in the terminalemulator window.

When you get it up and working you can start changing settings.

Did you set the xbees to talk to eachother?
As in: configured them like on the xbee page on the project website?

Tzu Hsuan:

What is the XBee model your are using, is it XBee pro?

if you are using XBee 900 Pro. Read this thread

[url]http://www.tinyclr.com/forum/4/1144/[/url]

I also noticed that you are using Cobra NETMF template, instead of ChipworkX Application?
Will it make any different if you build the app. using the ChipworkX Application template?

Robert… Is there anything fot the new xbee pro series 2 These dont come with any firmware installed and you HAVE to use hardware flow control to configure them

Cheers Ian

Could you provide a link to an article which explains this in detail? As far as I know, XCTU downloads the firmware automatically?

There was no article… I had to speak to a guy called Martin from Digi germany to get the firmware updated… I had an Xbee serial board hooked up to my PC. My pC was running X-CTU ( Latest version)… No dice, X-CTU see’s it as a XBP-24-B and it’s a XBP-24-ZB (programable)…

I’ve managed to get XBP-24-ZB coordinator AT and XBP-24-ZB router AT firmware on the devices and now they run ok ( I only need transparent mode anyway ) Martin said this would be fine… “Dropin networking” they advertise this as…

They are good though when up an running

Cheers Ian

Thank you all:

My Xbee is working now.