After the Bluetooth mesh dfu is completed, the distribution network information of the node is cleared

I have implemented DFU functionality in my Bluetooth mesh project and used device A as the distributor and device B as the node to be updated. I have already configured both devices and they can communicate with each other. Then I use the distributor to send new firmware to the node. After the node firmware is successfully updated, the original distribution network information of the node is cleared. At this point, the distributor and the node cannot communicate and need to manually reconfigure the distribution network. How can the original distribution network data be retained during DFU updates?

Parents Reply
  • Hi, 

    llly said:
    The problem to be solved now is that after adding the manufacturer's custom model, the hash value in the automatically generated upgrade package is different from the calculated hash value

    Please let me clarify this, when you change the manufacturer custom model, the hash is different and you have to do re-provisioning, correct ? 
    Then I don't see it as an issue. This is how it's defined in the Bluetooth specification. When the composition data is changed, the device has to be reprovisioning. 


    I'm not so sure what can be a workaround here, as it's something needed for the provisioner to know what your device now have. Manually changing the hash value is not the way to go here as it a bad hack in my opinion and will cause a trouble. 

    Could you explain the change you have in the composition data ? Do you plan to have that change very time you do DFU ? 

Children
  • Not adding new models after updating, but choosing whether to add vendor customized models before compilation

    I am testing. If the vendor custom model is not added to the code, everything will be normal. If a vendor defined model is used in the code, the hash values in the upgrade package automatically generated by NCS will be different.

    But in actual projects, I need to use vendor custom models, whether before or after updates, so I am not adding vendor custom models through DFU.

  • Hi Illy, 

    Let's call the current firmware running on the device is A. The new firmware you compile to do DFU update is B. 
    What change to do you make to B ? When it work when it doesn't work ? 

    If you add the vendor customized to A when you build A and flash to the device. Do you have any problem when you update the firmware and build B ? 

    I don't see the reason why hash value change if you don't change the model/composition data. 

  • Firmware B only modified the version number to check if the DFU was successful.

    When adding a custom model, the hash in the upgrade package when building a is already incorrect, rather than obtaining the wrong hash after making other modifications to the firmware

    In the simplest terms, adding a custom model will result in incorrect hash values,this no longer requires DFU to verify

    The screenshot above shows the upgrade package obtained after adding the manufacturer's custom model. It can be seen that "composition_hash" is 0xdb33f61b,this is an incorrect value

    This image is the hash value I manually calculated using the shell command. The correct hash value should be 0xbcce424f

    As long as there is a custom model, the problem of obtaining different hash values through two methods will occur, which has nothing to do with the DFU process and is a problem that occurs during construction.Is my description clear enough?

Related