xbee.remote_at not working
<p>I am using python-xbee to work with XBee modules (Python 2.7). I have an XBee (coordinator) directly connected to my laptop through a serial port and another separate one (endpoint). I can easily communicate with them both using the <code>at</code> command, but I can't communicate with them using <code>remote_at</code>.</p>

<p>When I run</p>

<pre><code>import serial
from xbee.zigbee import ZigBee
import time

PORT = '/dev/ttyUSB0'
BAUD_RATE = 9600

def print_xbee_data(data):
    print(data)

serial_port = serial.Serial(PORT, BAUD_RATE)
# For some reason escaped=True does not work
xbee = ZigBee(serial_port, escaped=True, callback=print_xbee_data)

xbee.send('at', frame='a', command='nd', parameter=None)

# Delay: to wait to keep the thread running to receive the response(s)
time.sleep(5)
</code></pre>

<p>The output is:</p>

<pre><code>{'status': '\x00', 'frame_id': '\x01', 'parameter': {'status': '\x00', 'source_addr': 'a\xd4', 'parent_address': '\x00\x00', 'profile_id': '\xc1\x05', 'source_addr_long': '\x00\x13\xa2\x00@0\xbd@', 'device_type': '\x02', 'node_identifier': ' ', 'manufacturer': '\x10\x1e'}, 'command': 'ND', 'id': 'at_response'}
</code></pre>

<p>But when I run (I am using both escaped and not-escaped address formats just to be sure)</p>

<pre><code>xbee.remote_at(dest_addr=b'a\xd4', command='MY')
xbee.remote_at(dest_addr=b'\x61\xd4', command='MY')
xbee.send('remote_at',
          frame_id='A',
          dest_addr_long='\x00\x13\xa2\x00@0\xbd@',
          dest_addr='a\xd4',
          options='\x02',
          command='D0',
          parameter='\x02')
xbee.send('remote_at',
          frame_id='A',
          dest_addr_long='\x00\x13\xa2\x00\x40\x30\xbd\x40',
          dest_addr='\x61\xd4',
          options='\x02',
          command='D0',
          parameter='\x02')

time.sleep(5)
</code></pre>

<p>I get no output.</p>

<ul>
<li>Why doesn't <code>escaped=True</code> work?</li>
<li>Why don't I get any output?</li>
<li>How can I go about fixing the problem?</li>
</ul>

<p>Thanks a lot.</p>

<ol>
<li><code>escaped=True</code> is only if you have <code>ATAP</code> set to 2 (escaped API mode) instead of 1 (API mode).</li>
<li>Are you sure your modules are joined to each other, and you're not seeing an <code>ATND</code> response from your local device?  Make sure you're using the address of the remote module.</li>
</ol>

python serial-port xbee zigbee