project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.39k stars 1.98k forks source link

[BUG] Failed to get configured network when updating network status: Error ESP32:0x0500300F #26052

Open vinay-apple opened 1 year ago

vinay-apple commented 1 year ago

Reproduction steps

SHA: 0f1fc1b230eca4b4ce2f45c4a8cf1ce238284e96

Steps:

  1. Trying to pair M5 board in Apple Home and pairing is failing with below errors seen on M5 logs (also attached)

E (22752) chip[DL]: esp_wifi_connect() failed: ESP_ERR_WIFI_CONN W (22762) wifi:Haven't to connect to a suitable AP now! I (22762) chip[DL]: Attempting to connect WiFi station interface E (22772) wifi:sta is connecting, return error E (22772) chip[DL]: esp_wifi_connect() failed: ESP_ERR_WIFI_CONN W (22782) wifi:Haven't to connect to a suitable AP now! E (22782) chip[DL]: Failed to get configured network when updating network status: Error ESP32:0x0500300F

M5-pairing-fail.txt

Bug prevalence

Most of the times I attempt pairing

GitHub hash of the SDK that was being used

0f1fc1b230eca4b4ce2f45c4a8cf1ce238284e96

Platform

esp32

Platform Version(s)

No response

Anything else?

The issue is seen when trying to pair M5 on a multiple home setup where 2 Apple Homes on 2 different networks are prevalent and we try to pair M5 board on one of the Apple Homes.

bzbarsky-apple commented 1 year ago

Error ESP32:0x0500300F

That would be ESP_ERR_WIFI_NOT_CONNECT, I think.

From a bit earlier in the log:

I (24243) chip[NP]: ESP NetworkCommissioningDelegate: SSID: iPhone-12-pro-max

@vinay-apple what sort of network is the network with that SSID? Most importantly: does it have a 2.4GHz band?

rfortunatov commented 1 year ago

Faced the same issue on ESP32C6 with latest esp-matter branch, though my case is different. I can successfully commission device to HA and Apple Home, though after approximately half an hour Wifi connection drops and devices enters a loop retrying the connection, after power-cycle it successfully connects to Wifi and operates for another half an hour or so.

UPD: My network has both 5GHz and 2.4GHz bands and esp operates on 2.4GHz band

rfortunatov commented 1 year ago

@shubhamdp Can this be ESP related rather than CHIP related?

karlp commented 1 year ago

I've seen this, and needed to make sure that SPIRAM_TRY_ALLOCATE_WIFI_LWIP was enabled. It worked without that on the plain "example-lock" but not by the time I had any sort of application active

rfortunatov commented 1 year ago

@karlp Unfortunately there's no such option for Esp32-C6 module. It's supported only for plain Esp32 or Esp32-S3 modules. Or I'm terribly wrong and missing something.

rfortunatov commented 1 year ago

I guess I've figured it out. What was bugging me with this issue is that my other unit that was flashed long ago was working just fine and the one flashed with latest esp-matter version was constantly failing. So, after retracing the steps it lead me to updating the IDF version from 420ebd208ae9eb71cb71ebd22742d1175f11addc to ea5e0ff298e6257b31d8e0c81435e6d3937f04c7 as a part of esp-matter update. Rolling back IDF version to 420ebd208ae9eb71cb71ebd22742d1175f11addc fixed it for me for good.

farhan-syed commented 3 months ago

@rfortunatov What version is 420ebd208ae9eb71cb71ebd22742d1175f11addc? Having some issues for the past week trying to run Apple's matter example. Apples docs say to install IDF version 5.2.1.