Raspberry Pi - PC communication with xBee

Hey everyone,

I’ve two xBee Pro S2C module. I’m trying to send a data from Raspberry Pi to Windows PC with xBee modules. I can not send or get data with my codes.

https://www.heypasteit.com/clip/0IUYIT (Windows Side - C#)

https://www.heypasteit.com/clip/0IUYIU (Raspberry Pi Side - Python)

Have you verified that the two radios are associated to each other? If these are using the Zigbee firmware, one will need to be a coordinator. Also most 3rd party Raspberry Pi code uses the XBee in API mode.

What I would suggest if you are using transparent mode, remove the XBee, wire up the connection using the XBee port and try to get your data going.

I have already configured my xBees as coordinator and router. They working on API mode. I want to data transfer between Windows PC and Raspberry Pi. Is my codes are correct?

When i send data on XCTU, i can get on Raspberry Pi (with the above python code).

But when i try send data with my C# code, i can not get data.

Help me that is very important for me

I am far from an expert on C Code. But I would suggest looking over https://xbplib.readthedocs.io/en/latest/

All I could see is where you open the COM port. I don’t see what it is you are sending.

Are you sure that you have the serial device correct in Python for the Raspberry Pi? I would have thought it would have been something like /dev/ttyUSBx. COM6 looks like how it’s identified in Windows. You can use the command “python -m serial.tools.miniterm” to use the miniterm tool to find out what the serial device is actually called on your RPi.