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

Enabling Indications in Buttonless Secure DFU Service Without Bonds

Referring to the Nordic message sequence chart in the following link:

https://infocenter.nordicsemi.com/index.jsp

(Software Development Kit -> Previous Versions of nRF5 SDK -> Libraries -> BLE Services -> Buttonless Secure DFU Service-> Buttonless Secure DFU Service without bonds)

After writing a "1" into the characteristic UUID of the Buttonless Secure DFU Service Without Bonds,

We would like to know whether writing a "2" or a "1" would set indications to be enabled?

So in terms of using bluepy (running this with python on Raspberry Pi 3), it would be written either like this:

peripheral.writeCharacteristic(cccd_handle, b"\x02\x00", withResponse=True)

or 

peripheral.writeCharacteristic(cccd_handle, b"\x01\x00", withResponse=True)

Basically after writing a "1" to the characteristic UUID (of 0x8EC90003-F315-4F60-9FB8-838830DAEA50 for Buttonless DFU without bonds)  the documentation is quite vague on how to go about verifying whether writing the "1" was successfully able to place the target remote sensor into DFU mode.

Could you please clearly describe the necessary steps to put a target sensor into DFU mode ?

 

  • Hello,

    You can experiment with this by using the nRF Connect for Desktop, or nRF Connect for mobile (Android/iOS). 

    Using nRF Connect for Desktop, you can use the "play button" next to the service that you want to enable notifications or indications:

    The play button will become a square, and the Client Characteristic Configuration will change the value. If a characteristic supports notifications, the Client Characteristic Configuration Description (CCCD) will have the value 0x0001, and if the characteristic supports indications it will be 0x0002. A characteristic can not support both notifications and indications.

    The Buttonless DFU characteristic in particular supports indications, so you would want to write 0x0002 to the CCCD (not the buttonless characteristic itself) to enable indications.

    To activate the DFU mode, you want to write 0x01 to the characteristic UUID (0x8EC90003-F315-4F60-9FB8-838830DAEA50). You can test this as well in nRF Connect for Desktop/Mobile. If you are using a DK, you should see that LED1 and LED2 will turn on after you write 0x01 to this characteristic, and the device should start advertising as "DfuTarg".

    Best regards,

    Edvin

  • Thanks for the info and,

    To clarify, the user needs to place and click the mouse cursor within the bright pink rectangle area highlighted below, in order to successfully "click and modify (and type "0001") into the characteristic UUID to activate the DFU mode of the target sensor, after clicking the "play" button to the right of the text "Buttonless Secure DFU without bonds" - then and only then , would the target sensor reboot into the bootloader and from there advertise "DfuTarg" with the corresponding previous MAC address incremented by 1 i.e. the last octet to the right +1

  • Hi Edvin,

    How do you go about implementing this correct sequence to toggle the remote sensor to broadcasting DfuTarg like in using bluepy in python for example?

  • I am in no way an expert on python. Remember that we work mostly with C programming. Perhaps try something like this:

    https://github.com/IanHarvey/bluepy/pull/151

    I have never touched bluepy before, so I have no idea whether this is correct. But if you can use this to get services and characteristic, you should be able to follow the same logic using bluepy.

    Note that if you hover the mouse over the "Secure DFU" and "Buttonless Secure DFU without bonds" in nRF Connect, it will show you the UUID of the service/characteristic.

Related