eroji
Posts: 1
Joined: Sun May 26, 2019 10:25 am

Cannot connect to WiFi if password contains "#"

Sun May 26, 2019 10:29 am

Is there a way to escape a "#" character in the wifi password? I am using the latest minimal stretch version on RPi 3b+. Took me awhile to troubleshoot to isolate the problem down to the wifi password. Using the ASCII encoding of the password also does not seem to work.

k-pi
Posts: 930
Joined: Sun Feb 12, 2017 1:46 pm
Location: Upper Hale, Surrey, UK.

Re: Cannot connect to WiFi if password contains "#"

Sun May 26, 2019 12:10 pm

Usually you can 'escape' a character by prepending a \ just before the character, but I'm not sure it will work with a password, you likely need to change or delete the password & enter a new one.

This may help.
https://www.cyberciti.biz/faq/linux-del ... -password/

Ernst
Posts: 1283
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Cannot connect to WiFi if password contains "#"

Sun May 26, 2019 12:20 pm

eroji wrote:
Sun May 26, 2019 10:29 am
Is there a way to escape a "#" character in the wifi password? I am using the latest minimal stretch version on RPi 3b+. Took me awhile to troubleshoot to isolate the problem down to the wifi password. Using the ASCII encoding of the password also does not seem to work.
On my test equipment I do not have a problem with # in the password.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE

network={
        ssid="XXXXXX"
        psk="Test#Test"
        key_mgmt=WPA-PSK
        priority=20
}

Code: Select all

wlan0     IEEE 802.11  ESSID:"XXXXXX"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:16:B6:95:0D:AB
          Bit Rate=54 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=70/70  Signal level=-38 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
The road to insanity is paved with static ip addresses

User avatar
rpdom
Posts: 16311
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Cannot connect to WiFi if password contains "#"

Sun May 26, 2019 4:59 pm

You can use wpa_passphrase to generate an encrypted psk so you don't need to put any weird characters in /etc/wpa_supplicant/wpa_supplicant.conf. If you just supply the SSID you will be prompted for the password, then the block to put in the conf file will be displayed and you can copy/paste the bits you need. Note the generated encrypted psk does not have double quotes, unlike the unencrypted password version.
Here's an example with me typing "Pasword_with_weird#characters" (yes, I typoed "password") :oops:

Code: Select all

[email protected]:~ $ wpa_passphrase MY_SSID
# reading passphrase from stdin
Pasword_with_weird#characters
network={
	ssid="MY_SSID"
	#psk="Pasword_with_weird#characters"
	psk=5efe543a7bf1f513f73bc7a97612e979e2ca3acd95f57f7d6716d3835a557138
}
Then replace the existing psk="Pasword_with_weird#characters" with the version shown above.

klricks
Posts: 6840
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Cannot connect to WiFi if password contains "#"

Mon May 27, 2019 1:49 pm

eroji wrote:
Sun May 26, 2019 10:29 am
Is there a way to escape a "#" character in the wifi password? I am using the latest minimal stretch version on RPi 3b+. Took me awhile to troubleshoot to isolate the problem down to the wifi password. Using the ASCII encoding of the password also does not seem to work.
Have you set your keyboard country properly?
Raspbian defaults to UK layout which has # on a different key if not using a UK keyboard
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Return to “Troubleshooting”