xbee-python icon indicating copy to clipboard operation
xbee-python copied to clipboard

XBee-PRO ZB (S2C) TH - InvalidOperatingModeException: Could not determine operating mode

Open LorenzoBottaccioli opened this issue 6 years ago • 4 comments

Hi all,

I have conncted a Digi XBee-PRO ZB (S2C) TH to my desktop. If try to connect to the device with the following code I get the following error:

from digi.xbee.devices import ZigBeeDevice 
PORT = "/dev/ttyUSB0"  
BAUD_RATE = 9600 
device = ZigBeeDevice(PORT, BAUD_RATE)                                                                                                                                       
device.open()        
                                                                                                                                                        
---------------------------------------------------------------------------
InvalidOperatingModeException             Traceback (most recent call last)
<ipython-input-4-b929a415d2b8> in <module>
----> 1 device.open()

~/py3/lib/python3.6/site-packages/digi/xbee/devices.py in open(self)
   2970            | :meth:`.XBeeDevice.open`
   2971         """
-> 2972         super().open()
   2973         if self.get_protocol() != XBeeProtocol.ZIGBEE:
   2974             raise XBeeException("Invalid protocol.")

~/py3/lib/python3.6/site-packages/digi/xbee/devices.py in open(self)
   1257         if self._operating_mode == OperatingMode.UNKNOWN:
   1258             self.close()
-> 1259             raise InvalidOperatingModeException("Could not determine operating mode")
   1260         if self._operating_mode == OperatingMode.AT_MODE:
   1261             self.close()

InvalidOperatingModeException: Could not determine operating mode

If I open than XCTU and try to connect the device it works from both XCTU and Python.

Any suggestion to solve the issue?

Best,

Lorenzo

LorenzoBottaccioli avatar Feb 27 '19 16:02 LorenzoBottaccioli

Hi Lorenzo,

I got something simillar here. Have u have any updates??

thiagoalbertocabral avatar Jul 10 '20 13:07 thiagoalbertocabral

I have a PR opened for a while that helps take care of this. #126

I would just change the mode the radio to API Escaped mode so I can use it.

JeffLabonte avatar Jul 12 '20 18:07 JeffLabonte

I've been having the same problems with both API 1 and API 2. Any updates on this?

brettv30 avatar Jul 23 '20 19:07 brettv30

Same

CapitaineHadd0ck avatar Mar 16 '21 15:03 CapitaineHadd0ck