Xbee gadgeteer 4.3

Hi,
how to send text from gadgeteer using xbee adapter to another xbee plug into computer? Please write sample

Hi Marius,

Are you using series 1 or series 2. I have been using series 1 around the house and can probably help you if you are using series 1. If you haven’t bought any hardware yet you should probably spend some time investigating. If I were to do it all over again I might use series 2 but series 1 is really easy.

@ Bill_Wyo -

I use series 2 . I need source how to two xbee send and get text

xbee - coolcomponents.co.uk/wp/wp-content/upload/2013/05/xbee-s2-pcb-500x500.jpg
xbee adapter - https://www.ghielectronics.com/img/www/products/314-0_large.jpg
xbee usb adapter - https:// cdn.sparkfun.com//assets/parts/7/8/6/5/11697-00.jpg

@ marius111 -
Here is a link to a codeshare post. https://www.ghielectronics.com/community/codeshare/entry/189
Codeshare is a good place to find working code.
I believe there is some configuration you need to perform on your series 2 xbee. I am not going to be much help there.

If you’re familiar with how to configure your xbee(s) as a coordinator, router, and endpoint, take a look at http://xbee.codeplex.com/wikipage?title=FEZ%20Hydra%20Demo

FYI - his project needs an update to netmf 4.3

1 Like

I am relatively new to the world of Gadgeteer and NETMF so I am writing this from a nooby perspective. There are good links on the web that explain in detail how to configure the XBee modules using XCTU. This is the key. Make sure that they are configured and can communicate to each other in the tool first. The code is the easy part.

@ ransomhall - Is that a matter of a recompile, or further work?

Anyone experience with the Xbee Light Link profile or have something working with .netmf?

Plug this into PC:
xbee - coolcomponents.co.uk/wp/wp-content/upload/2013/05/xbee-s2-pcb-500x500.jpg
xbee usb adapter - cdn.sparkfun.com//assets/parts/7/8/6/5/11697-00.jpg

Send text and received it in one pc

using System;
using System.Diagnostics;
using System.IO.Ports;
using System.Security.Principal;
using System.Text;
using System.Threading;
namespace Project1
{
public class Program
{
private static int ii = 0;
public static void Main()
{
// create serial port for XBEE. Connect XBEE_RX to Di8 and XBEE_TX to Di7.
SerialPort xbee = new SerialPort(“COM8”, 9600, Parity.None, 8, StopBits.One);
xbee.Open();
SerialPort xbee2 = new SerialPort(“COM9”, 9600, Parity.None, 8, StopBits.One);
xbee2.Open();
// create “Hello!” string as bytes
byte[] helloBytes = Encoding.UTF8.GetBytes(“Hello!”);
byte[] helloBytes3 = Encoding.UTF8.GetBytes(" ");
byte[] helloBytes2 = helloBytes3;
// send string every second
while (true)
{
xbee.Write(helloBytes, 0, helloBytes.Length);
xbee2.Read(helloBytes2, 0, helloBytes2.Length);
//Debug.Print(ii++ + ": " + Encoding.UTF8.GetString(helloBytes2));
Console.WriteLine("Gauti duomenys: " + Encoding.UTF8.GetString(helloBytes2));
Thread.Sleep(100);
}
}
}
}

(gadgeteer, 4.2, xbee S2, Visual studio 2013, C#)

I send data:

xBeeAdapter.Configure(9600, GT.Interfaces.Serial.SerialParity.None, GT.Interfaces.Serial.SerialStopBits.One, 8);
xBeeAdapter.SerialLine.Open();
int ii = 0;
Debug.Print(“1”);
var testas = “Test”;

       /* while (true)
        {
            xBeeAdapter.SerialLine.Write(ii++ + " " + testas);
            Thread.Sleep(1000);
         } */

But I need to encrypt data. How can I encrypt sending text?

The EE command enables or disables 128-bit AES encryption, with parameter values 1 or 0 respectively. When encryption
is enabled, all modules will use the long form of their source addresses.
The KY command sets the encryption key. All modules in the network must use the same key. The key is a 128-bit
(16-byte) value. The default key is 0. Once it has been set, there is no way to read it back from the module.

When showing your code on the forum please use the code tag as it makes it more readable.

@ Sprigo - I see this, but I need more parameter, I want change 128-bit AES encryption to other encryption

The XBee’s only support 128-bit AES natively so if you want a different encryption you will need to code it yourself.

In theory, just a recompile.