i bought two xbees , with a 3.5 to 5.0 regulated explorer for my microcontroller board and a rs232 explorer board.
XBees: My link
Uc explorer: My link
rs232 for PC: http://www.rhydolabz...products_id=482
I connected both of them and tried to send the data from my microcontroller to pc. The DOUT pin's corresponding led blinks at transmission but the pc is not receiving ant data.
I used the X-CTU software and did the configuration as guided on this blog:
My link
Please help me out with this.
I am using the c# language for developing the both microcontroller and the pc apps. Using same apps when i connected both of them through the rs232 port of my pc using the rs232<->ttl converter and the data is transmitting easily than why is there the problem with the xbees also ????
Any help ???
i wrote following code:
Netduino Code:
using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; using System.IO.Ports; using System.Text; using System.Threading; namespace DataSender { public class Program { public static SerialPort s; public static string message = "Hello World"; public static byte[] bytes = Encoding.UTF8.GetBytes(message); public static void Main() { // write your code here s = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One); s.Open(); while (true) { s.Write(bytes, 0, bytes.Length); Thread.Sleep(3000); } } } } [code] PC code: [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.Threading; namespace COMReceive { public partial class Form1 : Form { private delegate void SetTextDeleg(string text); static SerialPort s; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { s = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One); s.Handshake = Handshake.None; s.Open(); textBox1.Text = "Port Opened "; s.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived); } void sp_DataReceived(object sender, SerialDataReceivedEventArgs e) { Thread.Sleep(500); string data = s.ReadExisting().ToString(); this.BeginInvoke(new SetTextDeleg(si_DataReceived), new object[] { data }); } private void si_DataReceived(string data) { textBox1.Text += data.Trim(); } } }