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

Coexistence between pyACI and DFU

Hi,

We are currently implementing a mesh application that is expected to have a large number of mesh devices. We have already tested DFU on a smaller mesh and it is working well with our application. However, we want to use a serial provisioning through pyACI since there is a device connected to a computer, this device was in charge of starting the DFU and sending the new firmwares through the mesh.

We have seen there are some serial commands related to DFU in the documentation and they are implemented in some methods of the interactive pyACI (aci_cmd.py) but we can't find any documentation on how to use those methods. We used to do DFU through the nrfutil mesh version while collecting the mesh sensors data, and would like to have similar functionality using serial commands.

We have seen a couple of answers in this forum suggesting that this behaviour is achievable, like this.

We would like to know if it is possible to carry out DFU through the pyACI application or if there is a better approach and if there is any documentation available.

Thank you

  • Hi.

    We would like to know if it is possible to carry out DFU through the pyACI application

     I do not think that this is possible.
    PyACI is to interface with a mesh node with Bluetooth Mesh. The DFU interface is a litle bit different, it uses broadcast mesh.
    It might be possible to modify the serial firmware to support DFU and then modify the python ACI to access that.

    I've forwarded your inquiry to our Mesh team, so that they can comment on what they think is the best approach for this.

    Best regards,
    Joakim.

  • Thank you for your answer.

    Even if the pyACI script does not implement any DFU functionality, there are several serial commands that have to do with DFU, such as opcode 0xd1, as well as commands that have to do with OpenMesh broadcast. So we think there has to be some way to use those commands to update the mesh devices firmware or at least some planned future functionality.

    It might be possible to modify the serial firmware to support DFU and then modify the python ACI to access that.

    We have found some documentation on the DFU process and it seems that it is possible to implement the functionality following this specification, but it is not trivial and we do not want to spend the necessary effort until we know if it is the way to go.

    In short, we would like to know the way Nordic recommends to update the firmware of a mesh with a large number of devices that needs an interface with a computer to work.

    We look forward to the answer from the mesh team.

  • Hi.

    I've got some feedback from our Mesh team;

    For the transport part, it shouldn't be too hard for someone that’s proficient in Python.

    All the mesh DFU transport logic is contained in one file:
    https://github.com/NordicSemiconductor/pc-nrfutil/blob/mesh_dfu/nordicsemi/dfu/dfu_transport_mesh.py

    The logic is quite shallow, and most of the complexity in this module comes from building packets and handling responses correctly.
    The response handling is already handled by pyACI, and the packet building is easy to copy from one of the existing pyACI modules.

    The tricky bit might be handling of the DFU package objects. You will need this for generating the signature and storing all the metadata. But you could do this with the existing script (as that generates a .zip that you can move around), and simply copy over the modules that parses the zip file contents. Since this part is disconnected from the transport code, it can be copied over more or less as-is without interfering with the rest of pyACI.

    Note that pc-nrfutil is implemented in Python 2.7, which could generate some compatibility issues, particularly around packing/unpacking the .zip-file and its contents.

    Hope that is helpful for you.
    Best regards,
    Joakim.

Related