I am working with CerbuinoBee and Xbee communication. I have two CerbuinoBees talking to each other when I connect Xbee into socket 2 using Xbee modules. I cannot get the CerbuinoBees to communicate when using the on-board Xbee connections. Everything is on TinyClr V0.7.0.
Thanks for responding. I needed a reality check. I tried the following code:
XBeeAdapter xbee2 = new XBeeAdapter(GHIElectronics.TinyCLR.Pins.STM32F4.UartPort.Usart1);
I tried all the Uarts available, 8 come up on the STM32F4, but this did not work either. I did not have much confidence that using STM32F4 would work but it did not take much time.
I guess Gus and his crew have not gotten to this yet. There are still Xbee Modules available on Mouser so I think I will buy a couple.
This code works on socket2 of the Cerbuino Bee but I didn’t see signals when I used the Xbee port.
using System;
using System.Diagnostics;
using System.Threading;
using GHIElectronics.TinyCLR.Pins;
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Devices.SerialCommunication;
using GHIElectronics.TinyCLR.Storage.Streams;
namespace CerbuinoBeeTiniCLRTest_01
{
class Program
{
static DataWriter serWriter;
//static SerialDevice ser = SerialDevice.FromId(GHIElectronics.TinyCLR.Pins.FEZCerbuinoBee.UartPort.Xbee);
static SerialDevice ser = SerialDevice.FromId(GHIElectronics.TinyCLR.Pins.FEZCerbuinoBee.UartPort.Socket2);
static void Main()
{
ser.BaudRate = 9600;
serWriter = new DataWriter(ser.OutputStream);
while (true)
{
serWriter.WriteString("Hello CLR");
serWriter.Store();
Thread.Sleep(1000);
}
}
}
The XBee UART is USART6 (which was COM1 in NETMF). However, in 0.7.0 the incorrect pins are mapped to it. It has been fixed for 0.8.0, but you can always build your own Cerb firmware with the change now if you like. The docs can get you started with that.