Thread multicast DFU support #95
Thread multicast DFU support #95
Conversation
nordicsemi/__main__.py
Outdated
@@ -763,16 +774,13 @@ def convert_version_string_to_int(s): | |||
type=click.STRING) | |||
@click.option('-a', '--address', | |||
help='Device IPv6 address. If address is not specified then perform DFU' | |||
+ 'on all capable devices.', | |||
+ 'on all capable devices. If multicast address is specified (FF03::1),' | |||
+ 'perform multicast DFU.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some whitespace getting lost in the string concatenation here. This will output "... DFUon all capable ..." and "...
(F03::1),perform multicast ...". Also, the +
'es can be removed.
nordicsemi/__main__.py
Outdated
type=click.FLOAT) | ||
@click.option('-d', '--diag', | ||
help='Request and print diagnostic information.' + | ||
'Option value determines how many times the diagnostic request is sent. ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add space between "information." and "Option". The +
'es can be removed.
nordicsemi/__main__.py
Outdated
opts.reset_suppress = reset_suppress | ||
opts.mcast_dfu = mcast_dfu | ||
|
||
print(opts.diag_addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be removed?
nordicsemi/__main__.py
Outdated
multiple = True) | ||
@click.option('-nv', '--non_verbose', | ||
help='Disables logger output.', | ||
is_flag=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case for non-verbose? There is already a --verbose
flag for specifying log level, so it would be good if we could use that for thread DFU as well.
nordicsemi/__main__.py
Outdated
click.echo("Press <ENTER> terminate") | ||
transport.open() | ||
# Delay DFU trigger until NCP promotes to a router (5 seconds by default) | ||
time.sleep(6.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment says 5 secs, but sleeping 6 secs.
nordicsemi/thread/dfu_server.py
Outdated
num, | ||
_bmp_to_str(bmp))) | ||
|
||
# TODO: fix me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something that should be fixed here?
nordicsemi/thread/dfu_server.py
Outdated
elif (path == 'f'): | ||
resource = self.image_resource | ||
|
||
for i in range(63): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 63? Consider using a named constant to make it more clear.
nordicsemi/thread/dfu_server.py
Outdated
self._dump_diagnostic_report() | ||
elif (self.opts.diag == -1): | ||
time.sleep(20) | ||
self._dump_diagnostic_report() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that there is some special behavior here if --diag
is -1. Should it be documented in the CLI help output?
nordicsemi/thread/tncp.py
Outdated
logger.debug("Sending datagram {} {} {} {}".format(self._src_addr, | ||
if (dest.addr.is_multicast): | ||
rloc16 = self._wpan.prop_get_value(SPINEL.PROP_THREAD_RLOC16) | ||
src_addr = ipaddress.ip_address(self._ml_prefix + '\x00\x00\x00\xff\xfe\x00' + struct.pack('>H', rloc16)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be made more readable? Or add a comment to explain what is being done?
@@ -68,10 +69,13 @@ def _get_file_names(manifest): | |||
logger.info("Image type {} found".format(data_attrs[0])) | |||
return firmware.dat_file, firmware.bin_file | |||
|
|||
def create_dfu_server(transport, zip_file_path, prefix): | |||
def create_dfu_server(transport, zip_file_path, opts): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good if you could document what can be passed in as opts
.
Thank you for the review. I've applied appropriate fixes and removed some obsoletecode , that we've considered as no longer needed - mostly regarding the |
Thanks 👍 I see that there is also a conflict in |
nordicsemi/version.py
Outdated
@@ -37,4 +37,4 @@ | |||
|
|||
""" Version definition for nrfutil. """ | |||
|
|||
NRFUTIL_VERSION = "3.3.2" | |||
NRFUTIL_VERSION = "3.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rlubos, you asked me if the version should be bumped as part of the PR, which I confirmed. However, in hindsight, I think it is better to leave out the version change here, and we'll instead deal with setting the correct version when we do the next release. Sorry for the mixup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've removed that commit.
Ok, so I've signed the CLA (I wasn't aware that Noridc employees have to do this as well) and removed the commit that bumbed up the version. Is there any change though that updated version will be released any time soon? We wanted to point out in our SDK's documentation to that specific version, and we're releasing soon. |
This is failing on one of my Linux machines with the following error:
@rlubos I'd rather make this work locally at least once before merging. Any clues? |
@IvanSanchez |
@wbober No luck. It's either |
@IvanSanchez I do not have solution, just some feedback. |
Apparently this runs, but I haven't been able to complete a multicast DFU, and also I'm not totally happy with some of the error messages and behaviour. I'll merge this, but I'll also create a few issues about those. |
This PR adds support for Thread multicast DFU, that will be added in future Thread SDK release.