This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc-ble-driver-py - Maximum data rate

Hi,

Just been testing the data rate of write without response commands, I'm only getting about 250 bytes / second which seems incredibly slow?

I've just got a simple little loop sending 20 bytes (max mtu limitation for the v2 api)

timeBefore = time.perf_counter()
bytesSent = 0
for i in range(100):
    try:
        adapter.write_cmd(conn, bulkDataUuid, bytes(20))
        adapter.evt_sync[conn].wait(BLEEvtID.evt_tx_complete)
        bytesSent += 20
    except NordicSemiException as error:
        print(str(i) + " failed")
        print(error)
print("sending %d bytes took %f seconds, %f b/s" % (bytesSent, time.perf_counter() - timeBefore, bytesSent / (time.perf_counter() - timeBefore)))

I tried enabling the high bandwidth mode with this:

    def ble_high_bw(self):
        bwOption = driver.ble_opt_t()
        bwOption.common_opt.conn_bw.conn_bw.conn_bw_rx = driver.BLE_CONN_BW_HIGH
        bwOption.common_opt.conn_bw.conn_bw.conn_bw_tx = driver.BLE_CONN_BW_HIGH

        driver.sd_ble_opt_set(self.rpc_adapter, driver.BLE_COMMON_OPT_CONN_BW, bwOption)

but that didn't seem to change the speed at all, the baud rate of the serial link is at the default 1Mbaud.

Is this just the expected speed cap because of all the python and uart stuff going on under the hood or is there anything else I can do?

Many thanks,

Peter

Parents Reply Children
No Data
Related