# Why does S2C throw invalidOperatingmodeException in response to python library device.open()?

**URL:** <https://forums.digi.com/t/why-does-s2c-throw-invalidoperatingmodeexception-in-response-to-python-library-device-open/19957>\
**Category:** Python\
**Tags:** s2c, python\
**Created:** [October 25, 2018, 10:54am UTC](https://forums.digi.com/t/why-does-s2c-throw-invalidoperatingmodeexception-in-response-to-python-library-device-open/19957 "2018-10-25T10:54:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigBoomBlueAsh](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@BigBoomBlueAsh](https://forums.digi.com/u/BigBoomBlueAsh)\
**Post date:** [October 25, 2018, 10:54am UTC](https://forums.digi.com/t/why-does-s2c-throw-invalidoperatingmodeexception-in-response-to-python-library-device-open/19957/1 "2018-10-25T10:54:55Z")

</div>

Trying to swap out an ancient S2B Pro xBee with a new S2C Pro. Configured the new unit using XCTU to carefully match PAN, baud, etc. New unit plays nicely in the network when mounted on the XCTU development board. When deployed onto its home (where the S2B has sat comfortably) on a RaspberryPi3b running Python 3.5.3 with the digi.xbee library, the call to open the device throws invalidOperatingModeException:\_Could\_Not\_Determine\_Operating\_Mode.

Why? What to do?

Old Device: XBP24BZ7PIT-004-revF  
New Device: XBP24CZ7PIT-004-revF

This code:  
from digi.xbee.devices import XBeeDevice  
xb=XBeeDevice(‘//dev/tty/AMA0’.57600)  
xb.open()

Generates this response:  
/dev/ttyAMAo port opened  
/dev/ttyAMA0 port closed  
Traceback (most reent call last):  
File “/home/pi/.local/lib/python3.5/site-packages/digi/xbee/devices.py”, line 1259, in open  
raise InvalidOperatingModeException(“Could not determine operating mode”)  
digi.xbee.exception.invalidOperatingModeException: Could not determine opearting mode
