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

How to perform dfu using existing Californium CoAP server instead of NCP?

To perform dfu using nrfutil, we need to bring wpantund service down in order to provide serial port to nrfutil. That restrict me to communicate with end nodes. Can you please help, how we can do dfu using the coap server running in RPi and without stopping wpantund service.

I found one solution by reviewing code, i.e., using socket connection in NCPTransport "s:5683". But I am getting connection refused error.

Parents
  • Hi,

    I'm sorry for the long delay for feedback on this request. This is the response from our developers:

    It seems that the case is not trivial. The issue is that nrfutil assumes that it gets the NCP just for itself. 

    In theory one could initialize the server in a way that is does not communicate with the NCP directly using spinel, but via the IP that would be directed to the wpan0 interface using standard Linux mechanisms.

    To do it we need to create a different transport:

    https://github.com/NordicSemiconductor/pc-nrfutil/blob/642a64e93347b0fb4591e80af946f17333f227e6/nordicsemi/__main__.py#L1078

    NCPTransport uses spinel, here something like SocketTransport that would communicate through wpantund fits better:

    https://github.com/NordicSemiconductor/piccata/blob/master/transport/tsocket.py#L54

    SocketTransport in piccata is rather experimental/testing version, and you should test/verify its functionality properly before use in any production environment. There could be some bugs.

    In the SocketTransport we might need to bind to the NCP IPv6 address, but I am not sure about it without any testing.

    https://github.com/NordicSemiconductor/piccata/blob/master/transport/tsocket.py#L70

    These are just hints that could be taken as a starting point. We have not tested any such solution.

    Hope these pointers can help you find a solution to your request.

    Best regards,
    Jørgen

  • Hello,

    I am also having the same issue. 

    I want to perform the DFU keeping the existing thread network working.

    is there any tested solution available now?

    Meanwhile i have tried adding one more USB dongle and execute the dfu using nrfutil

    $ sudo python2.7 nordicsemi/__main__.py dfu thread -pkg ../../app_dfu_package.zip -p /dev/ttyACM1 --channel 24 --panid 4396
    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: /dev/ttyACM1
    2019-12-09 15:14:01,632 Failed to reset NCP. Please flash connectivity firmware.
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 1375, in thread
        transport.open()
      File "/usr/local/lib/python2.7/dist-packages/nordicsemi/thread/tncp.py", line 224, in open
        raise Exception('Failed to reset NCP. Please flash connectivity firmware.')
    Exception: Failed to reset NCP. Please flash connectivity firmware.
    
    Note that NCP firmware is correct.

Reply
  • Hello,

    I am also having the same issue. 

    I want to perform the DFU keeping the existing thread network working.

    is there any tested solution available now?

    Meanwhile i have tried adding one more USB dongle and execute the dfu using nrfutil

    $ sudo python2.7 nordicsemi/__main__.py dfu thread -pkg ../../app_dfu_package.zip -p /dev/ttyACM1 --channel 24 --panid 4396
    Address not specified. Using ff03::1 (all Thread nodes)
    Using connectivity board at serial port: /dev/ttyACM1
    2019-12-09 15:14:01,632 Failed to reset NCP. Please flash connectivity firmware.
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 1375, in thread
        transport.open()
      File "/usr/local/lib/python2.7/dist-packages/nordicsemi/thread/tncp.py", line 224, in open
        raise Exception('Failed to reset NCP. Please flash connectivity firmware.')
    Exception: Failed to reset NCP. Please flash connectivity firmware.
    
    Note that NCP firmware is correct.

Children
Related