-
Notifications
You must be signed in to change notification settings - Fork 217
Description
Describe the bug
It has been observed that the ESP-Matter factory reset does not work as expected when the device is not connected to a Wi-Fi router post matter commissioning and at boot time. In this scenario, the factory reset fails to fully clear fabric and other persistent states, resulting in stale information being retained.
Test Case 1 – Expected Behavior (Pass)
1. Commission the Matter device using the chip tool.
2. Verify that commissioning completes successfully and the device is connected to the Wi-Fi network.
3. After successful commissioning, trigger a Matter factory reset.
4. The device enters standard commissioning mode (advertising over BLE) after the factory reset.
Test Case 2 – Expected Behavior (Pass)
1. Commission the Matter device using the chip tool.
2. Verify that commissioning completes successfully and the device is connected to the Wi-Fi network.
3. After successful commissioning, switch off the Wi-Fi network.
4. The device disconnects from Wi-Fi and periodically attempts to reconnect.
5. Trigger the Matter factory reset.
6. The device enters standard commissioning mode (advertising over BLE) after the factory reset.
Test Case 3 – Unexpected Behavior (Fail)
1. Commission the Matter device using the chip tool.
2. Verify that commissioning completes successfully and the device is connected to the Wi-Fi network.
3. After successful commissioning, switch off the Wi-Fi network.
4. Reboot the device.
5. After reboot, the device repeatedly attempts to reconnect to the Wi-Fi network.
6. Trigger the Matter factory reset.
Expected: The device should enter standard commissioning mode (advertising over BLE).
Actual: The device does not enter commissioning mode. Some factory reset operations fail, fabric information is not cleared, and the device continues attempting to reconnect to the Wi-Fi network even after the factory reset.
Log:
I (13028) pp: pp rom version: 9387209
I (13032) net80211: net80211 rom version: 9387209
I (13038) wifi:wifi driver task: 3fcbe71c, prio:23, stack:6656, core=0
I (13055) wifi:wifi firmware version: 79fa3f41ba
I (13055) wifi:wifi certification version: v7.0
I (13055) wifi:config NVS flash: enabled
I (13056) wifi:config nano formatting: disabled
I (13060) wifi:Init data frame dynamic rx buffer num: 32
I (13065) wifi:Init static rx mgmt buffer num: 5
I (13069) wifi:Init management short buffer num: 32
I (13074) wifi:Init dynamic tx buffer num: 32
I (13078) wifi:Init static tx FG buffer num: 2
I (13082) wifi:Init static rx buffer size: 2212
I (13086) wifi:Init static rx buffer num: 10
I (13090) wifi:Init dynamic rx buffer num: 32
I (13094) wifi_init: rx ba win: 6
I (13098) wifi_init: accept mbox: 6
I (13102) wifi_init: tcpip mbox: 32
I (13106) wifi_init: udp mbox: 6
I (13110) wifi_init: tcp mbox: 6
I (13113) wifi_init: tcp tx win: 5760
I (13118) wifi_init: tcp rx win: 5760
I (13122) wifi_init: tcp mss: 1440
I (13126) wifi_init: WiFi IRAM OP enabled
I (13131) wifi_init: WiFi RX IRAM OP enabled
I (13144) chip[DL]: NVS set: chip-counters/reboot-count = 2 (0x2)
I (13146) BLE_INIT: BT controller compile version [d74042a]
I (13149) BLE_INIT: Bluetooth MAC: 84:f7:03:29:08:62
I (13155) phy_init: phy_version 1200,2b7123f9,Feb 18 2025,15:22:21
I (13196) NimBLE: GAP procedure initiated: stop advertising.
I (13197) CHIP[DL]: BLE host-controller synced
I (13699) chip[DL]: Configuring CHIPoBLE advertising (interval 25 ms, connectable)
I (13699) NimBLE: GAP procedure initiated: advertise;
I (13702) NimBLE: disc_mode=2
I (13705) NimBLE: adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=40 adv_itvl_max=40
I (13715) NimBLE:
I (13719) chip[DL]: CHIPoBLE advertising started
I (13723) chip[DL]: Starting ESP WiFi layer
I (13730) wifi:mode : sta (84:f7:03:29:08:60) + softAP (84:f7:03:29:08:61)
I (13735) wifi:enable tsf
I (13737) wifi:Total power save buffer number: 16
I (13741) wifi:Init max length of beacon: 752/752
I (13746) wifi:Init max length of beacon: 752/752
I (13750) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 43
W (13757) wifi:Haven't to connect to a suitable AP now!
I (13762) chip[DL]: Attempting to connect WiFi station interface
I (13764) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 2
I (13776) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 43
I (13783) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 12
I (13772) chip[DL]: WiFi station state change: NotConnected -> Connecting
I (13798) chip[DL]: Done driving station state, nothing else to do...
I (13805) chip[SVR]: Initializing subscription resumption storage...
I (13813) chip[SVR]: Server initializing...
I (13817) chip[TS]: Last Known Good Time: 2023-10-14T01:16:48
I (13827) chip[FP]: Fabric index 0x1 was retrieved from storage. Compressed FabricId 0xD77074AC6AE155B2, FabricId 0x0000000000000001, NodeId 0x0000000000000001, VendorId 0xFFF1
I (13840) chip[DMG]: AccessControl: initializing
I (13844) chip[DMG]: Examples::AccessControlDelegate::Init
I (13851) chip[DMG]: AccessControl: setting
I (13855) chip[DMG]: DefaultAclStorage: initializing
I (13862) chip[DMG]: DefaultAclStorage: 1 entries loaded
I (13867) chip[SVR]: WARNING: mTestEventTriggerDelegate is null
I (13900) esp_matter_cluster: Cluster plugin init common callback
I (13905) chip[DMG]: AccessControlCluster: initializing
I (13906) chip[SVR]: Fabric already commissioned. Disabling BLE advertisement
I (13910) chip[IN]: CASE Server enabling CASE session setups
I (13917) chip[SVR]: Joining Multicast groups
I (13923) chip[SVR]: Server Listening...
I (13926) chip[DL]: WIFI_EVENT_STA_START
W (13930) wifi:Haven't to connect to a suitable AP now!
I (13935) chip[DL]: Attempting to connect WiFi station interface
E (13941) wifi:sta is connecting, return error
E (13945) chip[DL]: esp_wifi_connect() failed: UNKNOWN ERROR
I (13952) NimBLE: GAP procedure initiated: stop advertising.
I (13959) chip[DL]: CHIPoBLE advertising stopped
I (13964) NimBLE: GAP procedure initiated: stop advertising.
I (13972) MATT_APP: Matter Start - success
W (13974) MATT_APP: fab count = 1
I (14029) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 3
I (14030) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 13
I (14033) chip[DL]: WIFI_EVENT_STA_STOP
I (14037) chip[DL]: Starting ESP WiFi layer
E (14042) chip[DL]: esp_wifi_start() failed: UNKNOWN ERROR
I (14049) wifi:flush txq
I (14050) wifi:stop sw txq
I (14053) wifi:lmac stop hw txq
W (14106) M_HELPER: Apply last saved wifi cred
I (14106) wifi:(2.4G)set country: cc=IN schan=1 nchan=13 policy=1
I (14108) wifi:mode : sta (84:f7:03:29:08:60)
I (14109) wifi:enable tsf
I (14112) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 43
I (14120) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 2
I (14126) chip[DL]: WIFI_EVENT_STA_START
W (14131) wifi:Haven't to connect to a suitable AP now!
I (14136) chip[DL]: Attempting to connect WiFi station interface
I (14144) chip[DL]: Done driving station state, nothing else to do...
E (14149) wifi:sta is connecting, return error
I (14153) PAL: WAITING FOR WIFI 0x3fcb2a88
I (15713) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 5
I (15713) chip[DL]: WIFI_EVENT_STA_DISCONNECTED
I (15714) chip[DL]: WiFi station state change: Connecting -> Connecting_Failed
W (15723) wifi:Haven't to connect to a suitable AP now!
E (15727) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
W (15738) wifi:Haven't to connect to a suitable AP now!
I (15742) chip[DL]: WiFi station state change: Connecting_Failed -> NotConnected
W (15750) wifi:Haven't to connect to a suitable AP now!
E (15755) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (15765) chip[DL]: Next WiFi station reconnect in 5000 ms
I (15771) chip[DL]: Done driving station state, nothing else to do...
I (15972) chip[DL]: BLE deinit successful and memory reclaimed
W (20772) wifi:Haven't to connect to a suitable AP now!
I (20773) chip[DL]: Attempting to connect WiFi station interface
I (20774) chip[DL]: WiFi station state change: NotConnected -> Connecting
W (20780) wifi:Haven't to connect to a suitable AP now!
E (20785) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (20795) chip[DL]: Done driving station state, nothing else to do...
I (22344) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 5
I (22344) chip[DL]: WIFI_EVENT_STA_DISCONNECTED
I (22345) chip[DL]: WiFi station state change: Connecting -> Connecting_Failed
W (22353) wifi:Haven't to connect to a suitable AP now!
E (22358) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
W (22368) wifi:Haven't to connect to a suitable AP now!
I (22373) chip[DL]: WiFi station state change: Connecting_Failed -> NotConnected
W (22381) wifi:Haven't to connect to a suitable AP now!
E (22386) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (22396) chip[DL]: Next WiFi station reconnect in 5000 ms
I (22402) chip[DL]: Done driving station state, nothing else to do...
W (27403) wifi:Haven't to connect to a suitable AP now!
I (27404) chip[DL]: Attempting to connect WiFi station interface
I (27405) chip[DL]: WiFi station state change: NotConnected -> Connecting
W (27411) wifi:Haven't to connect to a suitable AP now!
E (27416) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (27426) chip[DL]: Done driving station state, nothing else to do...
I (28975) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 5
I (28975) chip[DL]: WIFI_EVENT_STA_DISCONNECTED
I (28976) chip[DL]: WiFi station state change: Connecting -> Connecting_Failed
W (28984) wifi:Haven't to connect to a suitable AP now!
E (28989) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
W (28999) wifi:Haven't to connect to a suitable AP now!
I (29004) chip[DL]: WiFi station state change: Connecting_Failed -> NotConnected
W (29012) wifi:Haven't to connect to a suitable AP now!
E (29017) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (29027) chip[DL]: Next WiFi station reconnect in 5000 ms
I (29033) chip[DL]: Done driving station state, nothing else to do...
W (34034) wifi:Haven't to connect to a suitable AP now!
I (34035) chip[DL]: Attempting to connect WiFi station interface
I (34036) chip[DL]: WiFi station state change: NotConnected -> Connecting
W (34042) wifi:Haven't to connect to a suitable AP now!
E (34047) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F
I (34057) chip[DL]: Done driving station state, nothing else to do...
I (34706) DEV_CTRL: Reset ac params
I (34709) PAL: Factory reset requested
I (34709) NVM_STORE: devstate_e sz = 4
I (34723) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 3
I (34723) chip[DL]: WIFI_EVENT_STA_STOP
I (34723) chip[DL]: Starting ESP WiFi layer
E (34728) chip[DL]: esp_wifi_start() failed: UNKNOWN ERROR
I (34734) wifi:flush txq
I (34736) wifi:stop sw txq
I (34739) wifi:lmac stop hw txq
I (310) cpu_start: Unicore app
Environment
-
ESP-Matter Commit Id: 75775c0 (release/v1.5)
-
ESP-IDF Commit Id: 4c2820d377d1375e787bcef612f0c32c1427d183 (v5.4.1)
-
SoC (eg: ESP32 or ESP32-C3): ESP32-C3
-
Device Logs (Please attach the log file): Shared above
-
Host Machine OS: Ubuntu
-
Host Machine Python version: 3.10/3.11
-
Commissioner app and versions if present: NA
-
Home hub app and versions if present: NA
-
Commissioner's logs if present: NA
Any additional details
...