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

DFU compatibility for a mesh example

Hi,

I am interested to know how to make a mesh node (for example, a light server) compatible to perform a DFU.

I have gone through the DFU page and I noticed that the DFU is done over the Serial port. I understand that the dfu firmware is being replaced with blinky firmware. Correct me if I am wrong.

Now, what changes should I make to the commands inorder to make the light_server example node to be DFU compatible/capable over the air?

Would replacing the application hex file on step 8 to light_server instead of dfu solve it? or should I add any other commands to have light_server firmware first?

Thank you.

Parents
  • Hello,

    well. The short answer is that you need the mesh_evt_handler() to handle DFU packets, like it does in the DFU example. In addition, if you want the device to handle Serial DFU (the one who receives the packets from nrfutil), you need it to support serial DFU as well. 

    This is done in nrf_mesh_serial_init(NULL); in mesh_init(void).

    Inside this call, serial_handler_dfu_init() is called, which handles the DFU serial messages.

    When you try to include the DFU packets (over Mesh) you will probably have to include everything you need around as well. Give it a go, and let me know if you get stuck.

    BR,

    Edvin

  • Hi,

    The short answer is that you need the mesh_evt_handler() to handle DFU packets, like it does in the DFU example.

    I notice that nrf_mesh_evt_handler_t is used in only few examples like EnOcean, light switch provisioner, Lpn examples. 

    So, in order to make other examples DFU capable, I need to add the nrf_mesh_evt_handler while mesh initilization.

    Give it a go, and let me know if you get stuck.

    If I am trying to push the dfu packets over the air but not serial, I should push it from the nrf connect app right? or can we do it from the mesh app? Sorry but I have no idea about how to push it OTA!!

    Thank you.

  • Thanks for a detailed reply.

    Next question would be, Does the keys affect the DFU? 

    To elaborate my question, does the device page generation has dependency on the keys(private, public)? 

    If yes, can I have a device page generated with a set of keys and successfully perform firmware update with the DFU.zip created with a different set of keys? 

    Thank you.

  • You can test these things. Just flash two devices with device pages with different keys and different application IDs. Then you will see the behavior.

  • I did run the test with just one board which has the device page with a set of keys and pushed an update to it with different set of keys and it failed.

    As we discussed in the previous thread about the changes made to the UART that caused failure in pushing the DFU, how to push the update for an application which uses UART(requires changes to few files)?

  • Just use the dfu example from an unmodified SDK_for_mesh_3.1.0 and SDK15.2.0. Remember that some files are common for the different projects, so changing them from one project may affect other projects.

    Go back to where you have a working dfu procedure, so that you know everything is working, and try to generate two different device pages with different keys. Then push the DFU image to a device with key1, and you will see that the device with key2 is updated.

    Spoiler:

    I tested it. It works.

  • I tried it the same way. My setup was something like this:

    board 1 -- device page 1(key1)

    board 2 -- device page 2(key2)

    boards 3,4,5 -- device page 3(key3)

    created the DFU packet with key1 and pushed it to board 1.

    The result is board 1 gets updated with Blinky. 

    boards 2, 3, 4 and 5 indicate that the DFU event ended (LED's 1 and 2 are on)

    Please find the picture below (boards 1 and 2) showing the result:

    I tested it. It works

    When you say it works, did you mean that the board two was also updated with Blinky or just that the packets were pushed successfully but board 2 wasn't updated because of different device page?

    Thank you.

Reply
  • I tried it the same way. My setup was something like this:

    board 1 -- device page 1(key1)

    board 2 -- device page 2(key2)

    boards 3,4,5 -- device page 3(key3)

    created the DFU packet with key1 and pushed it to board 1.

    The result is board 1 gets updated with Blinky. 

    boards 2, 3, 4 and 5 indicate that the DFU event ended (LED's 1 and 2 are on)

    Please find the picture below (boards 1 and 2) showing the result:

    I tested it. It works

    When you say it works, did you mean that the board two was also updated with Blinky or just that the packets were pushed successfully but board 2 wasn't updated because of different device page?

    Thank you.

Children
Related