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

NRF8001 Attempting to add Custom Services

Hi,

I'm using a NRF8001 shield with an Arduino Leonardo, everything connection wise seems to be working. I'm using the "ble_my_project_template" and uploading various services.h files from other demos. I can see on my iPhone that the BLE devices shows up as a temperature monitor, UART, etc.

My problem is that I have been building my own services.h file using the nRFgo Studio and it compiles and uploads to the arduino (and supposedly the nrf8001) but only the name of the device changes. The available services and characteristics do not change.

My end goal is to build a set of custom Services to allow the iPhone to connect to the ble device and read sensor data. Is there an obvious reason why I can't update the services.h? Is there some sort of tutorial for this?

Thanks,

Matt

  • Hi,

    It could be that iOS is buffering the services and characteristics of your device and therefor does not perform a service discovery when you reconnect, despite the fact that your device has changed it's name. As far as I have seen you can force iOS to perform a new service discovery by turning ble off/on. Another option would be to add the service changed characteristic. If this is present iOS will do a new service discovery (Note that you will have to turn ble off/on the first time you connect to the device after you add this characteristic).

    Regards,

  • You can use the nRFgo studio version 1.16.1 to add the Service Changed Characteristic in nRF8001 Configuration -> GAP Settings -> Advanced GATT Settings Select the option "Add Service Changed Characteristic".

    Otherwise you can switch off and on Bluetooth as RS above suggested and it should update the cached Services and Characteristics.

    Additionally when you are using the nRFgo studio to build your services and characteristics, remember to run the run_me_compile_xml_to_nRF8001_setup.bat to convert the xml file from nRFgo studio to the services.h and services_lock.h OR use the nRFgo studio -> Generate Source files -> Generate only services.h

    Let me know how it works for you.

  • On a more basic level, make sure your new services are added to nRFgo's "Local (GATT Server)" column and not the "Remote (GATT Client)" column. It originally didn't occur to me that I could be specifying services that the nRF8001 wouldn't itself be providing, so the distinction was lost on me the first time I did this.

  • iOS Buffering was the problem. Thanks for the help!

Related