Home/Support/Support Forum/Matching XCTU's throughput mode tests via API mode in code? XBP9B-DM

Matching XCTU's throughput mode tests via API mode in code? XBP9B-DM

0 votes
I am working with two XBP9B-DM's and am using XCTU to see throughput tests with 256 byte payloads of 40kbps.

Console working mode on the receiving module indicates that I am receiving all bytes transmitted in the throughput test which seems to indicate some form of acknowledgment taking place.

As of right now I have tried both java and python (same logic, so we'll use python here for readability) with Digi's API and am only seeing synchronous broadcast transfer of 256 byte payloads of 2.x kbps. Asynch transfer directly to the receiver is a bit faster at 21.x kbps but still nowhere near XCTU's throughput mode. Asynch transfer doesn't seem to be sending all bytes to receiver under the same conditions, which indicates XCTU is doing something differently than my code.

Does anyone know what is going on? How can I get reliable transfer closer to the 40kbps XCTU's throughput test indicates these modules are capable of?
Code below, NOTE: (...) means values were edited out. They are complete in code.

import time
from digi.xbee.devices import XBeeDevice, RemoteXBeeDevice, XBee64BitAddress

device = XBeeDevice(...)
remote_device = RemoteXBeeDevice(device, XBee64BitAddress.from_hex_string(...))

total_sent = 0
start_time = 0

f = open('50000bytes.txt', 'r')
info = f.read()
info = [info[i:i+255] for i in range(0, len(info), 255)]
for chunk in info:
if start_time == 0:
start_time = time.time()
total_sent += len(chunk)
#device.send_data_async(remote_device, chunk) #Sends data asynchronously, non blocking
device.send_data_broadcast(chunk) #Sends data synchronously, blocking
time_elapsed = time.time() - start_time
print('time elapsed: ',time_elapsed)
print('data rate: ', total_rcvd/1000/time_elapsed)
asked Nov 12, 2018 in RF Solutions and XBee by nbt192 New to the Community (0 points)

Please log in or register to answer this question.