Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

advertising continuous issue with nrf52832

该产品是低功耗定制产品。除了处于连接状态或sd_power_system_off()状态之外,它还会在其他状态下持续通告。该软件项目基于...\ NR F5 _ SDK \ NR F5 _ SDK _ 17 . 0 . 2 _ d 674 DDE \ examples \ ble _ peripheral \ ble _ app _ UART。

work environment:  sdk17.0.2   nrf52832 as peripheral \ nrf52840 as central

nrf52832 connect parameter:

#define APP_ADV_INTERVAL MSEC_TO_UNITS(100, UNIT_0_625_MS)
#define APP_ADV_DURATION 18000

#define APP_BLE_OBSERVER_PRIO 3
#define APP_BLE_CONN_CFG_TAG 1

#define MIN_CONN_INTERVAL MSEC_TO_UNITS(80, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(300, UNIT_1_25_MS)
#define SLAVE_LATENCY 0

#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)
#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000)
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000)
#define MAX_CONN_PARAMS_UPDATE_COUNT 3

void advertising_init(void)

{

...

init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = false;
init.advdata.include_ble_device_addr = false; 
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]); 
init.advdata.uuids_complete.p_uuids = m_adv_uuids; 
init.advdata.p_manuf_specific_data = &manuf_data;


init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
init.config.ble_adv_on_disconnect_disabled = false; 

...

}

The question:

1. Can the above settings realize continuous broadcasting except for connection, working state and deep sleep? If not, how to set?

2. Sometimes central cann't scan a device after central disconnect the device. It seems to be connected by a central. By mobile phone, it is easy to reappear.

The process is as follows:

central: Redmi9, android 10, nrf connect app.

step 1:  connected the first device(nrf52832) in NRF connect app, then DFU, then disconnected the device.

step 2:  connected the second device(nrf52832) in NRF connect app, then DFU, then disconnected the device.

step 3:  connected the thirst device(nrf52832) in NRF connect app, then DFU, then disconnected the device.

repeat the above step.  Nrf connect app of central cann't scan the above ten devices after doing about ten steps. App can scan the device after Have to reboot the phone. Why?

Note:The phone is not set to connect automatically. And it is not set to bond.

搜索

复制

Parents
  • Hi Sunwell, 

    1. The configuration you provide has a timeout. You may want to try setting

    init.config.ble_adv_fast_timeout = 0 ; 

    and 

    init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE

    2. Please use a second phone /central to double check if the peripherals actually doing advertising or if for some reason the phone re-connected to the peripherals. 

  • Thank you for your reply.

    1. I've tried to set it as you said. The custom device need enter deep sleep to get  a lower power consumption. And  using an external interrupt causes a wakeup from power system off.  Can it  sleep deeply by calling sd_power_system_off() to reduce power consumption in BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE?    

        Another,  how to restart advertising in BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE when advertising timeout?

    2.I used a second phone to double check. Same Issue as above.  I don't think the phone with nrf connect app has actual disconnected with peripherals  though nrf connect app  showed disconnected. Because indication led of peripherals  flashs when the phone reboot.

        So, how to disconnect the peripherals actually by api function of central?

Reply
  • Thank you for your reply.

    1. I've tried to set it as you said. The custom device need enter deep sleep to get  a lower power consumption. And  using an external interrupt causes a wakeup from power system off.  Can it  sleep deeply by calling sd_power_system_off() to reduce power consumption in BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE?    

        Another,  how to restart advertising in BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE when advertising timeout?

    2.I used a second phone to double check. Same Issue as above.  I don't think the phone with nrf connect app has actual disconnected with peripherals  though nrf connect app  showed disconnected. Because indication led of peripherals  flashs when the phone reboot.

        So, how to disconnect the peripherals actually by api function of central?

Children
  • Hi again,

    1. When you call sd_power_system_off() it doesn't matter which way of advertising or what you are doing with your chip, the chip will shutdown and will do nothing except for waiting for waking up from the interrupt. 

    When it wake up it will reset and booting up.

    When you set the timeout to 0 , there will be no timeout. 

    2. There is a chance that other app on the phone still connect to it. This mean if that happens and you disconnect from the nRF Connect app, the phone will not disconnect. Please try to test connect/disconnect without DFU. Please also try to test DFU with the DFU app in the nRF Toolbox instead of nRF Connect. 

Related