I am trying to connect Serializer board with Xbee.
A simple Temperature Sensor board.
static Serializer serializer; static AmbientTemperatureSensor tempSensor;; static void Main(string[] args) { serializer = new Serializer(); serializer.PortName = "COM55"; tempSensor = new AmbientTemperatureSensor(serializer); tempSensor.Pin = AnalogPinId.Pin0; tempSensor.TemperatureChangedThreshold = 1; tempSensor.UpdateFrequency = 50; tempSensor.TemperatureChanged += new SerializerComponentEventHandler(tempSensor_TemperatureChanged); serializer.StartCommunication(); while (true) { serializer.PumpEvents(); } serializer.StopCommunication(); } static void tempSensor_TemperatureChanged(SerializerComponent sender) { Console.WriteLine("Temp: {0}", tempSensor.Temperature); }[In fact lots of errors in code for MSDN style documents]
I would able to trasmit data through Serializer, since when ever I say "serializer.PumpEvents(); " light in Xbee pro Doungle green LED keep blinks.
but the "tempSensor_TemperatureChanged" event never fires.
I think Xbee pro Usb doungle and Xbee Pro on Serilazer not able to communicat.
http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1162331669
And this is the msg am reciving when i connect Xbee pro USB doungle with X-CTU software.
"Communication with modem..OKModem type=Name unknown (ID = 42949672481223980)Modem firmware version ="
If anyone working or had same experiance please let me know
Please let me know how to make it work!
Thanks,
Tharanath Umesh.
Umesh,
Your application looks correct (except tempSensor has two semil-colons).
I would debug the XBee connection via Hyperterm. Once you know it works, then you can move to using the .NET lib.
If the XBee connection is working, then you should be able to send any/all commands to Serializer and it work properly.
How are you changing the temperature of the sensor? A HairDryer? Your fingers? My guess is that the event isn't firing because you're not communicating correctly w/ the Serializer.
Make sure both Xbee modules are set to the correct baud rate (same as the serializer). The default on the Xbee is 9600, the default on the serializer is 19200.
Once everything is set the same, figure out which com port the PC xbee is and open that in hyperterm. When the 2 Xbees connect, the RSSI led on the serializer will light up. the brighter it is the better the connection. The RSSI led is near the reset switch, you my have never noticed it. It only lights up when an Xbee is connected.
Once you are connected, try somehting simple in Hyperterm like "fw".
It should return something like 1.4.1
Once that is working, then work on your app.
Ringo