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

Receive Advertisement Packet in Mesh Beaconing Example

Hi,

Got some questions about receiving adv packet in Mesh Beaconing Example:

According to the description "The beaconing example also demonstrates the usage of the Packet RX callback. This functionality allows to receive all non-filtered, BLE-compliant advertisement packets in the application code. These packets are captured by @ref SCANNER". I expect getting the iBeacon advertising but during I run the example it's actually only received adv packet from another mesh node. I'm not sure if this is how the example exactly works. Is the example could scan and print all ble adv packet or I need implement it myself ?

  • Hi,

    Going back to what output to expect from the example, this is the log I get when testing here (with a few BLE devices in the area):

    <t:          0>, main.c,  218, ----- Bluetooth Mesh Beacon Example -----
    <t:      13970>, main.c,  224, Initialization complete!
    <t:      18734>, mesh_app_utils.c,   65, Device UUID (raw): 073D03C4720B6745AB6E06D305F13C5E
    <t:      18737>, mesh_app_utils.c,   66, Device UUID : C4033D07-0B72-4567-AB6E-06D305F13C5E
    <t:      18748>, main.c,  253, Bluetooth Mesh Beacon example started!
    <t:      33706>, main.c,   87, RX [@1028329]: RSSI: -82 ADV TYPE: 4 ADDR: [c6:54:7a:9b:36:f8]: 0B0972757769646F20424C45
    <t:     133396>, main.c,   87, RX [@4070477]: RSSI: -92 ADV TYPE: 4 ADDR: [b7:34:ba:c7:52:04]: 020A0A1B094C452D426F736520436F6C6F7220494920536F756E644C696E6B
    <t:     192247>, main.c,   87, RX [@5866604]: RSSI: -81 ADV TYPE: 4 ADDR: [d2:9e:a7:a1:41:2c]: 020A080E094C452D72657365727665645F43
    <t:     314305>, main.c,   87, RX [@9591431]: RSSI: -89 ADV TYPE: 4 ADDR: [b7:34:ba:c7:52:04]: 020A0A1B094C452D426F736520436F6C6F7220494920536F756E644C696E6B
    <t:     605565>, main.c,   87, RX [@18480001]: RSSI: -84 ADV TYPE: 4 ADDR: [76:7b:a7:a1:41:2c]: 020A0816094C452D426F736520467265652048656E72696B6B65
    <t:     769199>, main.c,   87, RX [@23473756]: RSSI: -82 ADV TYPE: 4 ADDR: [d2:9e:a7:a1:41:2c]: 020A080E094C452D72657365727665645F43

    Comparing it to the log that you provided earlier, I see that the line numbers for corresponding log outputs do not match. Can you double check that you are using the unmodified example from the <SDK folder>/examples/beaconing/ folder? (With unmodified main.c in the src folder of that folder.)

    Regards,
    Terje

  • Hi Terje,

    I'm sure I'm using the unmodified files. Here's what I tried:

    I create two advertiser which advertising User Data, the first one advertsing the Local Name as well.

    When I enable either of them or both, only the one with Local Name can be found during scanning (ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344)

    <t:          0>, main.c,  218, ----- Bluetooth Mesh Beacon Example -----
    <t:      12870>, main.c,  224, Initialization complete!
    <t:      17601>, mesh_app_utils.c,   65, Device UUID (raw): 83C4140939D7514483FD76458708046C
    <t:      17605>, mesh_app_utils.c,   66, Device UUID : 0914C483-D739-4451-83FD-76458708046C
    <t:      17616>, main.c,  253, Bluetooth Mesh Beacon example started!
    <t:     113982>, main.c,   87, RX [@3478019]: RSSI: -86 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     175528>, main.c,   87, RX [@5356307]: RSSI: -86 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     299087>, main.c,   87, RX [@9127103]: RSSI: -88 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     360440>, main.c,   87, RX [@10999283]: RSSI: -89 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     362671>, main.c,   87, RX [@11067431]: RSSI: -64 ADV TYPE: 4 ADDR: [50:9c:36:34:2d:58]: 09094D4A5F48545F563105030F180A180916FFFFD65F151E817F
    <t:     428411>, main.c,   87, RX [@13073674]: RSSI: -72 ADV TYPE: 4 ADDR: [50:9c:36:34:2d:58]: 09094D4A5F48545F563105030F180A180916FFFFD65F151E817F
    <t:     483872>, main.c,   87, RX [@14766208]: RSSI: -88 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     516380>, main.c,   87, RX [@15758347]: RSSI: -63 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     525718>, main.c,   87, RX [@16043348]: RSSI: -66 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     535036>, main.c,   87, RX [@16327704]: RSSI: -61 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     544388>, main.c,   87, RX [@16613116]: RSSI: -63 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     545312>, main.c,   87, RX [@16641227]: RSSI: -87 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     563025>, main.c,   87, RX [@17181865]: RSSI: -67 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     572322>, main.c,   87, RX [@17465615]: RSSI: -67 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     581784>, main.c,   87, RX [@17754364]: RSSI: -78 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     591204>, main.c,   87, RX [@18041864]: RSSI: -69 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     600830>, main.c,   87, RX [@18335615]: RSSI: -73 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     607049>, main.c,   87, RX [@18525331]: RSSI: -87 ADV TYPE: 0 ADDR: [8a:08:6c:8d:cd:c0]: 0709534D492D4D31031900000201060F1695FE3120A1011D8A086C8DCDC00D
    <t:     610275>, main.c,   87, RX [@18623857]: RSSI: -63 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     619532>, main.c,   87, RX [@18906358]: RSSI: -63 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344
    <t:     628911>, main.c,   87, RX [@19192608]: RSSI: -63 ADV TYPE: 6 ADDR: [a4:e8:6c:8a:31:45]: 0E094F6E65506C757320372050726F07161C1811223344

  • Hi,

    I am able to reproduce. Looking into why this may be.

    Regards,
    Terje

  • Hi,

    The beaconing example, while documentation for "testing" states it prints all incoming packets and documentation for "RX callback" states it can receive all non-filtered packets, actually does use a filter on BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME. The callback will only be called for packets with this advertising data type in them.

    The filter is set in the function adv_start(), in main.c:

        /* Let scanner accept Complete Local Name AD Type. */
        bearer_adtype_add(BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME);

    The filter is employed for all packets before they get sent to the Scanner module, which again is responsible for calling the callback. You can read more about filtering in the Packet filtering API documentation.

    I have reported documentation bugs internally, for updating Beaconing example documentation to reflect the behavior of the example, as well as clarify the behavior of the Scanner in relation to Packet filtering in the Scanner API documentation.

    Regards,
    Terje

  • Hi Terje,

    It works! Many thanks for help. I must misundertand the description and thought it's for advertising but not receiving...

Related