Home/Support/Support Forum/S2C problem with (python-xbee library) and (asynchronous mode)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

S2C problem with (python-xbee library) and (asynchronous mode)

0 votes
I don't know if https://code.google.com/p/python-xbee/ is the best library to use S2C Pro. I'm trying to use asynchronous mode, without success, the following code is the same than in PDF:
import serial import time from xbee import ZigBee serial_port = serial.Serial('/dev/tty.usbserial-DA01MBXV', 9600) def print_data(data): print data zigbee = ZigBee (serial_port, callback=print_data) while True: print '.' try: time.sleep(0.001) except KeyboardInterrupt: break zigbee.halt() serial_port.close()

All data sent to coordinator can be seen by XCTU, but nothing on python terminal.
Do you have any idea ?
Best regards,
asked Sep 30, 2015 in 3rd Party Python and API development in other Languages by Rolland New to the Community (10 points)
edited Sep 30, 2015 by Rolland

Please log in or register to answer this question.

1 Answer

0 votes
I had the same issue. In my case, I had the S2C modules configured to use AP mode 2(API enabled with escaping [2]). I did not configure the python library to also use escaped data. Double check the AP mode of your modules. If you want to use the "escaped" data mode, just change the instantiation of the ZigBee object to the following:

zigbee = ZigBee (serial_port, callback=print_data, escaped=True)
answered Mar 20, 2016 by Isaac Barbary New to the Community (1 point)
edited Mar 19, 2016 by Isaac Barbary