0

and thanks to this wonderful forum!

I'm developing a device that runs Linux embedded using wpa-supplicant. I must be able to connect to any Wifi network with any SSID - including symbols and foreign characters. I've been learning about UTF-8 encoding and experimenting with all types of names for SSID.

When the HotSpot on my Android is called 123=Mechi_abc, the device connects:

Oct  3 07:17:42.222 **wpa_cli scan_results**  
Selected interface 'wlan0'  
bssid / frequency / signal level / flags / ssid  
b2:22:7a:91:85:e5       2437    -75     [WPA2-PSK-CCMP][WPS][ESS][P2P]  DIRECT-E5-HP OfficeJet Pro 8020  
20:58:69:63:89:48       2462    -80     [WPA2-PSK-CCMP][ESS]  
20:58:69:23:89:48       2462    -79     [ESS]   Leumi_Guest  
20:58:69:a3:89:48       2462    -82     [ESS]   Plazma  
**8a:18:94:1d:e9:0f       2462    -21     [ESS]   123=Mechi_abc**  

Oct  3 07:17:42.333 **wpa_cli set_network** 4 ssid '"**123=Mechi_abc**"'

Oct  3 07:17:42.506 **wpa_cli list_networks**  
Selected interface 'wlan0'  
network id / ssid / bssid / flags  
0       MYEYE_AUTO      any     
1       Plazma  any     
2       Leumi_Guest     any     
4       **123=Mechi_abc**   any

Oct  3 07:17:43.104 **wpa_cli select_network** 4

Oct  3 07:17:43.169 **wpa_cli status**  
Selected interface 'wlan0'  
wpa_state=DISCONNECTED  
ip_address=192.168.72.3  
p2p_device_address=34:e1:d1:a7:19:62  
address=34:e1:d1:a7:19:62  
uuid=9f4c27f1-a49d-5486-8821-465bc569b9ea


Oct  3 07:17:43.184 **wpa_cli list_networks**  
Selected interface 'wlan0'  
network id / ssid / bssid / flags  
0       MYEYE_AUTO      any     [DISABLED]  
1       Plazma  any     [DISABLED]  
2       Leumi_Guest     any     [DISABLED]  
4       123=Mechi_abc   any
   

Oct  3 07:18:07.067 **wpa_cli status**  
Selected interface 'wlan0'  
bssid=8a:18:94:1d:e9:0f  
freq=2462  
ssid=**123=Mechi_abc**  
id=4  
mode=station  
pairwise_cipher=NONE  
group_cipher=NONE  
key_mgmt=NONE  
**wpa_state=COMPLETED**  
ip_address=192.168.72.3  
p2p_device_address=34:e1:d1:a7:19:62  
address=34:e1:d1:a7:19:62  
uuid=9f4c27f1-a49d-5486-8821-465bc569b9ea


Oct  3 07:18:07.100 **wpa_cli list_networks**  
Selected interface 'wlan0'  
network id / ssid / bssid / flags  
0       MYEYE_AUTO      any     [DISABLED]  
1       Plazma  any     [DISABLED]  
2       Leumi_Guest     any     [DISABLED]  
4       **123=Mechi_abc   any     [CURRENT]**

When the name of the Android HotSpot is "123מכיabc" (123 + 3 Hebrew letters + abc) - UTF-8 - 123\xd7\x9e\xd7\x9b\xd7\x99abc (which is viewed correctly with Hebrew letters using an iPhone).

The network is found, selected - but the wpa_state remains SCANNING and doesn't become COMPLETED. After a while (1.5 minutes), the device realizes that it's not really connected and tries to find another network:

Oct  3 07:09:50.819 **wpa_cli list_networks**  
Selected interface 'wlan0'  
network id / ssid / bssid / flags  
0       MYEYE_AUTO      any     [DISABLED]  
1       Plazma  any     [DISABLED]  
2       Leumi_Guest     any     [DISABLED]  
8       **123\\xd7\\x9e\\xd7\\x9b\\xd7\\x99abc**    any  

Oct  3 07:09:50.854 **wpa_cli scan_results**  
Selected interface 'wlan0'  
bssid / frequency / signal level / flags / ssid  
b2:22:7a:91:85:e5       2437    -65     [WPA2-PSK-CCMP][WPS][ESS][P2P]  DIRECT-E5-HP OfficeJet Pro 8020  
5e:dc:7a:5a:88:9b       2462    -33     [ESS]   **123\xd7\x9e\xd7\x9b\xd7\x99abc**  
20:58:69:23:89:48       2462    -79     [ESS]   Leumi_Guest  
20:58:69:a3:89:48       2462    -79     [ESS]   Plazma  

Oct  3 07:09:51.127 **wpa_cli select_network 8**  

Oct  3 07:09:51.277 **wpa_cli list_networks**  
Selected interface 'wlan0'  
network id / ssid / bssid / flags  
0       MYEYE_AUTO      any     [DISABLED]  
1       Plazma  any     [DISABLED]  
2       Leumi_Guest     any     [DISABLED]  
8       **123\\xd7\\x9e\\xd7\\x9b\\xd7\\x99abc**    any     **[CURRENT]**  

Oct  3 07:10:15.381 **wpa_cli status**  
Selected interface 'wlan0'  
wpa_state=SCANNING  
ip_address=192.168.72.3  
p2p_device_address=34:e1:d1:a7:19:62  
address=34:e1:d1:a7:19:62  
uuid=9f4c27f1-a49d-5486-8821-465bc569b9ea  

Is there any reason why this is happening? What does the wpa-supplicant "need" in order to change wpa_state from SCANNING to COMPLETED? PLEASE help with ideas.

Thanks, Mechi

Mechi
  • 11
  • 3
  • It's not really but this was the only way I could post the question... – Mechi Oct 03 '22 at 14:27
  • It seems you have double escaping with `\\`? An other possible problem: are you sure about the canonical UTF-8 encoding of your script? Apple is known not to use combining characters (so a different normalization form of Unicode). – Giacomo Catenazzi Oct 03 '22 at 14:38
  • @Giacomo Catenazzi This is the way wpa_cli shows the network names... wpa_cli v2.7 Copyright (c) 2004-2018, Jouni Malinen and contributors This software may be distributed under the terms of the BSD license. See README for more details. Selected interface 'wlan0' Interactive mode > list_networks network id / ssid / bssid / flags 0 MYEYE_AUTO any 1 Plazma any 2 Leumi_Guest any 3 OrCam_WIFI any 4 123=Mechi_abc any 5 123\\xd7\\x9e\\xd7\\x9b\\xd7\\x99abc any 6 123\\xd7\\x9e\\xd7\\x9b\\xd7\\x99abc any – Mechi Oct 06 '22 at 06:20
  • @Giacomo Catenazzi The actual wpa_supplicant.conf is: – Mechi Oct 06 '22 at 06:22
  • cat wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant update_config=1 bgscan="simple:30:-45:300" network={ ssid="MYEYE_AUTO" psk="see4yourself" } network={ ssid="Plazma" key_mgmt=NONE } network={ ssid="Leumi_Guest" key_mgmt=NONE } network={ ssid="OrCam_WIFI" psk="1q2w3e4r" } network={ ssid="123=Mechi_abc" key_mgmt=NONE } network={ ssid="123\xd7\x9e\xd7\x9b\xd7\x99abc" key_mgmt=NONE } network={ ssid="123\xd7\x9e\xd7\x9b\xd7\x99abc" key_mgmt=NONE } – Mechi Oct 06 '22 at 06:25
  • This may be the problem...though how to fix it? Should I take off the quotes in the conf file? I will definitely try this, but what will happen with the actual text? – Mechi Oct 06 '22 at 06:33
  • And if you put the exact characters (encoded UTF-8) in such configuration file, without escaping? In such case, we can derive that the error is in the interface (so easier to fill a bug and get the fix) – Giacomo Catenazzi Oct 06 '22 at 07:34
  • It worked when the name in the conf file is all HEX characters. Now the problem is - why doesn't wpa_supplicant save the names of the found/scanned networks in a way that can be used to connect to them? – Mechi Oct 06 '22 at 08:52
  • network={ ssid=313233d79ed79bd799616263 key_mgmt=NONE disabled=1 } – Mechi Oct 06 '22 at 08:54
  • in wpa_cli - when list_networks: – Mechi Oct 06 '22 at 08:54
  • 5 123\xd7\x9e\xd7\x9b\xd7\x99abc any [CURRENT] – Mechi Oct 06 '22 at 08:55
  • > status bssid=5e:dc:7a:5a:88:9b freq=2462 **ssid=123\xd7\x9e\xd7\x9b\xd7\x99abc** id=5 mode=station pairwise_cipher=NONE group_cipher=NONE key_mgmt=NONE **wpa_state=COMPLETED** ip_address=192.168.251.8 p2p_device_address=34:e1:d1:a7:19:62 address=34:e1:d1:a7:19:62 uuid=9f4c27f1-a49d-5486-8821-465bc569b9ea – Mechi Oct 06 '22 at 08:56
  • file a bug report! Things are fixed only if developers know the problem (and they have time to fix, but this seems a simple fix). – Giacomo Catenazzi Oct 06 '22 at 08:59
  • I've been trying to see if this bug exists in the lates release - 2.10. And it does. I've also been trying to figure out how to open a BUG in the wpa_supplicant. I've wasted a whole day trying to figure out how to file this bug. I have logs of wpa_supplicant and wpa_cli...but have no idea where to send them... – Mechi Oct 18 '22 at 14:11

1 Answers1

0

If an SSID has characters/symbols other than ASCII printable characters under 0x7F, the full SSID must be supplied as HEX. In my example above, use

set_network X ssid 313233d79ed79bd799616263

It may not always be displayed with the correct symbols, and only using UTF-8 encoding, but it will be possible to connect to the network.

Mechi
  • 11
  • 3