Matter Fabric Removal not working

Product: nRF54L15, SDK:3.0.2, door lock application

Hi, 

When the Matter door lock removed from Apple  Home(Home App, remove accessory), the lock does  not remove all the fabric information. If we  try to re-enroll back to Apple home, it fails.

prj settings: we do not want to factory reset the lock.

CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS=y
CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY=y
 Here is the output:
I: 1682289 [EM]>>> [E:40552r S:7602 M:180316078] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0001:02 (IM:ReadRequest) (B:51)
I: 1682305 [EM]<<< [E:40552r S:7602 M:11248965 (Ack:180316078)] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [F4A5] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0001:05 (IM:ReportData) (B:70)
I: 1682327 [EM]??1 [E:40552r S:7602 M:11248965] (S) Msg Retransmission to 1:15EE92BA64B84421 in 2094ms [State:Active II:500 AI:300 AT:4000]
I: 1682488 [EM]>>> [E:40552r S:7602 M:180316079 (Ack:11248965)] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)

[1704940622] Updated Matter Power cluster
[1704944642] V: 3187 (in mV), T: 24(in C), Battery charge left: 95%, time-to-empty=nan  0
I: 1722489 [EM]>>> [E:40553r S:7602 M:180316080] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0001:02 (IM:ReadRequest) (B:51)
I: 1722505 [EM]<<< [E:40553r S:7602 M:11248966 (Ack:180316080)] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [F4A5] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0001:05 (IM:ReportData) (B:70)
I: 1722527 [EM]??1 [E:40553r S:7602 M:11248966] (S) Msg Retransmission to 1:15EE92BA64B84421 in 2092ms [State:Active II:500 AI:300 AT:4000]
I: 1722687 [EM]>>> [E:40553r S:7602 M:180316081 (Ack:11248966)] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)

[1734940749] Updated Matter Power cluster
[1734944765] V: 3187 (in mV), T: 24(in C), Battery charge left: 95%, time-to-empty=nan  0
I: 1737690 [EM]>>> [E:40554r S:7602 M:180316082] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0001:02 (IM:ReadRequest) (B:51)
I: 1737706 [EM]<<< [E:40554r S:7602 M:11248967 (Ack:180316082)] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [F4A5] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0001:05 (IM:ReportData) (B:70)
I: 1737728 [EM]??1 [E:40554r S:7602 M:11248967] (S) Msg Retransmission to 1:15EE92BA64B84421 in 2034ms [State:Active II:500 AI:300 AT:4000]
I: 1737888 [EM]>>> [E:40554r S:7602 M:180316083 (Ack:11248967)] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)
I: 1737909 [EM]>>> [E:40555r S:7602 M:180316084] (S) Msg RX from 1:15EE92BA64B84421 [F4A5] to 00000000C3743D4D --- Type 0001:08 (IM:InvokeCommandRequest) (B:62)
I: 1737925 [ZCL]OpCreds: Received a RemoveFabric Command for FabricIndex 0x1
I: 1737933 [EM]<<< [E:40555r S:7602 M:11248968 (Ack:180316084)] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [F4A5] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)
I: 1737962 [EM]<<< [E:21165i S:7602 M:11248969] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [F4A5] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0001:05 (IM:ReportData) (B:82)
I: 1737982 [EM]??1 [E:21165i S:7602 M:11248969] (S) Msg Retransmission to 1:15EE92BA64B84421 in 2085ms [State:Active II:500 AI:300 AT:4000]
I: 1738038 [FP]Fabric (0x1) deleted.
I: 1738041 [IM]Deleting expired ReadHandler for NodeId: 15EE92BA64B84421, FabricIndex: 1
I: 1738056 [DMG]Subscription id 0xea087a16 from node <15EE92BA64B84421, 1> torn down
I: 1738065 [ZCL][OnFabricRemoved] Handling a fabric removal from the door lock server [endpointId=1,fabricIndex=1]
E: 1738076 [ZCL][clearFabricFromCredentials] Unable to get max number of credentials to clear - can't get max number of credentials [endpointId=1,credentialType=5]
E: 1738092 [ZCL][clearFabricFromCredentials] Unable to clear fabric from credential - couldn't read credential from database [endpointId=1,credentialType=0,credentialIndex=0,fabricIdToRemove=1]
I: 1738113 [ZCL]OpCreds: Fabric index 0x1 was removed
I: 1738118 [DIS]Updating services using commissioning mode 0
I: 1738124 [DIS]Advertise operational node B012C744E75C0D5A-00000000149A3293
I: 1738132 [DL]removing srp service: 5D40D853319AF4A5-00000000C3743D4D._matter._tcp
I: 1738172 [ZCL]OpCreds: RemoveFabric successful
I: 1738177 [SC]SecureSession[0x200059c0, LSID:7599]: State change 'kDefunct' --> 'kPendingEviction'
I: 1738186 [SC]SecureSession[0x20005a98, LSID:7602]: State change 'kActive' --> 'kPendingEviction'
I: 1738197 [EM]<<< [E:40555r S:7602 M:11248970 (Ack:180316084)] (S) Msg TX from 00000000C3743D4D to 1:15EE92BA64B84421 [0000] [UDP:[fdc7:7c32:4429:e640:4f5:a66c:db71:f7c2]:62363] --- Type 0001:09 (IM:InvokeCommandResponse) (B:70)
I: 1738220 [EM]??1 [E:40555r S:7602 M:11248970] (S) Msg Retransmission to 1:15EE92BA64B84421 in 2091ms [State:Active II:500 AI:300 AT:4000]
I: 1738235 [EM]>>> [E:21165i S:7602 M:180316085 (Ack:11248969)] (S) Msg RX from 1:15EE92BA64B84421 [0000] to 00000000C3743D4D --- Type 0001:01 (IM:StatusResponse) (B:42)
I: 1738254 [EM]Dropping message on inactive session that does not match an existing exchange
I: 1738296 [EM]>>> [E:40555r S:7602 M:180316086 (Ack:11248970)] (S) Msg RX from 1:15EE92BA64B84421 [0000] to 00000000C3743D4D --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)
E: 1743486 [IN]Data received on an unknown session (LSID=7602). Dropping it!
E: 1743495 [IN]Data received on an unknown session (LSID=7602). Dropping it!
E: 1748496 [IN]Data received on an unknown session (LSID=7602). Dropping it!
E: 1758495 [IN]Data received on an unknown session (LSID=7602). Dropping it!
One Fabric info is erased and  the 2nd one is not.
We have the code to read the fabrics stored in the lock, see below:
[3871513621] No of fabrics that lock has joined: 1
[3871522349] ---------------------------------
[3871526923] Fabric Index : 2
[3871529880] Fabric ID    : 0x0000000000000002
[3871534454] Node ID      : 0x00000000149A3293
[3871539029] Vendor ID    : 0x1384
[3871542460] Fabric Label : 
In Summary Fabric Index 2 is not removed. if we try to commission again, we get the error I: Matter service BLE advertising not started - device is already commissioned.
we do have code to remove the Fabric but  we want the Fabric info to be removed automatically  by the stack. 
Please let us know.
Thanks.
Parents
  • Hello,

    Apologies for the long response time.

    So if I understand you correct, you want to have the device removed from the fabric, but you don't want to factory reset the Matter devices you want to remove? For one of your two devices you suceed with this.

    From https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/getting_started/advanced_kconfigs.html#reaction_to_the_last_matter_fabric_removal and https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/end_product/last_fabric_removal_delegate.html

    You can further control the device's behavior after the last fabric is removed by configuring the appropriate Kconfig options:
    • Set CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY to y to remove all saved network credentials while keeping application-specific non-volatile data. The device will not reboot or perform a factory reset.
    • Set CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START to y to remove network credentials, keep application data, and start Bluetooth LE advertising for new commissioning.
    • By default, CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT is selected, which removes credentials and reboots the device, but does not necessarily factory reset unless CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS is also set to y.
    To avoid a factory reset, ensure that CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS is set to n. This way, only the network credentials are removed, and application-specific data is preserved when the last fabric is removed. The device will not be restored to factory settings unless this option is enabled.
    Let me know if these links allows you to configure your device as you describe.
    Kind regards,
    Andreas
Reply
  • Hello,

    Apologies for the long response time.

    So if I understand you correct, you want to have the device removed from the fabric, but you don't want to factory reset the Matter devices you want to remove? For one of your two devices you suceed with this.

    From https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/getting_started/advanced_kconfigs.html#reaction_to_the_last_matter_fabric_removal and https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/end_product/last_fabric_removal_delegate.html

    You can further control the device's behavior after the last fabric is removed by configuring the appropriate Kconfig options:
    • Set CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY to y to remove all saved network credentials while keeping application-specific non-volatile data. The device will not reboot or perform a factory reset.
    • Set CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START to y to remove network credentials, keep application data, and start Bluetooth LE advertising for new commissioning.
    • By default, CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT is selected, which removes credentials and reboots the device, but does not necessarily factory reset unless CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS is also set to y.
    To avoid a factory reset, ensure that CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS is set to n. This way, only the network credentials are removed, and application-specific data is preserved when the last fabric is removed. The device will not be restored to factory settings unless this option is enabled.
    Let me know if these links allows you to configure your device as you describe.
    Kind regards,
    Andreas
Children
No Data
Related