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

OTA Mesh DFU Example

I see there is a serial bootloader dfu example, however I am unable to find an OTA Mesh DFU example.

How can I exercise the Mesh DFU OTA (not via serial connection) in side-by-side mode?

Is the DFU quick start guide in the info center supposed to use a usb-serial device (nRF52 PCA11040 in my case) to actually issue the Mesh OTA update to a non-serial device?  It looks like that may be the case, but it isn't clear to me.

Also, the instructions provided by DFU quick start guide in the info center for nrfutil seem to be incorrect, as I get the following errors for the various commands:

Error: no such option: --company-id

Error: No such command "genpkg".

Error: no such option: --mesh

In the end, I need to OTA update devices in a mesh network.  My device issuing the update will be a linux iot gateway on the mesh network.
I'm looking for a nordic example to use as a basis for that development (and to test the mesh bootloader on my devices).
A python script, C-code, flow chart, etc would be useful.

Thanks!

  • Hi.

    Is this the quick start guide you're looking at?

    The quick start guide demonstrates DFU over-the-air, but you first have to upload the DFU to one device.

    This requires a special version of nrfutil when you want to apply command such as genpkg and --mesh.

    This version can be found on GitHub here.

    To have both versions installed I did the following:

    1. I moved the already installed "nrfutil.exe" file from the \Python27\Scripts folder to my desktop.

    2. I downloaded the mesh dfu nrfutil version from GitHub.

    3. I did all the prerequisites:

    To install nrfutil the following prerequisites must be satisfied:
    
        Python 2.7 (2.7.6 or newer, not Python 3)
        pip (https://pip.pypa.io/en/stable/installing.html)
        setuptools (upgrade to latest version: pip install -U setuptools)
        install required modules: pip install -r requirements.txt
    
    py2exe prerequisites (Windows only):
    
        py2exe (Windows only) (v0.6.9) (pip install http://sourceforge.net/projects/py2exe/files/latest/download?source=files)
        VC compiler for Python (Windows only) (http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266)
    

    4. I followed the installation steps on GitHub.

    To install the library to the local Python site-packages and script folder:
    python setup.py install
    To generate a self-contained Windows exe version of the utility (Windows only):
    python setup.py py2exe
    NOTE: Some anti-virus programs will stop py2exe from executing correctly when it modifies the .exe file.

    5. When i was finished with the installation, I opened the \Python27\Scripts folder and renamed the two files "nrfutil.exe" and "nrfutil-script.py" to "nrfutilmesh.exe" and "nrfutilmesh-script.py".

    6. I then moved the "nrfutil.exe" file from step 1, from my desktop back to the \Python27\Scripts.

    This gave me the following output for nrfutil.exe and nrfutilmesh.exe:

    You can see that there are now two versions of nrfutil, with different options.

    You should be able to follow the mesh DFU quick start guide with the right version of nrfutil.

    - Andreas

  • thanks, i did not see the mesh branch in github.  i will give that a try

  • the mesh branch helped me get passed the nrfutil errors i was getting, thanks!  not sure how i missed that in the guide.

    does the mesh OTA dfu work outside of a provisioned mesh network?  in other words, can an unprovisioned device send out an OTA firmware update to a provisioned device?
    i'm still not quite clear on the process.
    are you aware of any documentation that does a good job of explaining mesh OTA dfu?

  • In the quick start guide, the example for creating the DFU archive for nrf52832_xxAA_s132_6.0.0 has the --sd-req parameter as 0x009D.

    For nRF52:
    mesh-sdk$ nrfutil dfu genpkg --application bin/blinky/blinky_nrf52832_xxAA_s132_6.0.0.hex \
        --company-id 0x00000059 \
        --application-id 1 \
        --application-version 2 \
        --key-file private_key.txt \
        --sd-req 0x009D \
        --mesh dfu_test.zip

    Is this correct?  Looking at the python script, shouldn't it be 0x00A8?

                       '\n|s132_nrf52_5.0.0|0x9D|'
                       '\n|s132_nrf52_5.1.0|0xA5|'
                       '\n|s132_nrf52_6.0.0|0xA8|'
                       '\n|s132_nrf52_6.1.0|0xAF|'

    I'm still having trouble getting the serial DFU work correctly.
    When I run the nrfutil
     dfu serial command on my mac, it hangs here:

      [------------------------------------]    1%  0d 00:11:50

    When I run on windows, i get:

    [------------------------------------] 1% 00:11:48

    Failed to upgrade target. Error is: Device returned status code ERROR_INVALID_DATA (135) on a DFU data packet.

    I'm using the prebuilt hex files in the mesh SDK for the serial bootloader and dfu example.

    The only thing different is that I've used our company id in the data page generation and in the dfu archive generation.

  • Hi.

    Yes, it should be 0x00A8 if you have SoftDevice S132 version 6.0.0. --sd-req have to match the SoftDevice version. I think this is a typo in the dfu quick start guide.

    I think this is the reason the DFU failed.

    Mesh DFu does not work outside of a provisioned mesh network. This is because of what provisioning does:

    - The devices know each other exists.

    - The devices share an encryption key.

    - Andreas

Related