BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

WPA Supplicant not compatible with network?

Wed May 15, 2019 4:33 pm

Hey all!

So I've got two Raspberry Pi 3b+ running, One running MotionEyeOS, and one running OctoPi, and my issue is exactly the same on both.

If I connect them via ethernet to a switch, they're able to connect and I can SSH into them. If I try to let them run over wifi, they cannot connect to my network and I have no access to them.

Both the SSID and password for the network are correct, and both rPis can connect to wifi if using Raspian (NOOBs on one, vanilla raspian on the other) and connecting them to this wireless network via network settings in those operating systems. My dilemma is I need the actual installs of both of these. CLI installed version running on raspian doesn't give me features I need specifically in MotionEyeOS like Fast network camera.

Both OSes (motioneyeOS and OctoPi) support WPA supplicant files and were configured properly with WPA/2 configs, and the proper region selected.

TL;DR: WPA supplicant isn't working, SSID and password are correct, can't figure out the issue is.

Anyone have suggestions?
Thanks in advance. :)

Andyroo
Posts: 4232
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 5:16 pm

Can you please post your wpa_supplicant.conf file here (remove SSID + password)?
Please use code tags </> to keep the layout correct.

How did you create the file? You cannot use the standard Windows Notepad as it adds a cr/lf pair to the end of the line rather than just lf
Do you have the correct type of quotes around the SSID / Password? Macs have a habit of 'auto-correcting' text in TextEdit

Does it have the country code in it?

Have you tried configuring the network using

Code: Select all

sudo raspi-config
and did it work?

What type of WiFi network do you have and do other devices connect OK?
Need Pi spray - these things are breeding in my house...

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 5:55 pm

I will leave the SSID in as it's a default network name.
Below is the "octopi-wpa-supplicant.txt" file.
MotionEyeOS takes a "wpa_supplicant.conf" file that only consists of the uncommented sections of this file. (network SSID and psk, then country code)

Both were edited using Sublime text on MacOS/Ubuntu LTS or Notepad++ on Windows

Code: Select all

 
 # Use this file to configure your wifi connection(s).
#
# Just uncomment the lines prefixed with a single # of the configuration
# that matches your wifi setup and fill in SSID and passphrase.
#
# You can configure multiple wifi connections by adding more 'network'
# blocks.
#
# See https://linux.die.net/man/5/wpa_supplicant.conf
# (or 'man -s 5 wpa_supplicant.conf') for advanced options going beyond
# the examples provided below (e.g. various WPA Enterprise setups).
#
# !!!!! HEADS-UP WINDOWS USERS !!!!!
#
# Do not use Wordpad for editing this file, it will mangle it and your
# configuration won't work. Use a proper text editor instead.
# Recommended: Notepad++, VSCode, Atom, SublimeText.
#
# !!!!! HEADS-UP MACOSX USERS !!!!!
#
# If you use Textedit to edit this file make sure to use "plain text format"
# and "disable smart quotes" in "Textedit > Preferences", otherwise Textedit
# will use none-compatible characters and your network configuration won't
# work!

## WPA/WPA2 secured
network={
  ssid="2.4"
  psk="[REMOVED]"
}

## Open/unsecured
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#}

## WEP "secured"
##
## WEP can be cracked within minutes. If your network is still relying on this
## encryption scheme you should seriously consider to update your network ASAP.
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#  wep_key0="put password here"
#  wep_tx_keyidx=0
#}

# Uncomment the country your Pi is in to activate Wifi in RaspberryPi 3 B+ and above
# For full list see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
#country=GB # United Kingdom
#country=CA # Canada
#country=DE # Germany
#country=FR # France
country=US # United States

### You should not have to change the lines below #####################

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

 

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 5:57 pm

Andyroo wrote:
Wed May 15, 2019 5:16 pm
Can you please post your wpa_supplicant.conf file here (remove SSID + password)?
Please use code tags </> to keep the layout correct.

How did you create the file? You cannot use the standard Windows Notepad as it adds a cr/lf pair to the end of the line rather than just lf
Do you have the correct type of quotes around the SSID / Password? Macs have a habit of 'auto-correcting' text in TextEdit

Does it have the country code in it?

Have you tried configuring the network using

Code: Select all

sudo raspi-config
and did it work?

What type of WiFi network do you have and do other devices connect OK?
I haven't tried running raspi-config on the pi's after they had 3rd party OSes on them. That will most likely be my next troubleshooting step.
Wifi is handled by an Asus AC1750 in bridge mode with PFSense handling routing. Phones, laptops and other rPis with GUI OSes all have no issue connecting.

Andyroo
Posts: 4232
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 6:22 pm

I know it sounds odd but when I first tried adding the country code I added it after the network definition and got no connection.

Problem was after I moved it I had made other changes and got it working so I'm not sure if that was an issue or not! My version would read:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
  ssid="2.4"
  psk="[REMOVED]"
}
The dot in SSID is unusual but in the valid character set so I'm baffled...
To check the WiFi is OK, you could boot up with Rsapbian Lite and check it as that is fine with wpa_supplicant.conf
Need Pi spray - these things are breeding in my house...

User avatar
HawaiianPi
Posts: 4536
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 6:42 pm

Since you can connect using Raspbian, just copy the wpa_supplicant.conf file created by Raspbian to the other cards.

When using Raspbian to configure WiFi the wpa_supplicant.conf file will look like this:

Code: Select all

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

network={
	ssid="WiFi SSID"
	psk="WPA/WPA2 passphrase"
	key_mgmt=WPA-PSK
}

When editing text files on a Mac you need to turn off smart quotes so that straight quotes won't get converted to curly quotes, which will break the wpa_supplicant.conf file (I think there might be one other setting that needed to be changed as well, but I can't recall what it was).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Gaz Pi
Posts: 4
Joined: Wed May 01, 2019 11:05 am

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 7:24 pm

Just a quick note that caught me out a while ago...

If the SSID is hidden you will need to add the entry:
scan_ssid=1

Just in case it helps here is a copy of the text within my wpa_supplicant.conf

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={ 
        scan_ssid=1
        ssid="your ssid"
        psk="your password"
}
Hope it helps
Gaz Pi

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 11:16 pm

@HawaiianPi, my config file is identical except for country code (US), SSID and psk. They were edited in command line on the pi itself, so no smart quotes changing characters there.

@Andyroo, I tried moving Country code to above the network config. No change here.
No WPA_supplicant files seem to work so far, only desktop environments have worked.

@Gaz Pi, The SSID is not hidden. Broadcast is public and is using WPA2-PSK.


Edit: My Wifi password does contain special characters. Specifically "&" and "!"
I don't think this is an issue, but I don't know what the valid character list is for rPi.

2nd Edit:
the file under: /etc/network/interfaces does not appear to be filled out. Only line not commented out says (without quotes) "source-directory /etc/network/interfaces.d" and interfaces.d is blank. Is this an issue?
Last edited by BrinkGG on Wed May 15, 2019 11:32 pm, edited 1 time in total.

Andyroo
Posts: 4232
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 11:29 pm

I’ve never seen a definitive list of valid characters for password but I guess the ‘&’ would give problems...
Need Pi spray - these things are breeding in my house...

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Wed May 15, 2019 11:34 pm

Our guest network does not have special characters. It does have a space in the name though.
Assuming that spaces apply fine in raspi-config, I'm going to try that next.

User avatar
Greg Erskine
Posts: 115
Joined: Sat Sep 15, 2012 4:20 am

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 12:46 am

You could use wpa_passphrase to generate a passphrase from your SSID and password.

This should get around special characters and is a little more secure as your wifi password is not stored anywhere.

wpa_supplicant.conf will then have a line like this:

psk=6554d2e9bbf18ce37dd95fffc7a6d25d9ef54e317dbd04ed1aa7f724b7e6735f

rather than:

psk="PAsasw0rd"
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 1:32 am

Greg Erskine wrote:
Thu May 16, 2019 12:46 am
You could use wpa_passphrase to generate a passphrase from your SSID and password.

This should get around special characters and is a little more secure as your wifi password is not stored anywhere.

wpa_supplicant.conf will then have a line like this:

psk=6554d2e9bbf18ce37dd95fffc7a6d25d9ef54e317dbd04ed1aa7f724b7e6735f

rather than:

psk="PAsasw0rd"
Can you give me more detailed instructions on how to generate the passphrase? All I'm finding on google is the reverse: Finding the password from the passphrase and SSID.
Or if there is a way to find this from my access point I could do that as well.

And just for clarity's sake I'll ask, my wpa_supplicant file would look like this if done correctly? (Using the passphrase you used as an example)

Code: Select all

 
 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={ 
        ssid="MY SSID"
        psk="6554d2e9bbf18ce37dd95fffc7a6d25d9ef54e317dbd04ed1aa7f724b7e6735f"
}

 

Andyroo
Posts: 4232
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 1:51 am

If in doubt RTFM (well use the man command) :D :lol: :D

https://linux.die.net/man/8/wpa_passphrase

My understanding is run it from the command line with

Code: Select all

wpa_passphrase ssid passphrase
No Pi handy to test for you at the mo.
Need Pi spray - these things are breeding in my house...

User avatar
Greg Erskine
Posts: 115
Joined: Sat Sep 15, 2012 4:20 am

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 4:29 am

The terms passphrase and password are used interchangeably. Confusing to me.

I, maybe incorrectly, think of a password as the one you type where passphrase is generated by wpa_passphrase. :lol:

Code: Select all

tc@pCPJustBoom:~$ wpa_passphrase
usage: wpa_passphrase <ssid> [passphrase]

If passphrase is left out, it will be read from stdin

tc@pCPJustBoom:~$ wpa_passphrase "SSID" "password"
network={
        ssid="SSID"
        #psk="password"
        psk=2f6a0beddf2f0588ee426b0c3a0e3d9a523bb07a05cb857f85d826da80fa75c4
}
See the new generated psk.

Important Note: NO quotes and it is a fixed length of 64 characters.

BTW: With all kinds of encryptions it is "usually" impossible to regenerate the original password. I added the word usually because there is probably an exception somewhere I haven't come across.

You can use the output of wpa_passphrase as a skeleton wpa_supplicant.conf or cut and paste the new psk into your existing one. Make sure you delete the line #psk="password"
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 7:08 am

Andyroo wrote:
Thu May 16, 2019 1:51 am
If in doubt RTFM (well use the man command) :D :lol: :D

https://linux.die.net/man/8/wpa_passphrase

My understanding is run it from the command line with

Code: Select all

wpa_passphrase ssid passphrase
No Pi handy to test for you at the mo.
I RTFM'd and I see that now. :D
Problem is, unique characters are not acting as parts of the password in CLI. The exclamation point transforms into ifconfig for some reason. The "&" symbol also does not seem to be liked.

Update: I tried setting up the wpa_supplicant file with my guest network instead of my private network, no issues. I'm going to guess the unique characters that are "!" and "&" are somehow making the password unusable, and since wpa_passphrase can't do anything with it because the symbols are not interpreted properly in command line, I would need to get the passphrase another way.

This guest account will work for the moment and I'll probably change my wifi password to something with unique characters that are interpreted properly in CLI.
So far " @ ", " $ ", and " % "are all OK, even though I'm fairly certain the CLI thinks I have a GB keyboard, because I have to hit double quotes for "@" to send, and "#" sends the "£" symbol.

Thank you for everyone who helped with this. I would have been very lost on my own. :D

User avatar
Greg Erskine
Posts: 115
Joined: Sat Sep 15, 2012 4:20 am

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 10:19 am

Did you use double quotes around your password?
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 7:41 pm

Greg Erskine wrote:
Thu May 16, 2019 10:19 am
Did you use double quotes around your password?
I edited inside of the double quotes that were already in the file. I did not need to type them.

User avatar
Greg Erskine
Posts: 115
Joined: Sat Sep 15, 2012 4:20 am

Re: WPA Supplicant not compatible with network?

Thu May 16, 2019 11:41 pm

Did you use double quotes around your password in the wpa_passphrase command?
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

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

Re: WPA Supplicant not compatible with network?

Fri May 17, 2019 5:28 am

If you're going to use a ! character on the command line, it is best to enclose it in single quotes '!', otherwise the shell will treat it as a command to search your command line history and replace it with a matching entry.

So instead of

Code: Select all

wpa_passphrase "MY_SSID" "my!password"
use

Code: Select all

wpa_passphrase "MY_SSID" 'my!password'
but it is better to just use

Code: Select all

wpa_passphrase "MY_SSID"
and enter the password when prompted.

Code: Select all

pi@raspi11:~ $ wpa_passphrase "MY_SSID"
# reading passphrase from stdin
my we!rd p&ssw@rd
network={
	ssid="MY_SSID"
	#psk="my we!rd p&ssw@rd"
	psk=cc88054bd711d691d12272ed11b23e691d48b44f5f2ab4b457c382825cb1c488
}
pi@raspi11:~ $ 

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Fri May 17, 2019 6:25 am

Greg Erskine wrote:
Thu May 16, 2019 11:41 pm
Did you use double quotes around your password in the wpa_passphrase command?
I did not. That would probably solve my problem of it changing the "!" to "ifconfig"
Legitimately had no clue what was causing this.

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

Re: WPA Supplicant not compatible with network?

Fri May 17, 2019 7:13 am

BrinkGG wrote:
Fri May 17, 2019 6:25 am
Greg Erskine wrote:
Thu May 16, 2019 11:41 pm
Did you use double quotes around your password in the wpa_passphrase command?
I did not. That would probably solve my problem of it changing the "!" to "ifconfig"
Legitimately had no clue what was causing this.
See my comment above. Double quotes won't work for the ! character. The shell still tries to expand it into a recent command from your history. Either use single quotes on the command line, or use the other option I suggested where you type the password in afterwards and it won't get interpreted by the shell.

BrinkGG
Posts: 10
Joined: Wed May 15, 2019 4:18 pm

Re: WPA Supplicant not compatible with network?

Fri May 17, 2019 6:01 pm

rpdom wrote:
Fri May 17, 2019 7:13 am
BrinkGG wrote:
Fri May 17, 2019 6:25 am
Greg Erskine wrote:
Thu May 16, 2019 11:41 pm
Did you use double quotes around your password in the wpa_passphrase command?
I did not. That would probably solve my problem of it changing the "!" to "ifconfig"
Legitimately had no clue what was causing this.
See my comment above. Double quotes won't work for the ! character. The shell still tries to expand it into a recent command from your history. Either use single quotes on the command line, or use the other option I suggested where you type the password in afterwards and it won't get interpreted by the shell.
Noted.
Thank you!!

Return to “Troubleshooting”