CerbuinoBee with Xbee

Hello,

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

Hi,
which COM Port did you use on the on-board XBee socket? I think it should be COM1.

Here is my code for creating the XbeeAdapter:

XBeeAdapter xbee2 = new XBeeAdapter(GHIElectronics.TinyCLR.Pins.FEZCerbuinoBee.UartPort.Xbee);

In place of .Xbee I can select .Socket1, .Socket2, and .Uart3

I have tried all of these but they have not worked.

I didn’t yet test with TinyClr 7.0. If I remember right, on NETMF it was COM1.
Perhaps this link can give some help.

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);               
        }
    }
}

}

Thanks again. I appreciate the time you spent doing this for me.

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.

3 Likes