XBee API mode 1, but xbee python library give me Unsupported operating mode: AT mode

Hello, I hope that you can help me. I have 3 week traying to solve that issue.

I am working with RaspBerry PI 3. 2 XBEE PRO S2B, configured with XCTU 6.3.11, function set ZigBee Coordinator API and other ZigBee Router API, both with parameter AP= 1 and firmware 21A7.

But when I run the “SendDataSample.py” from xbee python library, have the follow errors. I don’t understand, if the ZigBee mode is AP 1, who the python example does not recognize that?. obviously I have modified the python example with my port = “/dev/ttyS0” and other values.

line 56, in
main()
File “SendDataSample.py”, line 35, in main
device.open()
File “/usr/local/lib/python3.5/dist-packages/digi/xbee/devices.py”, line 1287, in open
raise InvalidOperatingModeException.from_operating_mode(self._operating_mode)
digi.xbee.exception.InvalidOperatingModeException: Unsupported operating mode: AT mode

What firmware version is on the 2nd radio?

1 Like

ZigBee Coordinador API, 21A7 (newest) firmware, product family XBP24B27. ZigBee Router API, 23A7 (Newest) firmware, product family XBP24B27
The communication and test using xctu working ok.

Both firmware versions you have listed are API mode. Could it be that your code wants you to use AT code instead?

NO. The sample"SendDataSample.py" from xbee python library only work in API mode. Is more, https://github.com/digidotcom/python-xbee is only to work with API mode.

Than I would suggest making sure you are associated to the coordinator and that you are sending valid API frames.

Finally I found the problem. I had the pins of the xbee (usb adapter) connected to the pins of the respberry, TX and RX (8,10). Also disable the “login shell” on the serial port, using “sudo raspi-config” on the command line. In the SendDataSample.py (xbee python library) I used the port / dev / ttyS0.
When executing the program, the library interpreted it as an AT MODE, not as API MODE. why?
However, if I connect the usb output of the adapter to a usb entry of the raspberry, and use it in the SendDataSample.py / dev / ttyUsb0, it works perfectly, sending the string to the XCTU console.
Now why do not I work with the TX and RX pins of the raspberry.

Hi, I would like to know if you could solve the problem of TX and RX of the raspeberry. I had the same problem but connecting it to USB was solved but I don’t understand the problem with the serial interface of the raspberry.