I definitely recommend switching from "AT mode" to "API mode" on the modules, as it's more flexible and you won't have to worry about whether you're in command mode or not.
You would need to configure the XBee module for API mode (ATAP=1
) before you could use the API-mode methods/functions in python-xbee.
It might be helpful to monitor the serial connection between the XBee and Raspberry Pi, but that would likely require some hardware hacking (connecting the Tx and Rx pins to the Rx pins of two serial ports, and having software dump the bytes received on both, with timing; or using a logic probe).