I’ve got a setup where I’m using the GBee library to try to receive data from an external XBEE.
Source Module - Series 1 XBee stand alone set to transmit data every second to destination module.
Destination Module 2 - Series 1 XBee in Gadgeteer module on Cerbuino board.
I know that the modules are working correctly because I can connect the destination module to an XBee explorer and :
- I can monitor the destination XBee with X-CTU and see the data coming in.
- in another configuration I’ve got the destination XBee plugged into a USB explorer and packets are being received via com.rapplogic.xbee.api.XBee on my PC
But when the destination is connected to the Cerbuino I get no callbacks to the OnDataReceived listener.
Note that the destination is discovering the source XBee and does detect status events such as hardware reset
Output of Destination Module
Program Started
XBee : Info ApiMode: EnabledWithEscaped, HardwareVersion: Series 1, Firmware: 8062, SerialNumber: 0013A20040939A95, NodeIdentifier: ’ ’
Node discovered: S/N=0013A20040939AAE, address=FFFE, id=‘’
xbee = new XBee(1) { DebugPrintEnabled = true };
xbee.Configure();
xbee.Api.DiscoverNodes(OnNodeDiscovered);
xbee.Api.DataReceived += OnDataReceived;
xbee.Api.StatusChanged += OnStatusChanged;
private static void OnDataReceived(XBeeApi receiver, byte[] data, XBeeAddress sender)
{
var dataStr = new string(Encoding.UTF8.GetChars(data));
Debug.Print("Received: " + dataStr);
}
private static void OnNodeDiscovered(DiscoverResult node)
{
Debug.Print("Node discovered: " + node.NodeInfo);
}
private static void OnStatusChanged(XBeeApi sender, ModemStatus status)
{
switch (status)
{
case ModemStatus.HardwareReset:
Debug.Print(sender.Config.SerialNumber + " Hardware reset");
break;
case ModemStatus.WatchdogTimerReset:
Debug.Print(sender.Config.SerialNumber + " Software reset");
break;
case ModemStatus.Associated:
Debug.Print(sender.Config.SerialNumber + " Associated");
break;
case ModemStatus.Disassociated:
Debug.Print(sender.Config.SerialNumber + " Not associated");
break;
default:
Debug.Print(sender.Config.SerialNumber + " Status " + status);
break;
}
}
}