Maximum Services and Characteristics

Hi there Wave,

I am building a prototype ble device. For this I'm currently using a nRF52840 dongle and using https://github.com/google/bumble.

We're currently hitting some limits: I have added about 175 characteristics and on most Android devices, it times out while trying to discover services & characteristics.

I'm not really seeing any errors on the dongle.

Are there hardware limits? How could I investigate if I am hitting memory limits due to the sheer amount of Services & Characteristics or if it's something else?

Kind regards

Parents
  • Hi Elias

    It is very unusual to have such a large number of characteristics. Most BLE applications use a handful of services, with a couple of dozen characteristics max. 

    Since this must be a proprietary service I would recommend trying to reduce the number of characteristics, by integrating more functionality into each one. Each additional characteristic will increase memory consumption both on the client and server side, and will also slow down the service discovery process. 

    Are there hardware limits? How could I investigate if I am hitting memory limits due to the sheer amount of Services & Characteristics or if it's something else?

    I doubt this is a hardware limitation. Theoretically you can have 65k attributes in the GATT protocol, where each characteristic typically consists of 2-4 attributes, but as I mentioned it is very rare to set up a service with hundreds of characteristics. 

    Are you getting any error messages on the app side, if you check the debug log? 

    In the end I think it will be hard to get a consistent and reliable experience if you use such a large number of characteristics, as every phone might have a different limitation depending on available memory etc. 

    Best regards
    Torbjørn

  • Could you point me to the docs regarding how to capture this debug log? Thank you.

  • Hi

    I assumed you were developing your own app, but maybe that is not the case? 
    When running an app from Android Studio you can get log output as described here.

    If you run the nRF Connect app you can also get logging in the app by sliding to the right after you have connected to a device. Change the log level to "DEBUG" for a more detailed log. 

    Best regards
    Torbjørn

  • Ind we are, and with proprietary services. I thought you meant reading logs on the nrf usb board.

Reply Children
Related