How can I use C# to communicate between XBees when one is connected to the USB port and the other one to a power source?

Edit: Are they still communicating if I plug it to a power source? So that I’m able to add digital signals (buttons) on the endpoint and send it to the coordinator in order to visualize it in visual studios?

I have made a program using C# (found on the Internet) to communicate between two XBees when having both connected to USB ports.

However, I want to be able to communicate between them while having one coordinator that’s connected to a USB port, and one endpoint that’s only connected to a power source.

Eventually I want to be able to add more endpoints that will communicate with the coordinator.

Any guidance on how I can manage this?

Here’s a link to the code I used for my original program:

Yes they are still communicating. The data is just going to go out to anything on the remote side as there is nothing connected to the COM port. So if you want to use the DIO line or ADC lines, then yes it will work. Just use API mode on the PC Side and use the proper API frames.

Thank you!

Are there any C# example code of this?

I’ve set up an Xbee in API mode and connected it to a led on the digital input. So if I use XCTU I can set the input high, and my led will be on. This is of course very easy when it’s connected to the pc.

But I want to do the same thing with C# - setting digital IO high manually. Also, I want to use one XBee that’s connected to the PC to control a different XBee only connected to the diode and batteries. I’d also like to visualize the status of said led in my application, but I figure that’s going to be easy when I understand and can do the rest.

I’ve done some research on the API but I can’t find any example code on how to do this monitoring and controlling via C#.

Any feedback on this would be greatly appreciated.


As stated before, I don’t know of any C# examples. I only know of the C examples above. I also know that there are C Examples for the Arduino processors as well. But that is about it.