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 Reply Children
  • 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

  • Hi Torbjørn

    I think this has helped uncover the issue. What I notice is if I put my finger on the LED slider control and move from left to right or right to left, I don't see the LED status change. If I tap the slider at either end I see the LED toggle ON/OFF ok ;-)

    You can see these two types of behaviour in the log below. Firstly I tap the slider and you see LED OFF response and then I tap the other end of the slider and the response is LED ON. After that I slide my finger across the slider and then the status does not change, only the ViewPosttime pointer 0 or 1 message is shown.

    It's quite a small slider on my phone and of course it gives the impression that toggle LED ON/OFFcommand is handled through ok through visual feedback on the slider object.

    D/BlinkyManager: Turning LED OFF...
                     Writing characteristic 00001525-1212-efde-1523-785feabcd123 (WRITE REQUEST)
                     gatt.writeCharacteristic(00001525-1212-efde-1523-785feabcd123)
    D/BlinkyManager: Data written to 00001525-1212-efde-1523-785feabcd123, value: (0x) 00
                     LED OFF
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 0
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 1
    D/BlinkyManager: Turning LED ON...
                     Writing characteristic 00001525-1212-efde-1523-785feabcd123 (WRITE REQUEST)
                     gatt.writeCharacteristic(00001525-1212-efde-1523-785feabcd123)
    D/BlinkyManager: Data written to 00001525-1212-efde-1523-785feabcd123, value: (0x) 01
                     LED ON
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 0
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 1
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 0
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 1
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 0
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 1
    D/ViewRootImpl@1cda049[BlinkyActivity]: ViewPostIme pointer 0

    Thanks for this I will now move forward and add some customisations to the App and embedded control.

    BR Martin

Related