SLOW THROUGHPUT in built-in bluetooth in computer, but almost DOUBLE the SPEED in nRF Connect for Desktop. How to match this high performance?

Good afternoon!

We are developing a BLE App that is communicating via bluetooth to a PCB board. The App uses the built-in Bluetooth module in our Windows laptops and the PCB has a STM32 micro and a BL652 BLE module w nrf52832 inside. The App acts as the central demanding data by sending commands to the PCB (our peripheral) and the latter responses with discrete values or streaming data until another command tells him to stop..

The problem comes with the data throughput. We tested the bluetooth communication by connecting to the PCB and asking for a stream of data from the nRF Connect for Desktop program and from Python, Matlab and even the App itself. The nRF Connect seems to perform at higher speed giving us double the throughput that we get in the other three. By sniffing the traffic of data via Wireshark, I found that both exchanges are very similar, but worth noting that the communication in nRF has a higher number of bytes captured, 126, and a length of 100 whereas the Python code only has 53 bytes captured and a length of 27 (see images below).

nRF Connect:

Python code:

We already got a great help some time ago from this forum, where the throughput improved considerably when increasing the NRF_SDH_BLE_GAP_EVENT_LENGTH in our bluetooth module in the PCB. We also got suggested to enable the 2M PHY, but I am not sure if our laptops support such hardware. Maybe someone has another suggestion that could help to give us the bit rates that we get in our nRF Connect.

We would appreciate any help.

Thank you very much!

Parents Reply Children
  • Hi Simon,

    After some research, I found out that the PHY can be set either from main or peripheral. I found the excerpt in the code of the nRF52832 (peripheral) where the PHY update is made and I changed the code from BLE_GAP_PHY_AUTO to BLE_GAP_PHY_2MBPS:

    case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_2MBPS,  //used to be AUTO,
                    .tx_phys = BLE_GAP_PHY_2MBPS,  //used to be AUTO,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } break;

    By sniffin with Wireshark, I expected to have at least a LL_PHY_REQ (request) where the two parts tried to switch from 1M to 2M, but I did not get any. I tried with the python code, the BLE App we are developing in a laptop with Bluetooth 5.0 and even the nRF52840 Dongle and it did not work. Is there another change in code that I am missing?

    Your help is much appreciated.

    Best regards. 

  • Hi

    I'm not sure I understand. Do the devices switch PHY without the sniffer picking it up, or does the switch simply not occur? Is the PHY update request sent from either side at all or not? If you could upload the sniffer trace that might help as well.

    Best regards,

    Simon

Related