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

  • Hi Martin

    That's an interesting find!

    I double checked it myself and see the same issue here. For some reason I only ever click it, and I guess the same goes for the developer ;)

    I reported it to the apps guys, and they opened an issue on the github:
    https://github.com/NordicSemiconductor/Android-nRF-Blinky/issues/13

    Knowing their turnaround time we should have a fix out pretty soon Slight smile

    Best regards
    Torbjørn

  • Hi Again

    I now have a real requirement to build a demo app which uses the nRF52 kit. So I have revisited this Blinky example again and have been able to build in additional funcionality like handling more buttons and leds. In fact this modified Blinky already does >60% of what I expect to need for the demo. However, this is ok for boolean types but I need to add some more variables (say 6) like integer and possibly float. These would typically just need to be sent from the embedded end.

    I was contemplating adding more functionalty to accomplish this but would like to know your recommendations. For example is it easy to add this to the Blinky example or should I be looking at another example. Of course I have a "Thingy" (nice job) but that is doing a lot and it could me quite sometime to figure out how to extract what I need. So I am trying to work with efficiency in mind and coming from the fact I am not a regular user of the underlying BLE software just now.

    BR Martin

Related