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

PC-BLE-Driver - Some advertisement lengths faulty/forbidden? [sdk5 v14.0.0]

Hi,
I have strange problem using pc-ble-driver on nrf52 with heart_rate_monitor example.
When I set advertisement data to be 16 bytes long, two of our testing phones cannont see proper advertisement data (iPhone 6 iOS 10.2.1 and Sony Xperia Z5 Android 7.1.1)
It should me seen as connectable with 11 bytes of manufacturer data, but it's seen as unconnectable and without manufacturer data at all.
When I change manufacturer data to be one byte shorter, then everything is ok, one or two bytes more and it doesn't work, 6 bytes more and it start working again.

This is (not working) my setup:

    data_buffer[index++] = 0x02;
    data_buffer[index++] = BLE_GAP_AD_TYPE_FLAGS; // 0x01
    data_buffer[index++] = BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;

    data_buffer[index++] = 0x0C;
    data_buffer[index++] = 0xFF;
    data_buffer[index++] = 0x88;
    data_buffer[index++] = 0x44;
    data_buffer[index++] = 0x55;
    data_buffer[index++] = 0x34;
    data_buffer[index++] = 0x03;
    data_buffer[index++] = 0x11;
    data_buffer[index++] = 0x22;
    data_buffer[index++] = 0x33;
    data_buffer[index++] = 0x44;
    data_buffer[index++] = 0x55;
    data_buffer[index++] = 0x66;

    uint8_t sr_data[9];
    sr_data[0] = 0x08;
    sr_data[1] = 0x09;
    sr_data[2] = 0x43;
    sr_data[3] = 0x6F;
    sr_data[4] = 0x6E;
    sr_data[5] = 0x6E;
    sr_data[6] = 0x65;
    sr_data[7] = 0x63;
    sr_data[8] = 0x74;
    error_code = sd_ble_gap_adv_data_set(m_adapter, data_buffer, index, sr_data, 0x09);

Thanks for any help :)

Parents
  • Hi,

    From your code excerpt it is impossible to tell how large data_buffer is. Are you sure it is large enough?

    You write that you experience problems when testing with two different smartphones. Are those the only devices that you have used for testing? Do you have a second DK or Dongle that you can use with nRF Connect and see what packets you receive there? Or a sniffer log?

    What SoftDevice and version are you using?

    What version of pc-ble-driver are you using?

    Regards,
    Terje

  • - Are you sure it is large enough?
    Yes i'm sure its large enough, because I'm able to make manufacturer data lager and its works.


    - Are those the only devices that you have used for testing?
    No, we tested it on many phones, about 20.


    - What SoftDevice and version are you using?
    sdk 14, softdevice 5


    - What version of pc-ble-driver are you using?
    Sorry I dont know how to check this, I downloaded it from (Monday, 29 October 2018):
    https://github.com/NordicSemiconductor/pc-ble-driver

    Sniffer:

    [ 02 1d 00 ff ff 01 c7 04 68 12 0e f3 cf 80 02 01 05 0c ff 88 44 55 01 03 11 22 33 44 55 66 ] - doesn't work

    [ 02 1d 00 ff ff 01 c7 04 68 12 0e f3 cf a0 02 01 05 10 ff 88 44 55 01 03 11 22 33 44 55 66 66 66 66 66 ] - OK

    [ 02 1d 00 ff ff 01 c7 04 68 12 0e f3 cf 78 02 01 05 0b ff 88 44 55 01 03 11 22 33 44 55 ] - OK

    As you can see one buye less is OK, and even 4 bytes more is also OK.

    this is my devices mac address: F3:0E:12:68:04:C7




  • Hi,

    You can use the nRF Sniffer, which lets you use an nRF DK or Dongle with Wireshark.

    I might have misunderstood the situation, can you confirm that you saw this on two phones but not on the others?

    Regards,
    Terje

  • Sorry for late response, I missed your message.
    Yes, as I wrote in first post, we have tested this on oabout 20 phones, and only on two of those we see that problem.
    But when we dont use pc-ble-driver, but just our own ble devices with nRF52 chip with excatly the same advertisement and scan response, this problem doesn't exist at all.

  • Hi,

    So to summarize: The issue is seen when you combine the "right" amount of advertising data, with pc-ble-driver advertiser, with either of two particular smartphones scanning (iPhone 6 iOS 10.2.1 and Sony Xperia Z5 Android 7.1.1). Other phones work with the same pc-ble-driver advertiser, and similar advertiser on nRF52 SoC work with the two phones. Other advertising data lengths also work fine with pc-ble-driver + particular smart phones.

    It would still be interesting to look at a sniffer log of the advertisements, to see if anything is off there. I.e. sniffer traces of both pc-ble-driver version and native nRF version of the failing advertising, and also the working and non-working advertising lengths with pc-ble-driver.

    I will try again to locate one of the particular phones so that we can try to reproduce locally.

    Regards,
    Terje

  • Hi, 
    Yes, your are correct.
    Today I was able to sniff both devices:


    ++++++++++GOOD++++++++++
    8413 2019-03-08 10:38:19,024142 0.000482 c8:68:8e:d4:52:6c Broadcast LE LL 40 SCAN_RSP

    0000 86 21 00 02 58 0e 06 0a 01 26 3d 00 00 f4 00 00 .!..X....&=..ô..
    0010 00 d6 be 89 8e 44 0e 6c 52 d4 8e 68 c8 07 09 53 .Ö¾..D.lRÔ.hÈ..S
    0020 65 6e 73 6f 72 8c 7a 07 ensor.z.


    8414 2019-03-08 10:38:19,025007 0.000865 c8:68:8e:d4:52:6c Broadcast LE LL 48 ADV_IND

    0000 86 29 00 02 59 0e 06 0a 01 27 45 00 00 be 01 00 .)..Y....'E..¾..
    0010 00 d6 be 89 8e 40 16 6c 52 d4 8e 68 c8 02 01 05 .Ö¾[email protected]Ô.hÈ...
    0020 0c ff 8d 04 04 03 01 70 b3 d5 c5 32 63 b2 35 48 .ÿ.....p³ÕÅ2c²5H

    ++++++++++++BAD++++++++++
    276 2019-03-08 10:37:43,278682 0.000268 f3:0e:12:68:04:c7 Broadcast LE LL 40 SCAN_RSP

    0000 86 21 00 02 ec ea 06 0a 01 27 39 00 00 c3 01 00 .!..ìê...'9..Ã..
    0010 00 d6 be 89 8e 44 0e c7 04 68 12 0e f3 07 09 53 .Ö¾..D.Ç.h..ó..S
    0020 65 6e 73 6f 72 24 38 38 ensor$88


    277 2019-03-08 10:37:43,278955 0.000273 f3:0e:12:68:04:c7 Broadcast LE LL 48 ADV_IND

    0000 86 29 00 02 ed ea 06 0a 01 25 3c 00 00 2c 01 00 .)..íê...%<..,..
    0010 00 d6 be 89 8e 60 16 c7 04 68 12 0e f3 02 01 05 .Ö¾..`.Ç.h..ó...
    0020 0c ff 8d 04 04 03 01 70 b3 d5 c5 32 63 75 3e 6f .ÿ.....p³ÕÅ2cu>o

    WIRESHARK FILE:
    wireshark.pcapng

  • Hi,

    I have had a look at the wireshark file, and the advertisement packets look good in both cases.

    However, the "bad" advertisement comes from a Bluetooth 5.0 compliant SoftDevice (as the ChSel field, that is the LE Channel Selection Algorithm field, is set indicating that the device supports Algorithm #2 from Bluetooth 5.0.)

    This suggests that the issue might be related to the SoftDevice used, and not to pc-ble-driver.

    What are the exact SoftDevices used for those two cases? (I.e. for the "good" and for the "bad" as listed from the wireshark file.)

    What nRF52 SoCs (full chip markings) and boards (pca10040, custom, etc.) are used, also for both "good" and "bad" scenario?

    Regards,
    Terje

Reply
  • Hi,

    I have had a look at the wireshark file, and the advertisement packets look good in both cases.

    However, the "bad" advertisement comes from a Bluetooth 5.0 compliant SoftDevice (as the ChSel field, that is the LE Channel Selection Algorithm field, is set indicating that the device supports Algorithm #2 from Bluetooth 5.0.)

    This suggests that the issue might be related to the SoftDevice used, and not to pc-ble-driver.

    What are the exact SoftDevices used for those two cases? (I.e. for the "good" and for the "bad" as listed from the wireshark file.)

    What nRF52 SoCs (full chip markings) and boards (pca10040, custom, etc.) are used, also for both "good" and "bad" scenario?

    Regards,
    Terje

Children
Related