Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

S140 6.0.0 SCANNING ISSUE

Hi All!

Faced with big problem with SCANNING procedure (nRF52840)

We have a BLE network : one CENTRAL and up to 6 PERIPHERALs can be connected simultaneously to the CENTRAL.

Advertising period of Peritherals is 1 second.

THE PROBLEM:

if no connected devices, CENTRAL report "BLE_GAP_EVT_ADV_REPORT" occur each 1 sec very STABLE.

if connections established, CENTRAL report "BLE_GAP_EVT_ADV_REPORT" very not stable sometimes with 5..6 seconds delay , depends on conenction count.

SCANNING PARAM:

#define _SCANPARAM_ {                                         \
    .active   = 1,                                            \
    .interval = (uint16_t) MSEC_TO_UNITS(20, UNIT_0_625_MS),  \
    .window   = (uint16_t) MSEC_TO_UNITS(20, UNIT_0_625_MS),  \
    .timeout          = BLE_GAP_SCAN_TIMEOUT_UNLIMITED,       \
    .scan_phys        = BLE_GAP_PHY_1MBPS,                    \
    .filter_policy    = BLE_GAP_SCAN_FP_ACCEPT_ALL,           \
}

CONNECTIN PARAM:

#define _CONN_PARM_PREFF_ {
         .min_conn_interval = (uint16_t) MSEC_TO_UNITS(65, UNIT_1_25_MS), \
         .max_conn_interval = (uint16_t) MSEC_TO_UNITS(65, UNIT_1_25_MS), \
         .slave_latency     = 0,                                          \
         .conn_sup_timeout  = (uint16_t) MSEC_TO_UNITS(1000,UNIT_10_MS) } \

HOW to provide stable ADV report during CONNECTIONs or it is IMPOSSIBLE ?

waiting for answer.

Parents Reply Children
  • Hi Edvin,

    I tested > 100  variants, in my case, stable result only with use;

    .interval = 3200 , .window  = 2615

    all other cases work very unstable (10/10, 20/20, 0xfff/0xfff, 3200/3200, 3200/2000, etc ....) 

    Please, exlain how it does work.

    .. also, I find after ~ 2 minutes , Scanning again becomes unstable until RESET...

  • Hello,

    Sorry for the late reply. I just wanted to let you know that I have to check what the softdevice does with the scanning when it is in a connection, and gets a connection event within the scan interval. I am not sure whether it resumes the scanning afterwards, or if it waits for the next scan interval to resume the scanning.

    I will come back to you as soon as I know anything.

     

    BR,

    Edvin

  • Hello,

    Please see Section 15.4 in the S140 v6 SoftDevice Specification.

     

    Also note that there have been some issues with a too long scanning interval. Set it below 16.7 seconds to be sure.

     

    But as you see in section 15.4 (Scheduling -> scanner timing), if you set the scan window longer than:

    Scan window = connection interval - ( Σt_[connection event] + t_[scan_reserved]) you may loose a connection event, resulting in a lost connection unless you have slave latency.

     

    You can try to increase your advertising interval to increase the chance of detecting an advertisement. This will cost a bit more power while advertising, but that is a cost of increasing the chance to be detected sooner. 

     

    Advertising and scanning is not a way of communication that is guaranteed to be detected at once, since the communication is not synchronized. See the advertising and scanning timing scheduling in the SoftDevice Specification.

     

    Best regards,

    Edvin

Related