Could not determine operating mode.

i’m using the XBee-PRO 900HP boards with the Java library.
The xbeeDevice.open() issues the following exception: “com.digi.xbee.api.exceptions.InvalidOperatingModeException: Could not determine operating mode”.

I’m sure that the COM port is right and that the Java code is correct ( i tested it also on XBee 868 boards), and i tested it on both Windows and Linux, but i’m not able to use these boards.
I tried to change the API mode with or without escapes but I obtain the same error.
The only way is to open the XCTU tool, let him to discover these XBee-PRO 900HP boards, and then i can run my java code on the boards without any error; but if i power off the modules and then i power on them, they don’t work.
I also tried to load default firmware on the board, but nothing change.
How can i solve this problem?

1 Like

Having the exact same issue with the same family of devices; were you able to solve this?

My solution was inspired by the following two links:

https://github.com/digidotcom/XBeeJavaLibrary/issues/57

https://blog.chendry.org/2014/12/25/programmable-xbee-pro-900hp-osx-quickstart.html

Essentially the unit needs to be in bypass mode for the code to talk to the unit… The way I solved it (error handling removed):
For java:
SerialPortRxTx serPort = new SerialPortRxTx(“COM32”, 9600);
serPort.open(); serPort.writeData("

".getBytes()); //wake boot menu up
Thread.sleep(1000);
serPort.writeData(“B”.getBytes()); //initiate bypass mode
Thread.sleep(1000);
serPort.close();

Run actual code

For python:

self.ser = serial.Serial(port, baud)
self.ser.write("

")
time.sleep(0.1)
self.ser.write(“B”)
time.sleep(0.1)
self.xbee = ZigBee(self.ser,escaped=True)

I hope this helps someone…

Hi,
I have the same problem. I run:
python c:/Users/a/Desktop/DiscoverDevicesSample/DiscoverDevicesSample.py
But it give me the error:
File “c:\Users\a\Desktop\DiscoverDevicesSample\digi\xbee\devices.py”, line 2491, in _do_open
raise InvalidOperatingModeException(message=“Could not determine operating mode”)
digi.xbee.exception.InvalidOperatingModeException: Could not determine operating mode

The only way is to open the XCTU tool, let him to discover these XBee-PRO 900HP boards, and then i can run my java code on the boards without any error; but if i power off the modules and then i power on them, they don’t work.
I also tried to load default firmware on the board, but nothing change.
How can i solve this problem?
https://www.cetpainfotech.com/technology/python-training

have you installed the latest firmware on your XBee pro, what’s its current version and the model no of your XBee module. I got a similar issue during PCB Panelization but got it working by upgrading the design.