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

ESP32: Fix to connect to wifi using shell command #34080

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

ready2die4u
Copy link
Contributor

  • Fix an issue that 'matter wifi connect' doesn't work on ESP32 by calling chip::Shell::SetWiFiDriver
  • As-Is
  > matter wifi connect <ssid> <password>
  Error: 45
  • To-Be
> matter wifi connect <ssid> <password>

I (14646) chip[SH]: Adding/Updating network _<ssid>_
I (14646) chip[SH]: Connecting to network
I (14646) chip[NP]: ESP NetworkCommissioningDelegate: SSID: _<ssid>_
W (14656) wifi:Haven't to connect to a suitable AP now!
I (14656) chip[DL]: WiFi station mode change: Enabled -> Disabled
I (14706) chip[DL]: Changing ESP WiFi mode: STA -> STA+AP
I (14716) wifi:mode : sta (3c:61:05:07:32:9c) + softAP (fa:4d:9b:35:8c:3a)
I (14716) wifi:Total power save buffer number: 16
I (14716) wifi:Init max length of beacon: 752/752
I (14726) wifi:Init max length of beacon: 752/752

I (14746) chip[DL]: WiFi station mode change: Disabled -> Enabled
Done
W (14746) wifi:Haven't to connect to a suitable AP now!
I (14746) chip[DL]: I (14746) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
Attempting to connect WiFi station interface
I (14766) chip[DL]:                                                                                                                                                                                                                                                                     
I (14776) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<1,1>, prof:1

> I (15016) wifi:state: init -> auth (b0)
I (15026) chip[DL]: Done driving station state, nothing else to do...
I (15026) wifi:state: auth -> assoc (0)
I (15026) chip[DL]: Attempting to connect WiFi station interface
E (15026) wifi:sta is connecting, return error
E (15046) chip[DL]: esp_wifi_connect() failed: ESP_ERR_WIFI_CONN
I (15046) chip[DL]: Attempting to connect WiFi station interface
I (15046) wifi:state: assoc -> run (10)
E (15056) wifi:sta is connecting, return error
E (15056) chip[DL]: esp_wifi_connect() failed: ESP_ERR_WIFI_CONN
I (15066) chip[DL]: WIFI_EVENT_AP_START
I (15076) chip[DL]: WiFi AP state change: NotActive -> Active
I (15076) chip[DL]: Changing ESP WiFi mode: STA+AP -> STA
I (15086) wifi:<ba-add>idx:0 (ifx:0, 90:9f:33:66:a7:3e), tid:0, ssn:0, winSize:64
I (15086) wifi:mode : sta (3c:61:05:07:32:9c)
I (15096) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 13
I (15106) chip[DL]: WiFi AP state change: Active -> Deactivating
I (15106) app-devicecallbacks: Current free heap: 41320

I (15116) chip[DL]: WIFI_EVENT_AP_STOP
I (15116) chip[DL]: WiFi AP state change: Deactivating -> NotActive
I (15126) app-devicecallbacks: Current free heap: 41592

I (15136) wifi:connected with _<ssid>_, aid = 2, channel 1, 40U, bssid = _<AP MAC Address>_
I (15136) wifi:security: WPA2-PSK, phy: bgn, rssi: -32
I (15236) wifi:pm start, type: 1

I (15236) wifi:AP's beacon interval = 102400 us, DTIM period = 3
I (15246) chip[DL]: Posting ESPSystemEvent: Wifi Event with eventId : 4
I (15246) chip[DL]: WIFI_EVENT_STA_CONNECTED
I (15246) chip[DL]: WiFi station state change: Connecting -> Connecting_Succeeded
I (15266) chip[DL]: WiFi station state change: Connecting_Succeeded -> Connected
I (15266) chip[DL]: WiFi station interface connected
I (15276) chip[ZCL]: WiFiDiagnosticsDelegate: OnConnectionStatusChanged
I (15286) chip[DL]: Done driving station state, nothing else to do...
I (15296) app-devicecallbacks: Current free heap: 40972

- Fix an issue that 'matter wifi connect' doesn't work on ESP32
  by calling chip::Shell::SetWiFiDriver
Copy link

github-actions bot commented Jun 26, 2024

PR #34080: Size comparison from 58536ba to d051399

Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 58536ba d051399 change % change
bl602 lighting-app bl602 FLASH 1270548 1270548 0 0.0
RAM 95328 95328 0 0.0
bl602+mfd FLASH 1284806 1284806 0 0.0
RAM 95472 95472 0 0.0
bl602+rpc FLASH 1309764 1309764 0 0.0
RAM 103752 103752 0 0.0
bl702 lighting-app bl702 FLASH 1091444 1091444 0 0.0
RAM 15161 15161 0 0.0
bl702+mfd FLASH 1102138 1102138 0 0.0
RAM 15313 15313 0 0.0
bl702+rpc FLASH 1181254 1181254 0 0.0
RAM 24181 24181 0 0.0
bl706-eth FLASH 874788 874788 0 0.0
RAM 27272 27272 0 0.0
bl706-wifi FLASH 1127088 1127088 0 0.0
RAM 14605 14605 0 0.0
bl702l lighting-app bl702l FLASH 1078330 1078330 0 0.0
RAM 21732 21732 0 0.0
bl702l+mfd FLASH 1089592 1089592 0 0.0
RAM 21892 21892 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 798008 798008 0 0.0
RAM 103096 103096 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 813764 813764 0 0.0
RAM 113568 113568 0 0.0
lock-mtd LP_EM_CC1354P10_6 FLASH 803288 803288 0 0.0
RAM 107696 107696 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 756080 756080 0 0.0
RAM 101788 101788 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 741752 741752 0 0.0
RAM 102036 102036 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 605754 605754 0 0.0
RAM 204508 204508 0 0.0
lock CC3235SF_LAUNCHXL FLASH 650782 650782 0 0.0
RAM 204780 204780 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 665785 665785 0 0.0
RAM 75100 75100 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 685637 685637 0 0.0
RAM 77732 77732 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 685637 685637 0 0.0
RAM 77732 77732 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 642565 642565 0 0.0
RAM 70168 70168 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 608345 608345 0 0.0
RAM 70804 70804 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 627981 627981 0 0.0
RAM 73356 73356 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 627981 627981 0 0.0
RAM 73356 73356 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 623825 623825 0 0.0
RAM 73820 73820 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 643541 643541 0 0.0
RAM 76372 76372 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 643541 643541 0 0.0
RAM 76372 76372 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 592397 592397 0 0.0
RAM 67788 67788 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 612249 612249 0 0.0
RAM 70420 70420 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 612249 612249 0 0.0
RAM 70420 70420 0 0.0
efr32 lighting-app BRD4187C FLASH 908680 908672 -8 -0.0
RAM 132492 132492 0 0.0
lock-app BRD4338a FLASH 745336 745328 -8 -0.0
RAM 172300 172300 0 0.0
window-app BRD4187C FLASH 995732 995732 0 0.0
RAM 127108 127108 0 0.0
esp32 all-clusters-app c3devkit DRAM 88332 88332 0 0.0
FLASH 1468676 1468676 0 0.0
IRAM 75570 75570 0 0.0
m5stack DRAM 114796 114796 0 0.0
FLASH 1537827 1537763 -64 -0.0
IRAM 125403 125403 0 0.0
linux air-purifier-app debug unknown 4560 4560 0 0.0
FLASH 2528064 2528064 0 0.0
RAM 125048 125048 0 0.0
all-clusters-app debug unknown 5344 5344 0 0.0
FLASH 5577774 5577774 0 0.0
RAM 479320 479320 0 0.0
all-clusters-minimal-app debug unknown 5264 5264 0 0.0
FLASH 5050248 5050248 0 0.0
RAM 232872 232872 0 0.0
bridge-app debug unknown 5232 5232 0 0.0
FLASH 4476248 4476248 0 0.0
RAM 212768 212768 0 0.0
chip-tool debug unknown 5696 5696 0 0.0
FLASH 11548103 11548103 0 0.0
RAM 531386 531386 0 0.0
chip-tool-ipv6only arm64 unknown 19816 19816 0 0.0
FLASH 10680468 10680468 0 0.0
RAM 580120 580120 0 0.0
fabric-admin debug unknown 5576 5576 0 0.0
FLASH 10546967 10546967 0 0.0
RAM 525434 525434 0 0.0
fabric-bridge-app debug unknown 5240 5240 0 0.0
FLASH 4346792 4346792 0 0.0
RAM 204896 204896 0 0.0
lighting-app debug+rpc+ui unknown 5904 5904 0 0.0
FLASH 5371954 5371954 0 0.0
RAM 221576 221576 0 0.0
lock-app debug unknown 5168 5168 0 0.0
FLASH 4539848 4539848 0 0.0
RAM 200184 200184 0 0.0
ota-provider-app debug unknown 4552 4552 0 0.0
FLASH 4195592 4195592 0 0.0
RAM 194448 194448 0 0.0
ota-requestor-app debug unknown 4488 4488 0 0.0
FLASH 4321080 4321080 0 0.0
RAM 199104 199104 0 0.0
shell debug unknown 4112 4112 0 0.0
FLASH 2793693 2793693 0 0.0
RAM 150416 150416 0 0.0
thermostat-no-ble arm64 unknown 9184 9184 0 0.0
FLASH 4167084 4167084 0 0.0
RAM 235800 235800 0 0.0
tv-app debug unknown 5448 5448 0 0.0
FLASH 5592984 5592984 0 0.0
RAM 341672 341672 0 0.0
tv-casting-app debug unknown 5056 5056 0 0.0
FLASH 9732142 9732142 0 0.0
RAM 397280 397280 0 0.0
mbed lock-app-release cy8cproto_062_4343w FLASH 1502076 1502076 0 0.0
RAM 226656 226656 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 880800 880800 0 0.0
RAM 139693 139693 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 951612 951612 0 0.0
RAM 138121 138121 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 826356 826356 0 0.0
RAM 138591 138591 0 0.0
nxp contact k32w0+release FLASH 575596 575596 0 0.0
RAM 70024 70024 0 0.0
k32w1+release FLASH 590736 590736 0 0.0
RAM 74056 74056 0 0.0
light k32w0+release FLASH 609680 609680 0 0.0
RAM 69500 69500 0 0.0
k32w1+release FLASH 674248 674248 0 0.0
RAM 82816 82816 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1613356 1613356 0 0.0
RAM 207148 207148 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1534108 1534108 0 0.0
RAM 204052 204052 0 0.0
light cy8ckit_062s2_43012 FLASH 1461004 1461004 0 0.0
RAM 197332 197332 0 0.0
lock cy8ckit_062s2_43012 FLASH 1462860 1462860 0 0.0
RAM 224396 224396 0 0.0
qpg lighting-app qpg6105+debug FLASH 650612 650612 0 0.0
RAM 104564 104564 0 0.0
lock-app qpg6105+debug FLASH 610736 610736 0 0.0
RAM 99240 99240 0 0.0
stm32 light STM32WB5MM-DK FLASH 472056 472056 0 0.0
RAM 141652 141652 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 632136 632136 0 0.0
RAM 50528 50528 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 657028 657028 0 0.0
RAM 145872 145872 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 777102 777102 0 0.0
RAM 110684 110684 0 0.0
bridge-app tlsr9258a FLASH 675120 675120 0 0.0
RAM 95304 95304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 633720 633720 0 0.0
RAM 50572 50572 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 719514 719514 0 0.0
RAM 77148 77148 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 612162 612162 0 0.0
RAM 142104 142104 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 799722 799722 0 0.0
RAM 100508 100508 0 0.0
lock-app-dfu tlsr9528a FLASH 665284 665284 0 0.0
RAM 69860 69860 0 0.0
ota-requestor-app tlsr9258a FLASH 694450 694450 0 0.0
RAM 95028 95028 0 0.0
pump-app tlsr9518adk80d FLASH 615984 615984 0 0.0
RAM 56952 56952 0 0.0
pump-controller-app tlsr9518adk80d FLASH 606368 606368 0 0.0
RAM 56752 56752 0 0.0
shell tlsr9518adk80d FLASH 466182 466182 0 0.0
RAM 72484 72484 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 640080 640080 0 0.0
RAM 52200 52200 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 650194 650194 0 0.0
RAM 60388 60388 0 0.0
thermostat tlsr9518adk80d FLASH 625258 625258 0 0.0
RAM 57084 57084 0 0.0
window-covering tlsr9118bdk40d FLASH 518710 518710 0 0.0
RAM 97800 97800 0 0.0
tizen all-clusters-app arm unknown 1568 1568 0 0.0
FLASH 1632632 1632632 0 0.0
RAM 46012 46012 0 0.0
chip-tool-ubsan arm unknown 2368 2368 0 0.0
FLASH 15881274 15881274 0 0.0
RAM 6971876 6971876 0 0.0

@mergify mergify bot merged commit f57b791 into project-chip:master Jul 2, 2024
68 checks passed
austina-csa pushed a commit to austina-csa/connectedhomeip that referenced this pull request Jul 10, 2024
- Fix an issue that 'matter wifi connect' doesn't work on ESP32
  by calling chip::Shell::SetWiFiDriver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants