# Xbee python 802.15.4 with api not responding

**URL:** <https://forums.digi.com/t/xbee-python-802-15-4-with-api-not-responding/17521>\
**Category:** Python\
**Tags:** xbee-python, xbee\
**Created:** [October 11, 2016, 7:56am UTC](https://forums.digi.com/t/xbee-python-802-15-4-with-api-not-responding/17521 "2016-10-11T07:56:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toby](https://avatars.discourse-cdn.com/v4/letter/t/7993a0/32.png) [@toby](https://forums.digi.com/u/toby)\
**Post date:** [October 11, 2016, 7:56am UTC](https://forums.digi.com/t/xbee-python-802-15-4-with-api-not-responding/17521/1 "2016-10-11T07:56:03Z")

</div>

Hi,  
This code seems to be working but not receiving back “hello world” ?  
I can see the transmit led light-up on the grove development board. I can chat over USB with XCTU on MAC os 10.9.

#! /usr/bin/python

# Import and init an XBee device

from xbee import XBee, ZigBee  
import serial

ser = serial.Serial(‘/dev/tty.usbserial-AK05CKON’, 9600)

# Use an XBee 802.15.4 device

xbee = XBee(ser)

# To use with an XBee ZigBee device, replace with:

# xbee = ZigBee(ser)

# Set remote DIO pin 2 to low (mode 4)

xbee.remote\_at(  
dest\_addr=b’\x56\x78’,  
command=‘D2’,  
parameter=b’\x04’)

xbee.remote\_at(  
dest\_addr=b’\x56\x78’,  
command=‘WR’)

def print\_data(data):  
“”"  
This method is called whenever data is received  
from the associated XBee device. Its first and  
only argument is the data contained within the  
frame.  
“”"  
print data

xbee = XBee(ser, callback=print\_data)

xbee.tx(dest\_addr=‘\x00\x01’, data=‘Hello World’)

# Wait for and get the response

print(xbee.wait\_read\_frame())  
while True:  
try:  
print xbee.wait\_read\_frame()  
except KeyboardInterrupt:  
break

ser.close()

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [November 10, 2016, 1:50pm UTC](https://forums.digi.com/t/xbee-python-802-15-4-with-api-not-responding/17521/2 "2016-11-10T13:50:08Z")

</div>

I don’t see anything telling the app to do a serial.read function. I don’t even see a serial.write function either. For that matter I don’t see you calling the serial port at all.
