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

Incorrect Services on Services Tab of nRF Connect Mobile

I'm trying to test out some of the BLE examples on the nRF 51 DK and I'm getting some strange results on the nRF Connect app. When I run the heart rate example, everything appears correctly and works correctly, but when I switch to the health thermometer example, things seem to screw up. When I am running the health thermometer example, the scanner page of the app shows the correct device name and the correct services, but it thinks the type is a heart monitor. On the services page, it shows the correct services in the advertised services section, but it shows the heart rate stuff in the attribute table. 

Between each attempt of each program, I make sure to wipe the board by typing "nrfjprog --family nRF51 --eraseall" into the command prompt. I'm not sure if I'm doing something wrong, but I can't seem to get the other example to work.

https://imgur.com/vgzhqmK

https://imgur.com/QLJCa8S

Parents
  • Hello,

    FYI: It is possible to upload pictures here on DevZone. Just click Insert-> Insert file, and browse to it. Alternatively, you should be able to drag'n'drop them.

    If you flashed another project but the old service is still popping up, it sounds like your phone has cached the BLE services of your device. This is done on the OS, so nRF Connect for Andorid/iOS can't really refresh this. What helps in most cases is to turn bluetooth completely off on your phone, wait for a couple of seconds and turn it back on. This should delete the stored BLE services, and it will do something called a service discovery once more the next time you connect to it. 

    NB: If you intend to add a service to a BLE product during the lifetime of the product, you should include something called the Service Changed service. This is a special service used to tell the phone that it has updated the BLE services, and force the central to do a new service discovery. But this may not be relevant at this point in time for you. Just a "nice to know" on how it is done in most BLE products on the market. One example that includes this is the ble_app_buttonless_dfu example from the SDK. Note that this service needs to be included in the first FW on the product, in order for the central device to know that it is there in the first place (it is a recursive thing).

    Try to turn on and off the phone's Bluetooth, or try with another phone, and let me know if it doesn't help. Alternatively, if you have a spare DK/dongle, you can try with nRF Connect for Desktop, which doesn't cache the services.

    Another workaround for this is to manually change the BLE address of your device, to make it appear as a new device for the phone. The central will always do a service discovery on new devices. 

    Best regards,

    Edvin

Reply
  • Hello,

    FYI: It is possible to upload pictures here on DevZone. Just click Insert-> Insert file, and browse to it. Alternatively, you should be able to drag'n'drop them.

    If you flashed another project but the old service is still popping up, it sounds like your phone has cached the BLE services of your device. This is done on the OS, so nRF Connect for Andorid/iOS can't really refresh this. What helps in most cases is to turn bluetooth completely off on your phone, wait for a couple of seconds and turn it back on. This should delete the stored BLE services, and it will do something called a service discovery once more the next time you connect to it. 

    NB: If you intend to add a service to a BLE product during the lifetime of the product, you should include something called the Service Changed service. This is a special service used to tell the phone that it has updated the BLE services, and force the central to do a new service discovery. But this may not be relevant at this point in time for you. Just a "nice to know" on how it is done in most BLE products on the market. One example that includes this is the ble_app_buttonless_dfu example from the SDK. Note that this service needs to be included in the first FW on the product, in order for the central device to know that it is there in the first place (it is a recursive thing).

    Try to turn on and off the phone's Bluetooth, or try with another phone, and let me know if it doesn't help. Alternatively, if you have a spare DK/dongle, you can try with nRF Connect for Desktop, which doesn't cache the services.

    Another workaround for this is to manually change the BLE address of your device, to make it appear as a new device for the phone. The central will always do a service discovery on new devices. 

    Best regards,

    Edvin

Children
No Data
Related