Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to commit pending..... (CON-407) #316

Closed
jonsmirl opened this issue Apr 7, 2023 · 15 comments
Closed

Failed to commit pending..... (CON-407) #316

jonsmirl opened this issue Apr 7, 2023 · 15 comments

Comments

@jonsmirl
Copy link
Contributor

jonsmirl commented Apr 7, 2023

Something is broken with this. After I reboot the device I can't commit anything. I suspect this has to do with switching to encrypted partitions. After reboot, maybe the device can't write to the encypted partitions any more?

I (86310) esp_matter_command: Received command 0x00000004 for endpoint 0x0000's cluster 0x00000030
I (86310) chip[FS]: GeneralCommissioning: Received CommissioningComplete
I (86450) chip[FP]: Metadata for Fabric 0x4 persisted to storage.
E (86600) chip[FP]: Failed to commit pending operational keypair 5001105
E (87160) chip[FP]: Failed to commit pending operational certificates 5001105I (87160) chip[TS]: Committing Last Known Good Time to storage: 2023-04-07T00:56:51
I (87460) chip[FP]: Fabric (0x4) deleted.
I (87460) chip[ZCL]: OpCreds: Fabric index 0x4 was removed
I (87460) chip[DIS]: Updating services using commissioning mode 0
I (87460) chip[DIS]: CHIP minimal mDNS started advertising.
I (87480) chip[DIS]: Advertise operational node 950545243CFE2D15-00000000F2DEF84C
I (87490) chip[DIS]: CHIP minimal mDNS configured as 'Operational device'; instance name: 950545243CFE2D15-00000000F2DEF84C.
I (87500) chip[DIS]: mDNS service published: _matter._tcp
I (88060) chip[TS]: Pending Last Known Good Time: 2023-04-07T00:56:51
I (88060) chip[TS]: Previous Last Known Good Time: 2023-04-07T00:56:51
I (88070) chip[TS]: Reverted Last Known Good Time to previous value
E (88090) chip[FS]: GeneralCommissioning: Failed to commit pending fabric data: 5001105
I (88090) chip[EM]: <<< [E:3535r S:40338 M:207031141 (Ack:33103704)] (S) Msg TX to 4:B8DEDAADD0CAAAD1 [0000] --- Type 0001:09 (IM:InvokeCommandResponse)
I (88090) chip[IN]: (S) Sending msg 207031141 on secure session with LSID: 40338
@github-actions github-actions bot changed the title Failed to commit pending..... Failed to commit pending..... (CON-407) Apr 7, 2023
@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

All of this is without rebooting....
In the attached log I take a device with erased flash, flash it, and then commission it. That all works.
Then at 114713, I share the device from Google Home to Google Sample App for Matter.
In that sharing process I get these errors:

I (127653) chip[FP]: Metadata for Fabric 0x2 persisted to storage.
E (128433) chip[FP]: Failed to commit pending operational certificates 5001105
I (128433) chip[TS]: Committing Last Known Good Time to storage: 2023-04-07T16:55:29
I (128693) chip[FP]: Fabric (0x2) deleted.
I (128693) chip[ZCL]: OpCreds: Fabric index 0x2 was removed
I (128693) chip[DIS]: Updating services using commissioning mode 0
I (128693) chip[DIS]: CHIP minimal mDNS started advertising.
I (128723) chip[DIS]: Advertise operational node 950545243CFE2D15-0000000047D19BA9
I (128723) chip[DIS]: CHIP minimal mDNS configured as 'Operational device'; instance name: 950545243CFE2D15-0000000047D19BA9.
I (128733) chip[DIS]: mDNS service published: _matter._tcp
I (129113) chip[TS]: Pending Last Known Good Time: 2023-04-07T16:55:29
I (129113) chip[TS]: Previous Last Known Good Time: 2023-04-07T16:55:29
I (129113) chip[TS]: Reverted Last Known Good Time to previous value
E (129163) chip[FS]: GeneralCommissioning: Failed to commit pending fabric data: 5001105
I (129163) chip[EM]: <<< [E:3925r S:62934 M:65781139 (Ack:255691429)] (S) Msg TX to 2:B8DEDAADD0CAAAD1 [0000] --- Type 0001:09 (IM:InvokeCommandResponse)

Now go back and look at 56053, at that previous point in time the same code ran without error when committing fabric 1.

I (56043) esp_matter_command: Received command 0x00000004 for endpoint 0x0000's cluster 0x00000030
I (56043) chip[FS]: GeneralCommissioning: Received CommissioningComplete
I (56053) chip[FP]: Metadata for Fabric 0x1 persisted to storage.
I (56203) chip[TS]: Committing Last Known Good Time to storage: 2023-04-07T16:55:29
I (56203) chip[ZCL]: OpCreds: Fabric index 0x1 was committed to storage. Compressed Fabric Id 0x950545243CFE2D15, FabricId F6CEBBE0CBBC9E0F, NodeId 0000000047D19BA9, VendorId 0x6006
I (56283) chip[FS]: GeneralCommissioning: Successfully commited pending fabric data
I (56283) chip[FS]: Fail-safe cleanly disarmed

commit.log

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

How long do these commits take? Could the previous one not be finished when then makes the next one fail?

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

5001105 maps to ESP_ERR_NVS_NOT_ENOUGH_SPACE

I am using the partition table from the light example. Can this really be too small?

esp_secure_cert,  0x3F, ,0xd000,    0x2000, encrypted
nvs,      data, nvs,     0x10000,   0x6000,
nvs_keys, data, nvs_keys,,          0x1000, encrypted
otadata,  data, ota,     ,          0x2000
phy_init, data, phy,     ,          0x1000,
ota_0,    app,  ota_0,   0x20000,   0x1E0000,
ota_1,    app,  ota_1,   0x200000,  0x1E0000,
fctry,    data, nvs,     0x3E0000,  0x6000

So let's make the partition larger.

nvs,      data, nvs,     0x10000,   0xB000,

And that works. So, what is taking up more than 24,576 bytes in the nvs partition?

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

Next I added a print on read write. Why is is reading these keys over and over, maybe 100 times?

JDS Read Key g/su/0
JDS Read Key g/su/1
JDS Read Key g/su/2
JDS Read Key g/su/3
JDS Read Key g/su/4
JDS Read Key g/su/5
JDS Read Key g/su/6
JDS Read Key g/su/7
JDS Read Key g/su/8
JDS Read Key g/su/9
JDS Read Key g/su/a
JDS Read Key g/su/b
JDS Read Key g/su/c
JDS Read Key g/su/d
JDS Read Key g/su/e

Is there some tool which can extract this partition and decode it?

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

flash.txt
So there is way more in this partition than I expected...

Lot's of questions here, first one why are all these 8 and 16 bit values being persisted out in 24 bytes?
Why are 300:4002, 300:4003, 300:4004 being persisted when I have that cluster feature turned off?
Why is g/su/.... being read over and over and it isn't in the flash?
I think f/.. is fabrics. Why are there three entries when I have only made two fabrics?

and now I see why I ran out of space. lots of junk in here. Looks like 50% wasted space. This stuff is 0x6c30 long which is why it didn't fit into 0x6000.

Namespace endpoint_0
  28:5            : BLOB  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  31:4            : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  33:1            : BLOB  0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  3E:3            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_1
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_2
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_3
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_4
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_5
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_6
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_7
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_8
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_9
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_A
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_B
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_C
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_D
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_E
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_F
  6:0             : BLOB  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  6:4003          : BLOB  8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:4000          : BLOB  88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:7           : BLOB  0A 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:3           : BLOB  0A 00 00 00 00 00 00 00 6B 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4           : BLOB  0A 00 00 00 00 00 00 00 7D 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4002        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4003        : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4004        : BLOB  0A 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  8:0             : BLOB  88 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:8           : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  300:4001        : BLOB  0F 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace endpoint_10
  3B:1            : BLOB  08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Namespace misc
Namespace nvs.net80211
  ap.sndchan      : U8    1
  sta.ssid        : BLOB  smirl
  sta.pswd        : BLOB  password
  bssid.set       : U8    0
  sta.lis_intval  : U16   3
  sta.scan_method : U8    0
  sta.sort_method : U8    0
  sta.minrssi     : I8    -127
  sta.minauth     : U8    3
  sta.apsw        : BLOB  05 00 
  sta.pmf_e       : U8    1
  sta.pmf_r       : U8    0
  sta.rrm_e       : U8    0
  sta.btm_e       : U8    0
  sta.mbo_e       : U8    0
  sta.ft          : U8    0
  sta.owe         : U8    0
  sta.bss_retry   : U8    0
  sta.trans_d     : U8    0
  sta.sae_h2e     : U8    2
  sta.chan        : U8    6
  sta.apinfo      : BLOB  05 00 00 00 73 6D 69 72 6C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
Namespace chip-factory
Namespace chip-config
  unique-id       : STR   8704A9FE87C191D9\00
  reg-location    : U32   0
  country-code    : STR   XX\00
Namespace chip-counters
  reboot-count    : U32   1
  total-hours     : U32   0
Namespace phy
  cal_data        : BLOB  1C 02 00 00 F4 12 FA DF 26 1C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7F 7F 7F 7F 7F 6F ...
  cal_mac         : BLOB  F4 12 FA DF 26 1C 
  cal_version     : U32   540
Namespace CHIP_KVS
  g/gcc           : BLOB  E8 03 00 00 
  g/gdc           : BLOB  E8 03 00 00 
  g/im/ec         : BLOB  00 00 01 00 00 00 00 00 
  f/1/k/0         : BLOB  15 24 01 00 24 02 01 36 03 15 27 04 00 00 00 00 6E 00 00 00 25 05 84 22 30 06 10 AA B1 04 30 25 ...
  f/1/g           : BLOB  15 24 01 00 24 02 00 24 03 00 24 04 00 24 05 00 24 06 01 24 07 00 18 
  f/1/ac/0/0      : BLOB  15 24 01 05 24 02 02 36 03 07 01 00 01 00 FD FF FF FF 18 34 04 18 
  ddfc2c72f05c570 : BLOB  15 30 03 10 60 C0 9F F8 41 74 22 02 FB 41 54 7D 20 45 C9 C8 30 04 20 09 FA 2A 3A DD 2C A7 02 83 ...
  9f3972e07298a80 : BLOB  15 24 01 01 26 02 36 B9 F8 85 18 
  f/1/m           : BLOB  15 25 00 06 60 2C 01 00 18 
  f/1/o           : BLOB  15 24 00 01 30 01 61 04 69 2D 83 96 23 98 9E 3C 96 5B 17 D1 F3 5D 90 CD 0C E6 A6 D7 25 E1 D1 6D ...
  f/1/n           : BLOB  15 30 01 10 55 7E CE 46 C4 F0 D4 FE C4 ED B7 56 AB B9 8C AF 24 02 01 37 03 2C 84 02 55 53 2C 07 ...
  f/1/i           : BLOB  15 30 01 01 02 24 02 01 37 03 2C 84 02 55 53 2C 07 06 47 6F 6F 67 6C 65 2C 01 0B 4D 61 74 74 65 ...
  f/1/r           : BLOB  15 30 01 01 01 24 02 01 37 03 2C 84 02 55 53 2C 07 06 47 6F 6F 67 6C 65 2C 01 0B 4D 61 74 74 65 ...
  g/lkgt          : BLOB  15 26 00 AC 4E C3 2B 18 
  wifi-ssid       : BLOB  73 6D 69 72 6C 
  wifi-pass       : BLOB  70 70 70 70 70 70 70 70 70 70 70 
  59a0929797e2208 : BLOB  15 30 03 10 CC C2 AE DD 4B D0 5E C3 56 9C D8 24 D4 06 70 E6 30 04 20 40 0E 2A F5 14 A4 11 63 AF ...
  8ca0a722606a2ec : BLOB  15 24 01 01 26 02 C7 7C 07 F1 18 
  g/su/0          : BLOB  15 26 01 C7 7C 07 F1 24 02 01 26 03 EA F9 B3 69 24 04 00 24 05 78 29 06 37 07 35 09 25 0B FF FF ...
  f/2/k/0         : BLOB  15 24 01 00 24 02 01 36 03 15 27 04 00 00 00 00 6F 00 00 00 25 05 BE 87 30 06 10 3A 76 19 2C B1 ...
  f/2/g           : BLOB  15 24 01 00 24 02 00 24 03 00 24 04 00 24 05 00 24 06 01 24 07 01 18 
  f/2/ac/0/0      : BLOB  15 24 01 05 24 02 02 36 03 07 01 00 01 00 FD FF FF FF 18 34 04 18 
  679df20bd51cf4c : BLOB  15 30 03 10 44 3F 2E 94 6F D6 AE 29 CA 24 7A B6 66 E8 9F D5 30 04 20 1F 3C 48 66 4E 8B C6 C1 D7 ...
  0e166d079dda047 : BLOB  15 24 01 02 27 02 D1 AA CA D0 AD DA DE B8 18 
  f/2/m           : BLOB  15 25 00 06 60 2C 01 00 18 
  f/2/o           : BLOB  15 24 00 01 30 01 61 04 F4 C1 47 13 CE 7F 01 25 0F 2D 93 60 51 3D 30 E6 B5 33 C6 E6 12 ED 1B 11 ...
  f/2/n           : BLOB  15 30 01 09 00 E3 CF 6C DA ED AA 59 F3 24 02 01 37 03 27 14 F8 63 F5 F5 AD 4C 23 79 18 26 04 00 ...
  f/2/r           : BLOB  15 30 01 01 01 24 02 01 37 03 27 14 F8 63 F5 F5 AD 4C 23 79 18 26 04 00 DF B8 2B 26 05 00 E5 50 ...
  f/3/k/0         : BLOB  15 24 01 00 24 02 01 36 03 15 27 04 00 00 00 00 6F 00 00 00 25 05 FF 39 30 06 10 44 BA 97 9C 8A ...
  g/gfl           : BLOB  15 24 01 03 24 02 03 18 
  f/3/g           : BLOB  15 24 01 00 24 02 00 24 03 00 24 04 00 24 05 00 24 06 01 24 07 02 18 
  f/3/ac/0/0      : BLOB  15 24 01 05 24 02 02 36 03 06 69 B6 01 00 18 34 04 18 
  91fa60657187df2 : BLOB  15 30 03 10 D0 DE 80 EA 1F 8B 5B B6 A3 3C 67 15 1C CC 8C A4 30 04 20 A6 5E 8D 6F 37 5F 56 A2 75 ...
  f2af85b9d1b2b41 : BLOB  15 24 01 03 26 02 69 B6 01 00 18 
  g/sri           : BLOB  16 15 24 01 01 26 02 36 B9 F8 85 18 15 24 01 01 26 02 C7 7C 07 F1 18 15 24 01 02 27 02 D1 AA CA ...
  f/3/m           : BLOB  15 25 00 F4 FF 2C 01 00 18 
  f/3/o           : BLOB  15 24 00 01 30 01 61 04 A8 4E F3 D7 13 8A E1 6F F8 4A A1 58 52 49 62 3D CA 1B 8D E8 50 99 72 FF ...
  f/3/n           : BLOB  15 30 01 01 01 24 02 01 37 03 24 14 00 18 26 04 80 12 54 28 26 05 80 15 20 3B 37 06 24 15 01 24 ...
  f/3/r           : BLOB  15 30 01 01 00 24 02 01 37 03 24 14 00 18 26 04 80 12 54 28 26 05 80 15 20 3B 37 06 24 14 00 18 ...
  g/fidx          : BLOB  15 24 00 04 36 01 04 01 04 02 04 03 18 18 
Namespace node
  min_uu_ep_id    : U16   18
Namespace bridge
  ep_id_array     : BLOB  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

When I look at the device again in Google Home it says it has three fabrics, but F2 is F1 duplicated.

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 10, 2023

Wasting space with 20 bytes is because this code in esp-matter core is insufficient:
https://github.com/espressif/esp-matter/blob/main/components/esp_matter/esp_matter_core.cpp#L1316

It needs to be a switch() with more cases to account for one and two byte attribute values. A similar switch is needed when the values are read.

@jonsmirl
Copy link
Contributor Author

Also, is it esp-matter which is not respecting the feature map and simply persisting all attribute values?

@shubhamdp
Copy link
Contributor

Thanks @jonsmirl for reporting. It looks like you are creating quiet a lot of endpoints, 17.

Storing blobs in NVS takes a lot of space than primitive data types (structure of nvs entry), treating them as primitive types is better approach and would save a lot, working on that.

g/su/... is for subscription resumption and f/.. is fabric.
Not sure why f/2 is duplicated to f/3.

For color control cluster (300:... entries), I don't think they would show up if not using the control control cluster.

Can you provide the data-model that you are using for this, so that I can run some tests at my end to compare things before/after my changes.

@jonsmirl
Copy link
Contributor Author

I believe your permissions are set to view this:
https://github.com/Lowpan-com/lowpan/blob/lovyan/main/ep.cpp#L332
I have 18 endpoints.

Boris fixed the g/su/... bug.

300:3 Mandatory
300:4 Mandatory
300:7 Mandatory
300:8 Mandatory
300:4001 Mandatory
300:4002 Optional
300:4003 Optional
300:4004 Optional
I had copied pasted coded which enabled 4002/4003/4004. I just removed that code, so that part was my bug.

When you get shrinking the blobs down working I can combine everything and recheck. Then I will hunt for who is duplicating that fabric.

@jonsmirl
Copy link
Contributor Author

This is the fix for the g/su/.. bug.
project-chip/connectedhomeip#26039

@shubhamdp
Copy link
Contributor

@jonsmirl I have working patch for this, but thinking about handling upgrades with this as this will break the nvs data structure. Right now handling this using config option. Also, there's a way to handle it runtime, working on that.

@jonsmirl
Copy link
Contributor Author

Always write the values using the new format. When you read the values you need to allow for two different sizes on the read - old and new.

@shubhamdp
Copy link
Contributor

@jonsmirl we have pushed the changes in 05016db, PTAL.

Keeping the issue open for a while.

@dhrishi
Copy link
Collaborator

dhrishi commented Apr 27, 2023

Closing this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants