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

nRF52 Ble Peripheral Example - ble_app_blinky not showing led/button service

Hi I have run a few peripheral examples ok and now move to evaluation of ble_peripheral also.

I'm using this version of the SDK....

If I program the softdevice and then the application hex file into board using the files shown below the led 1 turns on as expected. 

Using rfConnect I can connect to "Nordic Blinky" and the led 2 turns on and led 1 turns off. However in the list of services I see there is not one showing for the Led/Button.

Using the blinky app for Android to connect I get a message indicating the "Device does not have the required services".

I checked the code in sdk_config.h to see if the service was enabled and this looks ok...

Looking at the help for the application at this link http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk%2Fdita%2Fsdk%2Fnrf5_sdk.html

I think I have done things correctly so I am now looking for some ideas/support to move forward please.

Regards MPH

Parents
  • Hi Martin

    It's quite peculiar that the example advertises and connects, but doesn't show the normal services. 

    Which services do you see when you connect through nRF Connect?

    Are you using nRF Connect for Android, iOS or desktop?

    Can you let me know which model and version of the kit you have, as printed on the white sticker?

    How are you flashing the kit? 
    Are you using nrfjprog, or one of the supported IDE's?

    Best regards
    Torbjørn

  • Hi Torbjørn

    I see these services using nRF Connect for Android..

    Generic Access, Generic Attribute, Blood pressure, Battery Service, Device Information.

    White sticker shows..

    PCA10040

    1.2.4

    2018.12

    682351679

    Flashing the kit by dragging and dropping the hex files onto the on-board drive.

    Also have Segger IDE installed and can build & program the project ok from there also.

    BR MPH

  • Also ran some of the other examples ok using nRF Toolbox fyi

  • Ok something has hosed the other ble_peripherals examples because I just tried loading the application hex files for the heart rate and temperature examples which previously worked but now using nRF Toolbox for Android I get reports back after connect that states "Device does not have the required services".

  • After my observation in the last reply I decided to download the latest SDK

    and de-install the nRF Toolbox, nRF Connect and nRF Blinky on my Samsung/Android phone and then re-install them.

     The observation is the same for the ble_app_blinky after using Segger IDE to build and run the project...

    Using rfConnect I can connect to "Nordic Blinky" and the led 2 turns on and led 1 turns off. However in the list of services I see there is not one showing for the Led/Button.

    Using the blinky app for Android to connect I get a message indicating the "Device does not have the required services".

    If I build some of the other examples including...

    ble_app_hts

    ble_app_hrs

    ble_app_proximity

    ble_app_hrs_freertos

    They appear to work with the nRF Toolbox app. However if I build the ble_app_rscs it does not appear  to have changed from the last application. Meaning if I scan using nRF Toolbox it finds that last application/config that was loaded into the DK.

    I also have a Thingy 52 and Android app installed on the same phone and that appears to work.

    Question: DO you have another example that uses the led/button service?

    BR Martin

  • Hi Martin

    I don't think we have any other examples using the led/button service, no. The main purpose of this service is to act as a simple example of a proprietary BLE service. 

    What model of phone do you have, and what Android version is it running?

    Do you have some other phone(s) available that you can test with?

    Alternatively, do you have another nRF52 or nRF51 kit?
    Then you can use the nRF Connect Desktop application to connect to your kit from the PC, rather than using the phone apps. 

    Another thing to try is to run a full chip erase before flashing one of the examples, to make sure that you have removed any traces of the old examples. 

    This can be done either by running "nrfjprog --eraseall" in a command line, or by running "Target -> Connect J-Link" and "Target -> Erase All" in Segger Embedded Studio. 

    Best regards
    Torbjørn

  • Hi Torbjørn

    Well I was hoping the Android App would work on my phone (Samsung Galaxy SM-A520F) or you may have a fix but it seems to be not that robust. So I borrowed an iPhone 5 and Blinky app works on that. I'll get a backup Apple device but the question is how to fix Android App for a wider coverage?

    Thanks and have a great weekend.

Reply Children
  • Hi Martin

    I can report the issue to our app developers and see if they have some input. 

    Can you check what Android version the phone is running?

    I am using the app on a number of Android devices without any issues, but we mostly test the app on high end devices like the Nexus phones, Samsung Galaxy S phones and similar. 

    Best regards
    Torbjørn

  • Hi Torbjørn

    The Phone has Android 8.0.0 loaded.

    I also downloaded Blinky app from GitHub and it compiles ok but when i get to debug on my phone the App closes shortly after attemtping to run.

    The reason for wanting to use this more simplistic App and embedded project is to use it as a basis for modification with out too many variables etc.

    BR Martin and thanks

  • Hi Martin

    One thing we could try is to change the BLE address, and see if it improves the situation. Some phones could have issues reconnecting to a device with the same BLE address if the services change. 

    To try this out please add the following code to the gap_params_init() function of the blinky example:

    ble_gap_addr_t ble_address = {.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC,
                                                      .addr_id_peer = 0,
                                                      .addr = {0xC3,0x11,0x22,0x33,0x44,0xFF}};
    err_code = sd_ble_gap_addr_set(&ble_address);
    APP_ERROR_CHECK(err_code);

    Best regards
    Torbjørn

  • Hi Torbjørn

    That is a positive change as the Blinky App now discovers the services ok, thank you very much. I can see the change of button state but if I toggle the LED using the App it has only worked once. Meaning repeated toggling has no effect and the LED is Off.

    If I use nrf Connect to toggle the LED that appears to work along with reading the button state.

    BR Martin

  • Hi Martin

    It is good to hear that you have had some progress. 

    Are you running the Blinky App in the Android debugger?

    It would be interesting to see the ADB log when you are trying to toggle the LED, to see if it has any information that might be related to the issue. 

    Best regards
    Torbjørn

Related