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

Advertising failed to start (err -12)

Hi,

I am testing peripheral_hids_keyboard of NCS SDK 1.4.2

I have issues

1. where i can able to connect with windows and Android system but it is not visualize in MAC or IOS

2. I got issue Disconnected from 00:1a:7d:da:71:15 (public) (reason 21)
Advertising failed to start (err -12)

Parents
  • Hi,

    Have you tried CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y , like Carl suggested? You tried GATT, but I can't see that you tried HIDS.

    Did you follow Carl's advice: "... your advertising data may be bigger than the maximum of 31 bytes. Please check this." ? What did you find?

    You are using an old version of the sdk, have you considered upgrading to v1.6.0 and seeing if that fixes your issues?

  • Hi, I have enabled CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT

    This is my full prj.confg

    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=1
    CONFIG_BT_SMP=y
    CONFIG_BT_L2CAP_TX_BUF_COUNT=5
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_HIDS_keyboard"
    CONFIG_BT_DEVICE_APPEARANCE=961
    
    CONFIG_BT_BAS=y
    CONFIG_BT_HIDS=y
    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1
    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
    CONFIG_BT_GATT_UUID16_POOL_SIZE=40
    CONFIG_BT_GATT_CHRC_POOL_SIZE=20
    
    CONFIG_BT_LL_SOFTDEVICE_DEFAULT=y
    
    CONFIG_BT_CONN_CTX=y
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=y
    CONFIG_BT_DIS_MANUF="NordicSemiconductor"
    CONFIG_BT_DIS_PNP_VID_SRC=2
    CONFIG_BT_DIS_PNP_VID=0x1915
    CONFIG_BT_DIS_PNP_PID=0xEEEF
    CONFIG_BT_DIS_PNP_VER=0x0100
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y
    CONFIG_DK_LIBRARY=y
    

    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1

    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1

    this error occur during disconnect

    then i tried

    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=1

    CONFIG_BT_HIDS_MAX_CLIENT_COUNT=1

    If CONFIG_BT_MAX_CONN = 1 does i need to change any config or advertise packet  

  • You can not have CONFIG_BT_MAX_CONN=1 when you call advertising_start() from the disconnected() handler. That is why it is 2 by default.

Reply Children
No Data
Related