-
Notifications
You must be signed in to change notification settings - Fork 48
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
Sorting of scanned wifi networks #661
Conversation
7d2aebe
to
f234c27
Compare
Works on Pico, which is what I was after as it was affecting my testing of other things. No known network sorted response details
And success (failing on connect attempt #0, but succeeding on # 1 aka 2nd attempt): Details
|
@brentru this is ready for review. I should retest on the other platforms, especially samd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyeth I have a few review notes below and also some questions:
- Do we take the network with the highest RSSI?
- If we fail to connect to the defined network, do we try again with the next network in our list of networks?
- What is the purpose of sorting by RSSI if we are not going to take the network with the largest RSSI or if its not defined?
806690f
to
a6b68cd
Compare
|
ee9b0ba
to
a1ea262
Compare
Log of wifi multi connection attempt on ESP8266 with Wifi debug logging on (can't generate for WS firmware due to dbg size)
Original log``` 02:03:30.974 -> rll��|�l�|��l�b|������r�b�b��nn�lnn���b�p��lrlrlp�n����l��bn�|�����b��nn�l��l`����nnl`���nr���nbl��lp�n���r��������bn�|��b��nn�l`����nnl`���nr���nb��`��r��nb��`������l`���n��l������n�r��n|�l�l`��b����|�r��l�n��n�l`���r�l�l��� 02:03:31.083 -> SDK:2.2.2-dev(38a443e)/Core:3.1.2=30102000/lwIP:STABLE-2_1_3_RELEASE/glue:1.2-65-g06164fb/BearSSL:b024386 02:03:31.083 -> 02:03:31.083 -> ESP8266 Multi WiFi example 02:03:31.083 -> fpm close 1 02:03:31.083 -> mode : sta(c8:c9:a3:90:31:eb) 02:03:31.083 -> add if0 02:03:31.083 -> wifi evt: 8 02:03:31.209 -> [WIFIM][APlistAdd] Add SSID: free4all 02:03:31.209 -> [WIFIM] Start scan 02:03:33.353 -> scandone 02:03:33.426 -> [WIFIM] 7 networks found: 02:03:33.426 -> 0: [CH 01] [48:D3:43:A2:44:81] -87dBm * Shaun 02:03:33.426 -> 1: [CH 06] [40:0D:10:5C:DD:39] -91dBm * VM7307174 02:03:33.426 -> ---> 2: [CH 08] [B2:7C:61:82:2F:A1] -75dBm * free4all 02:03:33.426 -> ---> 3: [CH 08] [C8:7F:54:D8:39:BC] -30dBm * free4all 02:03:33.426 -> ---> 4: [CH 08] [62:7C:61:82:50:F1] -83dBm * free4all 02:03:33.426 -> ---> 5: [CH 08] [82:7F:54:A1:5B:41] -63dBm * free4all 02:03:33.426 -> 6: [CH 11] [18:35:D1:3A:09:09] -75dBm * VM7662787 02:03:33.426 -> [WIFIM] Sorted indices: 3 5 2 4 02:03:33.426 -> [WIFIM] Connecting free4all 02:03:33.426 -> wifi evt: 2 02:03:33.509 -> scandone 02:03:34.354 -> state: 0 -> 2 (b0) 02:03:34.355 -> state: 2 -> 3 (0) 02:03:34.392 -> state: 3 -> 5 (10) 02:03:34.392 -> add 0 02:03:34.392 -> aid 15 02:03:34.392 -> cnt 02:03:34.392 -> 02:03:34.392 -> connected with free4all, channel 8 02:03:34.392 -> dhcp client start... 02:03:34.392 -> wifi evt: 0 02:03:38.419 -> [WIFIM] Connect timeout 02:03:38.419 -> [WIFIM] Connecting free4all 02:03:38.462 -> ap_loss 02:03:38.462 -> scandone 02:03:38.462 -> state: 5 -> 0 (0) 02:03:38.462 -> rm 0 02:03:38.462 -> reconnect 02:03:38.462 -> wifi evt: 1 02:03:38.462 -> STA disconnect: 8 02:03:39.126 -> scandone 02:03:40.009 -> state: 0 -> 2 (b0) 02:03:40.042 -> state: 2 -> 3 (0) 02:03:40.042 -> state: 3 -> 5 (10) 02:03:40.042 -> add 0 02:03:40.042 -> aid 8 02:03:40.042 -> cnt 02:03:40.042 -> 02:03:40.042 -> connected with free4all, channel 8 02:03:40.042 -> dhcp client start... 02:03:40.042 -> wifi evt: 0 02:03:42.073 -> ip:192.168.50.226,mask:255.255.255.0,gw:192.168.50.1 02:03:42.073 -> wifi evt: 3 02:03:42.141 -> [WIFIM] Connected: 02:03:42.141 -> [WIFIM] SSID: free4all 02:03:42.141 -> [WIFIM] IP: 192.168.50.226 02:03:42.141 -> [WIFIM] MAC: 82:7F:54:A1:5B:41 02:03:42.141 -> [WIFIM] CH: 8 02:03:42.141 -> [WIFIM] RSSI: -71 02:03:42.141 -> WiFi connected: free4all 192.168.50.226 02:03:43.119 -> WiFi connected: free4all 192.168.50.226 02:03:44.136 -> WiFi connected: free4all 192.168.50.226 ``` |
1c9ca3b
to
21f893a
Compare
5d54832
to
1f0468b
Compare
@tyeth LGTM, merge when tests are passing |
1f0468b
to
0de83b9
Compare
Addresses #659