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

Add support for hidden networks in WiFiMulti #9202

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

lucasssvaz
Copy link
Collaborator

@lucasssvaz lucasssvaz commented Feb 1, 2024

Description of Change

Adds the possibility of using hidden networks in WiFiMulti.

Tests scenarios

Tested using WiFiMulti example with hidden mobile hotspot:

[   715][V][esp32-hal-uart.c:396] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(3) txPin(1)
[   724][V][esp32-hal-uart.c:482] uartBegin(): UART0 not installed. Starting installation
[   734][V][esp32-hal-uart.c:527] uartBegin(): UART0 initialization done.
[   759][I][WiFiMulti.cpp:89] addAP(): [WIFI][APlistAdd] add SSID: Vans
Connecting Wifi...
[   782][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 0 - WIFI_READY
[   857][V][WiFiGeneric.cpp:345] _arduino_event_cb(): STA Started
[   864][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 2 - STA_START
[  2569][V][WiFiGeneric.cpp:388] _arduino_event_cb(): SCAN Done: ID: 128, Status: 0, Results: 6
[  2577][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 1 - SCAN_DONE
[  2585][I][WiFiMulti.cpp:133] run(): [WIFI] scan done
[  2590][I][WiFiMulti.cpp:138] run(): [WIFI] 6 networks found
[  2596][V][WiFiMulti.cpp:170] run(): hidden ssid on channel 11 found, trying to connect with known credentials...
[  2608][V][WiFiGeneric.cpp:98] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[  4621][V][WiFiGeneric.cpp:367] _arduino_event_cb(): STA Disconnected: SSID: Vans, BSSID: b2:f6:77:18:57:34, Reason: 39
[  4632][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[  4640][W][WiFiGeneric.cpp:1081] _eventCallback(): Reason: 39 - TIMEOUT
[  4646][D][WiFiGeneric.cpp:1101] _eventCallback(): WiFi Reconnect Running
[  4655][V][WiFiGeneric.cpp:98] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
E (9367) wifi:Set status to INIT
[  4692][V][WiFiGeneric.cpp:367] _arduino_event_cb(): STA Disconnected: SSID: Vans, BSSID: b2:f6:77:18:57:34, Reason: 203
[  4705][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[  4713][W][WiFiGeneric.cpp:1081] _eventCallback(): Reason: 203 - ASSOC_FAIL
[  4720][D][WiFiGeneric.cpp:1105] _eventCallback(): WiFi AutoReconnect Running
[  4729][V][WiFiGeneric.cpp:98] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[  5814][V][WiFiGeneric.cpp:360] _arduino_event_cb(): STA Connected: SSID: Vans, BSSID: b2:f6:77:18:57:34, Channel: 11, Auth: WPA2_WPA3_PSK
[  5827][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
[  6360][V][WiFiGeneric.cpp:374] _arduino_event_cb(): STA Got New IP:192.168.99.107
[  6368][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[  6375][D][WiFiGeneric.cpp:1119] _eventCallback(): STA IP: 192.168.99.107, MASK: 255.255.255.0, GW: 192.168.99.184
[  6387][V][WiFiGeneric.cpp:367] _arduino_event_cb(): STA Disconnected: SSID: Vans, BSSID: b2:f6:77:18:57:34, Reason: 8
[  6397][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[  6405][W][WiFiGeneric.cpp:1081] _eventCallback(): Reason: 8 - ASSOC_LEAVE
[  6422][V][WiFiMulti.cpp:205] run(): hidden ssid Vans found
[  6428][V][WiFiMulti.cpp:213] run(): rssi_scan: -27, bestNetworkDb: -2147483648
[  6435][V][WiFiMulti.cpp:216] run(): best network is now: Vans
[  6441][D][WiFiMulti.cpp:232] run():  --->   0: [11][B2:F6:77:18:57:34] Vans (-27) (*) (hidden)
[  6449][D][WiFiMulti.cpp:232] run():         1: [6][84:0B:BB:29:C2:20] Vaz_2.4GHz (-46) (*) (visible)
[  6458][D][WiFiMulti.cpp:232] run():         2: [11][80:20:DA:45:7E:E2] CLARO_2G457EDD (-53) (*) (visible)
[  6468][D][WiFiMulti.cpp:232] run():         3: [1][84:0B:BB:47:4B:20] DORY (-62) (*) (visible)
[  6477][D][WiFiMulti.cpp:232] run():         4: [1][98:7E:CA:D1:DC:5F] **ELIANE** (-64) (*) (visible)
[  6486][D][WiFiMulti.cpp:232] run():         5: [1][98:77:E7:7A:EA:66] CLARO_2G7AEA61 (-89) (*) (visible)
[  6495][V][WiFiMulti.cpp:242] run(): foundCount = 1, failCount = 0
[  6501][I][WiFiMulti.cpp:252] run(): [WIFI] Connecting BSSID: B2:F6:77:18:57:34 SSID: Vans Channel: 11 (-27)
[  6523][V][WiFiGeneric.cpp:98] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[  6618][V][WiFiGeneric.cpp:360] _arduino_event_cb(): STA Connected: SSID: Vans, BSSID: b2:f6:77:18:57:34, Channel: 11, Auth: WPA2_WPA3_PSK
[  6631][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
[  6661][V][WiFiGeneric.cpp:374] _arduino_event_cb(): STA Got Same IP:192.168.99.107
[  6669][D][WiFiGeneric.cpp:1055] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[  6676][D][WiFiGeneric.cpp:1119] _eventCallback(): STA IP: 192.168.99.107, MASK: 255.255.255.0, GW: 192.168.99.184
[  6686][I][WiFiMulti.cpp:272] run(): [WIFI] Connecting done.
[  6692][D][WiFiMulti.cpp:273] run(): [WIFI] SSID: Vans
[  6697][D][WiFiMulti.cpp:274] run(): [WIFI] IP: 192.168.99.107
[  6703][D][WiFiMulti.cpp:275] run(): [WIFI] MAC: B2:F6:77:18:57:34
[  6709][D][WiFiMulti.cpp:276] run(): [WIFI] Channel: 11
[  6714][D][WiFiMulti.cpp:334] resetFails(): [WIFI] Resetting failure flags

WiFi connected
IP address: 
192.168.99.107

Related links

Re-implementation of #3464
Closes #7189
Closes #8217
Closes #3325

Copy link
Contributor

github-actions bot commented Feb 1, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "Add support for hidden networks in WiFiMulti":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update WiFiMulti.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update WiFiMulti.cpp":
    • summary looks empty
    • type/action looks empty

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 You might consider squashing your 3 commits (simplifying branch history).

👋 Hello lucasssvaz, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against a1c6367

@lucasssvaz lucasssvaz added Status: Review needed Issue or PR is awaiting review Area: WiFi Issue related to WiFi labels Feb 1, 2024
@lucasssvaz lucasssvaz self-assigned this Feb 1, 2024
@dkoneill
Copy link

dkoneill commented Feb 2, 2024

Thanks for refactoring the code in #3464 , I hope that the information there was helpful.

@lucasssvaz
Copy link
Collaborator Author

Thanks for refactoring the code in #3464 , I hope that the information there was helpful.

It was a nice PR. I just wanted to keep the best network selection possible and also re-implementing was easier than solving the conflicts 😅

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Feb 5, 2024
@me-no-dev me-no-dev merged commit 4cbce10 into espressif:master Feb 5, 2024
46 checks passed
@lucasssvaz lucasssvaz deleted the feature/hidden_ssid_list branch February 7, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: WiFi Issue related to WiFi Status: Pending Merge Pull Request is ready to be merged
Projects
None yet
4 participants