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

Cannot use a WiFi name with an apostrophe in it #2918

Closed
jimbobbennett opened this issue Apr 2, 2019 · 24 comments
Closed

Cannot use a WiFi name with an apostrophe in it #2918

jimbobbennett opened this issue Apr 2, 2019 · 24 comments
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@jimbobbennett
Copy link

jimbobbennett commented Apr 2, 2019

Describe the bug
The Pi cannot connect to a WiFi SSID with an apostrophe in the name.

To reproduce
Have a WiFi SSID with an apostrophe in the name (for example Jim's iPhone. the default personal hotspot name on my iPhone).
Try to connect to this.

Expected behaviour
The WiFi name should appear correctly and the Pi should be able to connect to it.

Actual behaviour
The WiFi name appears wrong in the SSID list, with the apostrophe replaced with \342\200\231.

2019-04-02_16-07-15

After entering the password for this WiFi connection, an error pops up saying Invalid Argument and a connection cannot be made.

2019-04-02_16-09-14

System
Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:

@pelwell
Copy link
Contributor

pelwell commented Apr 2, 2019

Does it work if you add the entry manually to wpa_supplicant.conf?

@JamesH65
Copy link
Contributor

JamesH65 commented Apr 2, 2019

There's no RFC for which characters can be used in SSID's, but the recommendation appears to be to avoid special characters. Looks like we are not the only device that complains when apostrophes are used...! A quick Google will show quite a few issues elsewhere.

@carmeli-tamir
Copy link
Contributor

Hi, not sure what is the contributions policy but I'm willing to check this bug out. May I be assigned to the issue? Contact me if necessary carmeli.tamir@gmail.com

@JamesH65
Copy link
Contributor

@carmeli-tamir Feel free to investigate and provide a PR if you get anywhere. No need to assign it.

@JamesH65
Copy link
Contributor

@spl237 Is this in anyway related to that recent fix?

@JamesH65 JamesH65 added Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. labels Sep 19, 2019
@pelwell
Copy link
Contributor

pelwell commented Sep 19, 2019

Yes - this is almost certainly a duplicate of #2883.

@spl237
Copy link

spl237 commented Sep 19, 2019

Three octal characters with the digit 2 in - yes, almost certainly the same bug!

@spl237
Copy link

spl237 commented Sep 19, 2019

Fix should be in apt by this evening if it isn't there already.

@JamesH65
Copy link
Contributor

@jimbobbennett It appears that there will be a possible fix for this in tonight apt update. So if you could update tomorrow using sudo apt update, sudo apt upgrade and retest and provide results that would be most excellent.

@JamesH65 JamesH65 removed the Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team label Sep 19, 2019
@jimbobbennett
Copy link
Author

I can now connect. The WiFi SSID is still displayed wrong in the list, but I can successfully connect.

@JamesH65
Copy link
Contributor

@spl237 One for you perhaps?

@spl237
Copy link

spl237 commented Sep 20, 2019

I suspect the wrong display is due to the AP rendering the apostrophe in Unicode, which the plugin / dhcpcd doesn't support. If the OP could confirm how the SSID name appears (and what it should be), I can pass this on to the author of dhcpcd.

(I suspect the AP name includes a ` rather than a standard ' apostrophe - that quite often gets rendered badly.)

@jimbobbennett
Copy link
Author

jimbobbennett commented Sep 20, 2019

It's the same as in the original issue, the apostrophe is replaced with \342\200\231.

2019-04-02_16-07-15

The original SSID is Jim's iPhone. I can't be sure what the ' character is as it's whatever iOS uses, but it looks like a standard apostrophe.

@spl237
Copy link

spl237 commented Sep 20, 2019

Right, so that's E2 80 99 in hex, which is the Unicode for a "right single quotation mark". That's an extended character set symbol - the apostrophe is 27 in hex in Unicode. They look similar, but are not the same character.

iOS is using a bad character in the SSID name - that's not something which can be fixed without adding full Unicode support to the SSID parser, which is a non-trivial job. I'm pointing the finger of blame at Apple here... ;) I think this is a "wontfix" (or more accurately a "cantfix without a lot of work").

@jimbobbennett
Copy link
Author

jimbobbennett commented Sep 20, 2019

Damn you Tim Apple!!!!! 😜

@jimbobbennett
Copy link
Author

I guess the important thing here is fixed - users can connect a Pi to an iOS personal hotspot. Users savvy enough to do this should be ok to recognize their own hotspot if it has the name mangled around the apostrophe, so although it's not a perfect experience, it's not a show stopper.

Thanks @spl237

@pelwell
Copy link
Contributor

pelwell commented Sep 20, 2019

That's progress. The remaining issue is a Unicode handling problem in the LXPanel plugin; that apostrophe isn't really an apostrophe (or so I've read), it's a single right quote which puts it into the Unicode character set.

@pelwell
Copy link
Contributor

pelwell commented Sep 20, 2019

Apologies for the echo - it's one of the perils of patchy connectivity.

@JamesH65
Copy link
Contributor

@spl Anything left for us to do, or can this be closed?

@spl237
Copy link

spl237 commented Feb 13, 2020

The show-stopper bug in the octal parser is fixed; Unicode support hasn't been added to the dhcpcd code, but that isn't likely to happen in the short term. I think we can close this for now.

@JamesH65
Copy link
Contributor

Closing this issue as questions answered/issue resolved.

@csz5024
Copy link

csz5024 commented Dec 1, 2022

Just wanted to add to this thread for posterity:

I added a WiFi SSID with the same apostrophie in my wpa_supplicant.conf (or in the advanced page of the RPi imaging software) and on first run, Raspberry Pi would not boot.

Removed "quiet" and "splash" from my cmdline.txt to see what the problem was, and sure enough there was an EOF error in my /boot/firstrun.sh file that was caused by the apostrophie in the SSID that I added to the wpa_supplicant. Seems like a pretty fatal bug, and thought it should be documented somewhere.

The physical behavior of the Pi is that it would boot normally, then power off after the splash screen with 10 short green light blinks indicating HALT state.

TLDR: Dont put apostrophies in your WiFi SSID.

@pelwell
Copy link
Contributor

pelwell commented Dec 1, 2022

I'm reminded of little Johnny Drop Tables: https://xkcd.com/327/

@JosephCatrambone
Copy link

JosephCatrambone commented Dec 6, 2022

Failing to boot is a really annoying issue. I couldn't figure out why my Zero W wouldn't start or connect until I plugged in a monitor and keyboard. Saw the EOF -> HALT problem and ended up here. Since the device halts, if you're not actively looking at the boot sequence it's easy to miss the error and then be presented with a device that just powers off suddenly.

Perhaps the imager could alert that "an apostrophe in SSID will prevent the device from booting" or could disallow characters that will prevent the device from starting? It's not exactly a workaround for the problem, but maybe a little safety for what would be a nasty issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests

7 participants