Are you using XBee or XBeePro? I had the same problem and this post helped me a lot.
Try changing the receiver code as follows:
import config import serial import time from xbee import ZigBee def toHex(s): lst = [] for ch in s: hv = hex(ord(ch)).replace('0x', '') if len(hv) == 1: hv = '0'+hv hv = '0x' + hv lst.append(hv) def decodeReceivedFrame(data): source_addr_long = toHex(data['source_addr_long']) source_addr = toHex(data['source_addr']) id = data['id'] samples = data['samples'] options = toHex(data['options']) return [source_addr_long, source_addr, id, samples] PORT = '/dev/ttyUSB0' BAUD_RATE = 9600
In my case, the above code outputs the following:
[['0x00', '0x13', '0xa2', '0x00', '0x40', '0x9b', '0xaf', '0x4e'], ['0x68', '0x3f'], 'rx_io_data_long_addr', [{'adc-0': 524}]]
Here I shared the configuration settings for the Node controller (compatible with X-CTU)
source share