How can I change my xbee setup for AP = 0 from API mode (AP = 1 or AP =2) by using digi module in python ?

I am using XBee PRO S3B for wireless radio communication.

Currently I am configuring it by XCTU, however, sometimes I need to reset or re configure with non graphical interface.

Using digi module with python seemed good alternative to me. So here is my source code.

import digi
from digi.xbee.devices import XBeeDevice
xbee0=XBeeDevice("/dev/ttyUSB0",9600)
xbee0.open(force_settings=True)
xbee0.reset()

In this way I can reset my destination mac address. However, there is one critical drawback using this method. xbee0.open() is only supported by API mode, however, I am always using AT mode. So the command force_settings=True enables my AT mode to change into API mode, however, I am not sure how can I get back to AT mode. My device only works with AT mode so I need to go back to AT mode to do something. Is there any good solution for this?

Why don’t you just issue the local AT commands to enter command mode, change the address and exit command mode via Python?

I am not familiar with that method. Where can I find it?

Page 51 of the manual at https://hub.digi.com/support/products/digi-xbee/digi-xbee-pro-900hp/?path=/support/asset/xbee®-pro-900hp-and-xsc-rf-modules-user-guide/ explains how to use AT command mode.

Thank you very much.