Page 2 of 2

Re: 28th pdate and pi-star not connect with wifi

Posted: Mon Jul 01, 2019 10:16 pm
by MW0MWZ
KE0FHS wrote: Mon Jul 01, 2019 3:44 pm
MW0MWZ wrote: Mon Jul 01, 2019 11:53 am Not exactly, since I include the plain text also - this is actually a valid thing to do - the WiFi_Builder was incorrectly adding the quotation marks on the HEX version of the SSID - that is what was causing the problem, and has now been fixed up.

So WHY all the obfuscation you might ask - well because iPhones are a pain in the ass is why :)

Converting the SSID string to hex (thats all it is) and removing the quotes causes WPA supplicant to be able to process the weird / dumb / stupid right quote that apple insists on using in the SSID for iPhone Hotspots.

Similarly, encoding the PSK (in the same way that the wpa_passprase CLI tool does), helps with any unusual characters in the PSK.

As weird as the new look wpa_supplicant.conf files are, they do work (when I don't have quotes in the wrong place).
Andy, what does this mean in terms of creating a wpa_supplicant.conf file and putting it in the root directory prior to boot up? If we create our own wpa_supplicant.conf file with plain text entries, will Pi-Star add the hex conversions as part of the process of moving it to the /etc/wpa_supplicant directory? Or do we have to use the WiFi Builder tool on the Pi-Star website? If the latter, any chance you could add https to the Pi-Star website, or at least to the WiFi Builder tool?
The builder tool has always been available via https - https://www.pistar.uk/wifi_builder.php and I would always suggest that the HTTPS page is used since passwords do matter.

That aside, Pi-Star will work with the encoded or not encoded versions of the WPA_Supplicant, the software doesnt "see" the difference, so long as the format is correct, the dashboard tool for setting up WiFi on the config page will always output the new format with the pre-computed hex/salted and pre-computed PSK etc, and the file will include commented out human readable versions (leave those in place since the tool uses those to output the SSID name etc too).

As above - the reason for all this shenanigans is to enable the support of un-usual charictters in the PSK and/or the SSID.
For example here is part of one of my entries;

Code: Select all

network={
	#ssid="Andrew\xe2\x80\x99s iPhone"
	ssid=416e64726577e2809973206950686f6e65
As you can see the human readable section is commented out, and you can also see that when I did the scan for my SSID it translated "Andrew's iPhone" to "Andrew\xe2\x80\x99s iPhone" - and then when I compute that to hex, I get "416e64726577e2809973206950686f6e65"

To see what this is all about, some times a demo helps, with that in mind - copy the long string from my snip above, paste it in here and convert it:
http://www.unit-conversion.info/texttools/hexadecimal/

Re: 28th pdate and pi-star not connect with wifi

Posted: Mon Jul 01, 2019 10:50 pm
by KE0FHS
MW0MWZ wrote: Mon Jul 01, 2019 10:16 pm The builder tool has always been available via https - https://www.pistar.uk/wifi_builder.php and I would always suggest that the HTTPS page is used since passwords do matter.
My bad, I missed that totally. Thanks!
That aside, Pi-Star will work with the encoded or not encoded versions of the WPA_Supplicant, the software doesnt "see" the difference, so long as the format is correct, the dashboard tool for setting up WiFi on the config page will always output the new format with the pre-computed hex/salted and pre-computed PSK etc, and the file will include commented out human readable versions (leave those in place since the tool uses those to output the SSID name etc too).
Very nice. Thanks again!

Re: 28th pdate and pi-star not connect with wifi

Posted: Mon Jul 01, 2019 11:11 pm
by MW0MWZ
KE0FHS wrote: Mon Jul 01, 2019 10:50 pm
Very nice. Thanks again!
It would be if javascript would not keep on munging the chars and just copy the exact string without messing with it - once I get that worked out - then it will be nice, because then you wont have to copy/paste it by hand - OK I'll stop ranting about that for now...

Re: 28th pdate and pi-star not connect with wifi

Posted: Tue Jul 02, 2019 9:15 am
by MW0MWZ
KE7FNS wrote: Tue Jul 02, 2019 12:09 am Whats are you using to scan that is incorrectly giving you that goofy "\xe2\x80\x99"?

When I scan on 4.0RC4, I get this

Code: Select all

pi-star@pi-star(ro):~$ sudo iwlist wlan0 scan | grep ESSID
                  ESSID:"Andrew's iPhone"
and in wpa_supplicant.conf the following ssid string is completely valid and connected fine.

Code: Select all

ssid="Andrew's iPhone"
Ahh you fell into the trap, no its not valid, because its not an apostrophe, because being apple, they used a weird unicode character, so I HAVE to get the goofy unicode to be able to connect (this is the problem with what Apple did).

wpa_cli scan -i wlan0 && sleep 10 && wpa_cli scan_results -I wlan0
This will show the unicode chars,

Code: Select all

pi-star@pi-star(ro):~$ sudo wpa_cli scan -i wlan0 && sleep 10 && sudo wpa_cli scan_results -i wlan0
OK
bssid / frequency / signal level / flags / said
22:b3:62:00:00:00	2412	-41	[WPA2-PSK-CCMP][ESS]	Andrew\xe2\x80\x99s iPhone
Just for the sake of completeness, here is your suggestion - this also shows the decoded unicode, exactly because this is what you HAVE to use to be able to connect to that ESSID.

Code: Select all

pi-star@pi-star(ro):~$ sudo iwlist wlan0 scan | grep ESSID
                    ESSID:"Andrew\xE2\x80\x99s iPhone"