Replacing an USB cable with Xbee to send and receive from Python


I am new to Xbee.

I would like to know if I can replace an USB cable to control a laboratory instrument that has a USB port from a computer using python.

Computer side: Xbee explorer (Sparkfun) with Xbee S2C in API (escape) mode and Python code to send ascii commands and read response.

Instrument side: Xbee explorer (Sparkfun) with Xbee S2C in API mode attached to the instrument USB port. External 5V power supply to the explorer. The Instrument board has an FTDI chip inside to convert from USB to UART. It should reply to every command send from the computer with an ASCII string. That means the data delivered wirelessly to the instrument should be converted to USB by the sparkfun explorer and then converted back to UART by the FTDI chip inside the instrument.

The system it is not working. The TX and RX leds at instrument side are not blinking so it looks like it the instrument is not receiving any data from the xbee explorer.

If I try the same link between two pc’s the system works, so I believe the python code is correct and the xbee modules are well configured.

Any ideas?
Thank you in advance


If the device requires a USB driver, than no it will not.

1 Like

Thank you.

The device has inside a UART connected to a FTDI chip to convert to USB serial so the only driver required is the FTDI driver to generate a virtual com port when the device is connected directly to the USB port of a windows PC. On a linux or raspberry no driver is required to use the device (because the FTDI is in the linux kernel).

If I set the xbee on device side in AT mode, would it work? I do not know if I can mix AT and API mode. API is compulsory at the pc side because of Python library.