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

Trying to setup a simple Ble beacon on a PCA10040 and a sniffer on another PCA10040

Hi.

I am trying to set up a simple Ble beacon on a PCA10040 and a sniffer on another PCA10040.

IDE = Segger Embedded Studio for ARM (This works fine)

The beacon uses 'nrf5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_beacon'. This appears to compile, download and run o.k. The indicator Led flashes as expected.

The sniffer uses 'nrf5_SDK_for_mesh_v1.0.1_src\examples\beaconing'. This compiles and downloads o.k. However when running in debug mode I expected the 'rx-callback' function to intercept Ble adverts and to see a LOG report in the debug window giving the entire beacon payload. I have also tried it with other advertising Ble beacons and nothing ever gets reported in the debug window.

Regards Chris Harley (U.K.)

Parents
  • hello Chris,

    It looks like you may want to follow the advice from Rick Chung over on this thread... after experiencing the same issue, Rick's fix worked for me but with the following caveats:

    1- although I started seeing ble adverts, the __LOG_XB(..) call displayed the following:

    <t:          0>, main.c,  162, ----- Bluetooth Mesh Beacon Example -----
    <t:      56256>, main.c,  135, Initializing and adding models
    <t:      61115>, main.c,  190, Initialization complete!
    <t:      62138>, main.c,   85, RX [@179836]: RSSI: d ADV TYPE: ffffffba ADDR: [2x:2x:2x:2x:2x:2x]: 1EFF06000109200036283F707E3EE9AE3C35044EAD0DE498BD2822DBB8A4CB
    <t:      62846>, main.c,   85, RX [@201435]: RSSI: d ADV TYPE: ffffffc2 ADDR: [2x:2x:2x:2x:2x:2x]: 031900000201061107ABD0F555EB40E7B2AC49DDEB83D32BA205FF04001B80
    <t:      63667>, main.c,   85, RX [@226503]: RSSI: d ADV TYPE: ffffffe0 ADDR: [2x:2x:2x:2x:2x:2x]: 0201041AFF590002150112233445566778899AABBCCDDEEFF001020304C3
    <t:      64920>, main.c,   85, RX [@264847]: RSSI: d ADV TYPE: ffffffa4 ADDR: [2x:2x:2x:2x:2x:2x]: 02011A0BFF4C000906026A0A000049

    with incorrect values for the rssi, adv type and dev addr.

    2- By implementing the following patch:

        (void) sprintf(msg, "Rx: [@%u] - rssi: %d - Adv Type: %d - Channel: %d - Addr: [0x%p:%p:%p:%p:%p:%p] - ",
                       p_rx_data->p_metadata->params.scanner.timestamp,
                       p_rx_data->p_metadata->params.scanner.rssi,
                       p_rx_data->adv_type,
                       p_rx_data->p_metadata->params.scanner.channel,
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[5],
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[4],
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[3],
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[2],
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[1],
                       (void*)p_rx_data->p_metadata->params.scanner.adv_addr.addr[0]);

    The log is then displayed as follows:

    <t:          0>, main.c,  179, ----- Bluetooth Mesh Beacon Example -----
    <t:        296>, main.c,  152, Initializing and adding models
    <t:       5193>, main.c,  207, Initialization complete!
    <t:       5546>, main.c,  102, Rx: [@158134] - rssi: -62 - Adv Type: 0 - Channel: 38 - Addr: [0xe9:b4:0e:bd:ac:7b] - : 031900000201061107ABD0F555EB40E7B2AC49DDEB83D32BA205FF04001B80
    <t:       6191>, main.c,  102, Rx: [@177828] - rssi: -73 - Adv Type: 2 - Channel: 38 - Addr: [0x05:76:32:40:e1:cd] - : 1EFF0600010920001D8F3249D07FC70A7D52891320E44AA6F4E5ACB1683B20
    <t:       7591>, main.c,  102, Rx: [@220565] - rssi: -32 - Adv Type: 2 - Channel: 38 - Addr: [0x3d:9e:21:4b:73:c9] - : 0201041AFF590002150112233445566778899AABBCCDDEEFF001020304C3
    <t:       9591>, main.c,  102, Rx: [@281579] - rssi: -74 - Adv Type: 2 - Channel: 38 - Addr: [0x05:76:32:40:e1:cd] - : 1EFF0600010920001D8F3249D07FC70A7D52891320E44AA6F4E5ACB1683B20
    <t:       9815>, main.c,  102, Rx: [@288443] - rssi: -62 - Adv Type: 0 - Channel: 38 - Addr: [0xf8:8f:01:7a:e4:8e] - : 0201061AFF4C0002150112233445566778899AABBCCDDEEFF026682C6EC3
    <t:      11008>, main.c,  102, Rx: [@324838] - rssi: -32 - Adv Type: 2 - Channel: 38 - Addr: [0x3d:9e:21:4b:73:c9] - : 0201041AFF590002150112233445566778899AABBCCDDEEFF001020304C3
    <t:      12482>, main.c,  102, Rx: [@369825] - rssi: -60 - Adv Type: 0 - Channel: 38 - Addr: [0xe9:b4:0e:bd:ac:7b] - : 031900000201061107ABD0F555EB40E7B2AC49DDEB83D32BA205FF04001B80
    <t:      12949>, main.c,  102, Rx: [@384081] - rssi: -74 - Adv Type: 2 - Channel: 38 - Addr: [0x05:76:32:40:e1:cd] - : 1EFF0600010920001D8F3249D07FC70A7D52891320E44AA6F4E5ACB1683B20
    <t:      14315>, main.c,  102, Rx: [@425766] - rssi: -31 - Adv Type: 2 - Channel: 38 - Addr: [0x3d:9e:21:4b:73:c9] - : 0201041AFF590002150112233445566778899AABBCCDDEEFF001020304C3

    You should also be able to detect the beacons for Nordic Semi Mesh & the nRF Beacon via the nRF Connect app.

    Regards,

  • Hi,

    Thanks for pointing us to that other thread!

    Regards,
    Terje

Reply Children
No Data
Related