Wifi key has single quote - how to escape?

wifi

#1

Running Resin OS on a rpi 3.

My wifi PSK has a single quote as follows:

psk=That’sAllFolks

I have tried every imaginable escape sequence to get this working. If I remove the single quote in the resin-wifi config file and on my router it works fine. When I add the single quote it fails (other devices working).

How do I escape this?


#9

Hey @pfunktyper,

I did a quick search in Network Manager docs (https://developer.gnome.org/NetworkManager/stable/nm-settings.html) and didn’t find any definite answer to this. This thread (https://ubuntuforums.org/showthread.php?t=1625620) suggests using backslashes to escape the single quote (i.e. That\'sAllFolks) . This is an interesting one, I’ve also raised it to our team, please do let us know if any of these combinations works for you!


#12

@pfunktyper a quick update on this, we checked the NetworkManager source code and apparently it doesn’t care about single quotes. However, it passes the password to wpa_supplicant which might care about them. From https://www.freebsd.org/cgi/man.cgi?wpa_supplicant.conf(5) it appears that enclosing the psk password in double quotes (psk="That'sAllFolks") might also to the trick.

(thanks @willnewton and @imrehg for the ideas on this)


#13

@pfunktyper I was testing this out, and does not seem like NetworkManager has any issues with quote marks.

I think the main issue comes from that in your example: That’sAllFolks has one kind of quote mark , while most settings usually have the straight, plain old quote mark '. The two are not the same, and if your wifi has one and you set the other, then they won’t be able to connect. (caught it by copy-pasting what you wrote here). So this might be something to check first, can you double check this for us?

What OS are you running on the computer that you use to download the resinOS? Some are more likely than others to change the quote marks as you type. Just a hunch.

So likely you do not need to user and escaping and double quotes around the psk value, and the images downloaded from the dashboard are correct as they are - they contain exactly the psk that you put in there (including the type of quotes)


#16

I was using Atom on MacOS to edit the file.

I tried the various quote marks by copy/pasting them from my browser with no luck.

I then tried vi from the terminal and just used the single quote key on the keyboard as I had done originally and IT WORKED.

psk=That’sAllFolks (no double quotes or escapes needed)

Many thanks for all of the replies!


#19

Thanks for the update, and great that it worked out! :wifi: Good to keep in mind, how editors and different operating systems handle this, wonder if we can put a warning somewhere…