Can't connect to nRF52840-DK with Python CHIP Controller

Hi,

I have an issue in regard to Matter. I would like to commision a device in my network, but I don't know why the Python CHIP Controller returns this error every time I try to talk to the device:

chip-device-ctrl > connect -ble 3840 20202021
Device is assigned with nodeid = 171557
[1648823813.002918][34530:34536] CHIP:IN: Prepared unauthenticated message 0x7f808d8f4940 to 0x0000000000000000 (0) of type 0x20 and protocolId (0, 0) on exchange 28181i with MessageCounter:2474507507.
[1648823813.003042][34530:34536] CHIP:IN: Sending unauthenticated msg 0x7f808d8f4940 with MessageCounter:2474507507 to 0x0000000000000000 at monotonic time: 7839668 msec
[1648823813.003077][34530:34536] CHIP:CTL: Network commissioning parameters are required for BLE auto commissioning.
CHIP Error 0x0000002F: Invalid argument
chip-device-ctrl > [1648823813.019544][34530:34534] CHIP:BLE: BLE removing known devices.
[1648823813.024382][34530:34534] CHIP:BLE: BLE initiating scan.
[1648823813.340056][34530:34534] CHIP:BLE: Failed to start discovery: GDBus.Error:org.bluez.Error.InProgress: Operation already in progress
[1648823843.004362][34530:34536] CHIP:SC: PASESession timed out while waiting for a response from the peer. Expected message type was 33
Failed to establish secure session to device: 50
Segmentation fault (core dumped)

I followed the instructions from this video:

https://www.youtube.com/watch?v=kdMJQFDRoss

Has anyone encountered this same issue? Thanks!

Parents
  • Hi

    I couldn't make the CHIP Contoller work on the VM. Fortunately, I hav a spare nVidia Jetson NX laying around and I managed to run the controller on that (on ubuntu 20.04).

    However, after continuing with the webinar, I am not able to issue the command:

    zcl NetworkCommissioning AddThreadNetwork ....

    The error is the following:

    An exception occurred during process ZCL command:
    UnknownCommand: cluster: NetworkCommissioning, command: AddThreadNetwork

    Does anybody know what this is about?

  • Hi

    Try to use "AddOrUpdateThreadNetwork" instead.
    Does that change anything?

    Regards,
    Sigurd Hellesvik

  • Hi

    I am talking to our developers about this, and they think "fabric-id" might be a misprint.

    I will let you know when they find out, but in the meantime, what happens if you try to use "node-id" instead?
    Just choose a number, which will be the node-id you assign to the device.

    Regards,
    Sigurd Hellesvik

  • Hi

    This is the result of trying what you suggest:

    ./chip_tool/chip-tool pairing ble-thread hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fde7466588be63af051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f010212340410445f2b5ca6f2a93a55ce570a70efeecb0c0402a0fff8 1 20202021 3840  
    CHIP:CTL: Init failure! Operational Cred Issuer: Error 4175 (0x0000104F)
    CHIP:TOO: Run command failure: Error 4175 (0x0000104F)

  • Hi

    When I suggested that you use chip-tool some time ago, I were a bit premature. Our developers say that this will not be ready for use until nRF Connect SDK v1.9.1.
    I suggested this due to a misunderstanding on my part, sorry about that.

    chip-device-ctrl should work fine with v1.9.1, and you had gotten quite some way with that earlier in this case.
    Does it work for you to go back to chip-device-ctrl, so we know we are working with something stable?

    If so, have a look at Working with Python CHIP Controller, specifically the section on "Using Python CHIP Controller for Matter accessory testing". For the chip-device-ctrl, you already downloaded it from releases, right?

    Regards,
    Sigurd Hellesvik

  • Okay, 

    So after I consulted the page https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/matter/python_chip_controller_building.html I have the following issues:

    1. After installing the CHIP controller when I try the BLE interface I get the following:

    sudo out/python_env/bin/chip-device-ctrl --bluetooth-adapter=hci2
    CHIP:DIS: Init admin pairing table with server storage.
    CHIP:IN: local node id is 0x000000000001b669
    CHIP:DL: MDNS failed to join multicast group on eth0 for address type IPv4: Inet Error 1016 (0x000003F8): Address not found
    CHIP:DL: MDNS failed to join multicast group on rndis0 for address type IPv4: Inet Error 1016 (0x000003F8): Address not found
    CHIP:DL: MDNS failed to join multicast group on usb0 for address type IPv4: Inet Error 1016 (0x000003F8): Address not found
    CHIP:ZCL: Using ZAP configuration...
    CHIP:ZCL: deactivate report event
    CHIP:CTL: Getting operational keys
    CHIP:CTL: Generating operational certificate for the controller
    CHIP:CTL: Getting root certificate for the controller from the issuer
    CHIP:CTL: Generating credentials
    CHIP:CTL: Loaded credentials successfully
    CHIP:DL: Platform main loop started.
    2022-05-25 17:29:25,177 ChipBLEMgr   INFO     adapter hci2 cannot be found, expect the ble mac address
    Traceback (most recent call last):
      File "out/python_env/bin/chip-device-ctrl", line 789, in <module>
        main()
      File "out/python_env/bin/chip-device-ctrl", line 769, in main
        devMgrCmd = DeviceMgrCmd(rendezvousAddr=options.rendezvousAddr,
      File "out/python_env/bin/chip-device-ctrl", line 155, in __init__
        self.bleMgr.ble_adapter_select("hci{}".format(bluetoothAdapter))
      File "/home/iotlab/connectedhomeip/out/python_env/lib/python3.8/site-packages/chip/ChipBluezMgr.py", line 829, in ble_adapter_select
        self.adapter.adapter_register_signal()
    AttributeError: 'NoneType' object has no attribute 'adapter_register_signal'

    2. And so, I run the following command, which works:

    sudo out/python_env/bin/chip-device-ctrl
    

    3. After that, when I try to set the previously obtained Active Operational Dataset I get:

    set-pairing-thread-credential 0e080000000000010000000300000f35060004001fffe0020811111111222222220708fde7466588be63af051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f010212340410445f2b5ca6f2a93a55ce570a70efeecb0c0402a0fff8
    Pairing Thread Credential is nolonger available, use NetworkCommissioning cluster instead.

    4. And finally, if I try to Commission the Matter accessory device over Bluetooth LE I get:

    connect -ble 3840 20202021 1234
    Device is assigned with nodeid = 1234
    CHIP:BLE: BLE removing known devices.
    CHIP:BLE: BLE initiating scan.
    CHIP:BLE: New device scanned: E9:1C:51:27:C0:68
    CHIP:BLE: Device discriminator match. Attempting to connect.
    CHIP:BLE: Scan complete notification without an active scan.
    CHIP:DL: Bluez notify CHIPoBluez connection disconnected
    CHIP:IN: Failed to establish BLE connection: Ble Error 6012 (0x0000177C): Remote device closed BLE connection
    CHIP:BLE: no endpoint for sub complete
    Failed to establish secure session to device: 4050
    CHIP:BLE: PASESession timed out while waiting for a response from the peer. Expected message type was 33
    Failed to establish secure session to device: 4050
    CHIP Error 4050 (0x00000FD2): Timeout

  • Hi

    Do you get the same errors if you use the chip-device-ctrl installed from https://github.com/nrfconnect/sdk-connectedhomeip/releases/tag/v1.9.1?

    Regards,
    Sigurd Hellesvik

Reply Children
  • Hi

    Actually no, after installing it like this and going through the instructions available here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/matter/python_chip_controller_building.html (which you send it to me), I am able to connect to the device by ble and also send commands (turn the ligh bulb on/off), which is Step 6 from the link.

    However, at Step 7, when I try to get ProductName with the command " zclread Basic ProductName 1234 1 ", I receive the following error:

    chip-device-ctrl > zclread Basic ProductName 1234 1 0
    Using PASE connection
    [1654072284.640471][271108:271114] CHIP:IN: Prepared secure message 0x7f7a5fce18 to 0x00000000000004D2 (1)  of type 0x2 and protocolId (0, 1) on exchange 33810i with MessageCounter:2809441.
    [1654072284.640541][271108:271114] CHIP:IN: Sending encrypted msg 0x7f7a5fce18 with MessageCounter:2809441 to 0x00000000000004D2 (1) at monotonic time: 773705553 msec
    [1654072284.752556][271108:271114] CHIP:EM: Received message of type 0x5 with protocolId (0, 1) and MessageCounter:15675771 on exchange 33810i
    2022-06-01 10:31:24,753 root         ERROR    For path: Endpoint = 1, Attribute = <class 'chip.clusters.Objects.Basic.Attributes.ProductName'>, got IM Error: InteractionModelError: UnsupportedAttribute (0x86)
    AttributeReadResult(path=AttributePath(nodeId=1234, endpointId=1, clusterId=40, attributeId=3), status=0, value=ValueDecodeFailure(TLVValue=None, Reason=InteractionModelError(<Status.UnsupportedAttribute: 134>)))

    Now, I don't normally require this, I would like to commission the device to my thread network and after that, control it from a WiFi network... How can achieve this?

    Thank you,

    Mihnea Cristian Marin

  • Hi

    For step 7, try "zclread Basic ProductName 1234 0 0" instead. It seems that the documentation is wrong here, and the basic cluster is on endpoint 0, and not endpoint 1.

    mihnea17cristian said:
    Now, I don't normally require this, I would like to commission the device to my thread network and after that, control it from a WiFi network... How can achieve this?

    When you use the zclread commands, the command goes through Wi-Fi from your PC to the Border Router and then to your Matter device over the Thread network.

    Do you want something else than this?

    Regards,
    Sigurd Hellesvik

  • Hello,

    You were right, the command you sent me works. Also, I see your point on WiFi - Thread communication. However, from what I understand, I always require to use the CHIP controller to get info from the device, am I right?

  • Hi

    Yes, I think you always need to use a Matter Controller to control(get info from device) over the Matter network.

    If you want to know if Matter supports other ways for communicationg with devices, I suggest that you have a look at the Matter Specification.

    Regards,
    Sigurd Hellesvik

Related