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

  • Hi Torbjørn

    Quick response = Yes your summary is correct in the last mail.

    Thanks

    BR Martin

  • Hi Torbjørn

    Here is a debug log I just recorded in the attached txt file.

    I used Notepad++ to highlight and mark all nrfblinky fyi.

    BR Martinblinkycrash.txt

  • Hi Martin

    A comment from the app developer was to disable instant run in the Android Studio settings. Can you try that and see if debugging works?

    Regarding the app he suggested trying the develop branch rather than the master branch, to see if it fixes the issue with the missing LED update:
    https://github.com/NordicSemiconductor/Android-nRF-Blinky/tree/develop

    Please give it a go and see if it helps. If it doesn't I will do more testing on my end to get to the bottom of the issue. Unfortunately I won't be able to continue this until next week, as I am going on a business trip for the next couple of days. 

    Best regards
    Torbjørn

  • Hi Torbjørn

    Disabling Instant Run prevents an App Instant Crash, thanks for that. Now I check the latest with the develop branch.

    Have a good trip.

    BR Martin

  • Hi Torbjørn

    So I synced with the develop branch and ran the application in debug mode but the LED behaviour is the same. So the LED is not controlled successfully from the Android App, only occasionally does it work.

    BR Martin

Reply
  • Hi Torbjørn

    So I synced with the develop branch and ran the application in debug mode but the LED behaviour is the same. So the LED is not controlled successfully from the Android App, only occasionally does it work.

    BR Martin

Children
  • Hi Martin

    Can you let me know the version and date string printed on your development kit?
    This should be visible on the square, white sticker. 

    I have an older kit that exhibits the issue, and a newer one that does not. 

    Best regards
    Torbjørn

  • Hi Torbjørn
    I have PCA10040, 1.2.4, 2018.12, 682351679 printed on the white sticker on the dev board chip.
    BR Martin
  • Hi Martin

    That's newer than both my kits, so I guess the old kit theory goes out the window ;)

    Do you have the log enabled while running the example?
    It would be interesting to know if the command is actually received or not. 

    With the log running you should see a message whenever the LED is turned on or off. 

    Best regards
    Torbjørn

  • Don't forget I had the observation that nRF Connect App works. Meaning toggling the LED works every time. So I suspect the nRF Blinky App is at fault somehow.

    BR Martin

  • Hi Martin

    Apparently there is a trick to getting more logging info from the Blinky app. 

    In the BlinkyManager.java file, please add the following function to the BlinkyManager class:

    @Override
    public void log(int level, @NonNull String message) {
    super.log(level, message);
    Log.d("BlinkyManager", message);
    }

    Then you should see log messages when the app sends data to the peripheral, and when the writeCharacteristic callback is triggered, which means the data was successfully sent. 

    The log should look something like this if everything works correctly:

    10-09 11:03:33.038 21893-21893/no.nordicsemi.android.nrfblinky D/BlinkyManager: Turning LED OFF...
    10-09 11:03:33.290 21893-21925/no.nordicsemi.android.nrfblinky D/BlinkyManager: LED OFF
    10-09 11:03:33.928 21893-21893/no.nordicsemi.android.nrfblinky D/BlinkyManager: Turning LED ON...
    10-09 11:03:34.263 21893-21907/no.nordicsemi.android.nrfblinky D/BlinkyManager: LED ON
    10-09 11:03:34.582 21893-21893/no.nordicsemi.android.nrfblinky D/BlinkyManager: Turning LED OFF...
    10-09 11:03:34.849 21893-21907/no.nordicsemi.android.nrfblinky D/BlinkyManager: LED OFF

    Can you give this a try and see if the results are similar?

    Best regards
    Torbjørn