Skip to content

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

Closed

Description

@jimbobbennett

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:

Activity

  1. pelwell commented on Apr 2, 2019

    @pelwell
    Contributor

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

  2. JamesH65 commented on Apr 2, 2019

    @JamesH65
    Contributor

    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.

  3. carmeli-tamir commented on Apr 14, 2019

    @carmeli-tamir
    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

  4. JamesH65 commented on Sep 19, 2019

    @JamesH65
    Contributor

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

  5. JamesH65 commented on Sep 19, 2019

    @JamesH65
    Contributor

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

  6. added
    Waiting for internal comment
    Waiting for external input
    on Sep 19, 2019
  7. pelwell commented on Sep 19, 2019

    @pelwell
    Contributor

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

  8. spl237 commented on Sep 19, 2019

    @spl237

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

  9. spl237 commented on Sep 19, 2019

    @spl237

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

  10. JamesH65 commented on Sep 19, 2019

    @JamesH65
    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.

  11. removed
    Waiting for internal comment
    on Sep 19, 2019
  12. jimbobbennett commented on Sep 20, 2019

    @jimbobbennett
    Author

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

  13. JamesH65 commented on Sep 20, 2019

    @JamesH65
    Contributor

    @spl237 One for you perhaps?

  14. spl237 commented on Sep 20, 2019

    @spl237

    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.)

  15. jimbobbennett commented on Sep 20, 2019

    @jimbobbennett
    Author

    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.

  16. spl237 commented on Sep 20, 2019

    @spl237

    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").

  17. jimbobbennett commented on Sep 20, 2019

    @jimbobbennett
    Author

    Damn you Tim Apple!!!!! 😜

  18. jimbobbennett commented on Sep 20, 2019

    @jimbobbennett
    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

  19. pelwell commented on Sep 20, 2019

    @pelwell
    Contributor

    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.

  20. pelwell commented on Sep 20, 2019

    @pelwell
    Contributor

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

  21. JamesH65 commented on Feb 13, 2020

    @JamesH65
    Contributor

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

  22. spl237 commented on Feb 13, 2020

    @spl237

    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.

  23. JamesH65 commented on Feb 13, 2020

    @JamesH65
    Contributor

    Closing this issue as questions answered/issue resolved.

  24. csz5024 commented on Dec 1, 2022

    @csz5024

    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.

  25. pelwell commented on Dec 1, 2022

    @pelwell
    Contributor

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

  26. JosephCatrambone commented on Dec 6, 2022

    @JosephCatrambone

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for external input

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions