sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

wlan0: Not associated

Mon Jun 10, 2019 10:07 pm

Hi I see this problem has been answered before & I have tried to resolve it by pouring over these pages/answers. I think it could possibly be a problem with a corrupt download. I was able to connect to wireless internet before a recent attempt to download vlc. A friend hit turn off wireless. I have turned it back on but get the above error. I'm usure of how to check this. The internet is fine, I'm writing this on a laptop. Thanks

Andyroo

Re: wlan0: Not associated

Mon Jun 10, 2019 11:28 pm

I would check the contents of wpa_supplicant matches your network SSID and password.

From the terminal run

Code: Select all

cat /etc/wpa_supplicant/wpa_supplicant.conf 

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Mon Jun 10, 2019 11:45 pm

Andyroo wrote:
Mon Jun 10, 2019 11:28 pm
I would check the contents of wpa_supplicant matches your network SSID and password.

From the terminal run

Code: Select all

cat /etc/wpa_supplicant/wpa_supplicant.conf 
Yes I have done that it seems as it should be I can't copy it all but exactly as all the forums say with network stuff right?is there another command I can put in as it's still not online? Only possible fault I can see is the network name has a break in it but that is how it is configured on here too?

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Tue Jun 11, 2019 2:56 pm

Oh dear I have been trying to fix this problem & have made it worse! I put startx in command & now it is asking for a password on boot up. Ii have entered raspberry the default but it will not accept so I can't even log in!

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Tue Jun 11, 2019 3:27 pm

I have solved the log in problem but still have wlan0: Not associated so can't get online :(

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

Re: wlan0: Not associated

Tue Jun 11, 2019 3:56 pm

sandifeet wrote:
Tue Jun 11, 2019 3:27 pm
I have solved the log in problem but still have wlan0: Not associated so can't get online :(
Do you think you will be able to post the contents of your wpa_supplicant.conf before reach your 10th post ?

Now don't be difficult, post your wpa_supplicant.conf and do not mangle/corrupt the contents,
leave the SSID, in the password (psk) replace all characters a-z by x, A-Z by X, and 0-9 by Y only.
Example:

Code: Select all

pi@raspi4:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="ManCave"
    psk="XXXXYYYYYYYYYYYYYYYYYYXXXX"
    key_mgmt=WPA-PSK
    priority=30
}
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Tue Jun 11, 2019 4:28 pm

Yes here you go:
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=netdev
update_config=1
country=EC
network={
ssid="BTHub-T3S3"
psk="xycyyfxxxy"
key_mgmt=WPA-PSK
}

This is the network I used in UK in '17 to set the Pi up. I can get online using ethernet cable but no wireless. Thankyou Ernst

Andyroo

Re: wlan0: Not associated

Tue Jun 11, 2019 5:09 pm

sandifeet wrote:
Tue Jun 11, 2019 4:28 pm
Yes here you go:
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=netdev
update_config=1
country=EC
network={
ssid="BTHub-T3S3"
psk="xycyyfxxxy"
key_mgmt=WPA-PSK
}

This is the network I used in UK in '17 to set the Pi up. I can get online using ethernet cable but no wireless. Thankyou Ernst
I take it you are in Ecuador by EC?
Try changing the ‘ctrl_interface=DIR=netdev’ to match the sample below your post.

Also check that the lines between {} are indented.
There should only be line feed at the end of each line - if you have used Notepad on a PC to create the file - recreate using nano on the Pi.

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

Re: wlan0: Not associated

Tue Jun 11, 2019 5:14 pm

sandifeet wrote:
Tue Jun 11, 2019 4:28 pm
Yes here you go:
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=netdev
update_config=1
country=EC
network={
ssid="BTHub-T3S3"
psk="xycyyfxxxy"
key_mgmt=WPA-PSK
}

This is the network I used in UK in '17 to set the Pi up. I can get online using ethernet cable but no wireless. Thankyou Ernst
Would be nice to see [code] and [/code] tags used in your posts.

The first thing I notice is this:

Code: Select all

ctrl_interface=DIR=netdev
which is not the same as:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
The next thing I notice is:

Code: Select all

country=EC
which indicates Ecuador. Just recently I have seen some reports that some country codes are not working correctly and I suggest for testing you change the country code to UK.
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Tue Jun 11, 2019 5:41 pm

Andyroo wrote:
Tue Jun 11, 2019 5:09 pm
sandifeet wrote:
Tue Jun 11, 2019 4:28 pm
Yes here you go:
sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=netdev
update_config=1
country=EC
network={
ssid="BTHub-T3S3"
psk="xycyyfxxxy"
key_mgmt=WPA-PSK
}

This is the network I used in UK in '17 to set the Pi up. I can get online using ethernet cable but no wireless. Thankyou Ernst
I take it you are in Ecuador by EC?
Try changing the ‘ctrl_interface=DIR=netdev’ to match the sample below your post.

Also check that the lines between {} are indented.
There should only be line feed at the end of each line - if you have used Notepad on a PC to create the file - recreate using nano on the Pi.
I'm just typing it in with a keyboard attached by usb. I'm not sure what you mean here what I should change. Yes the { are as they should be. As I think Imentioned before it worked fine before a friend tried to download VLC media player

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

Re: wlan0: Not associated

Tue Jun 11, 2019 6:33 pm

- What version of raspbian are you running, please post the output of the following commands:

Code: Select all

cat /proc/cpuinfo | grep 'Revision'
uname -a
cat /etc/os-release
- check the contents of /etc/modprobe.d/raspi-blacklist, this file should be empty
- check that file /boot/config.txt does NOT have a line with "dtoverlay=pi3-disable-wifi"
- check the location of the wpa_supplicant.conf file, this should be "/etc/wpa_supplicant/wpa_supplicant.conf"
- please post the output of the "iwconfig" command.

Code: Select all

iwconfig
- now use the service command to stop wpa_supplicant, the ps command to find the wpa_supplicant process and use kill to halt, the following is an example:

Code: Select all

pi@raspi2:~ $ sudo service wpa_supplicant stop
pi@raspi2:~ $ ps -A | grep 'wpa'
  379 ?        00:00:00 wpa_supplicant
pi@raspi2:~ $ sudo kill -9 379
pi@raspi2:~ $
now start wpa_supplicant from the terminal:

Code: Select all

pi@raspi2:~ $ sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: Trying to associate with 00:16:b6:95:0d:ab (SSID='XXXXXXXG' freq=2437 MHz)
wlan0: Associated with 00:16:b6:95:0d:ab
wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
wlan0: CTRL-EVENT-DISCONNECTED bssid=00:16:b6:95:0d:ab reason=0 locally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="XXXXXXXG" auth_failures=1 duration=10 reason=WRONG_KEY
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
^Cnl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
p2p-dev-wlan0: CTRL-EVENT-TERMINATING
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: CTRL-EVENT-TERMINATING
pi@raspi2:~ $
The ^C shows where I stopped wpa_supplicant by pressing Ctrl-C.
What messages do you see ?
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Tue Jun 11, 2019 11:35 pm

Ok attempting. PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Now next command result coming: lo no wireless extensions.

wlan0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on

eth0 no wireless extensions.
(sorry I can't get it green but hopefully you can understand/read what it is saying?
Next command you have asked for: sudo service wpa_supplicant stop ps -A | grep 'wpa'
502 ? 00:00:00 wpa_supplicant
pi@raspberrypi:~ $ 379 ? 00:00:00 wpa_supplicant
bash: 379: command not found
sudo kill -9 379

Not sure if I should continue with the next command you asked me to put in as I think the second one could be teh problem. If you think I should put in last commands I will. Thanks

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

Re: wlan0: Not associated

Wed Jun 12, 2019 5:41 am

You are doing reasonably well except that you must put the information in between the code tags and you must just continue even if something does not look right. The reason for using code tags is that the information is displayed correctly, just look at the following quote (which is the same as normal text)
pi@raspi2:~ $ ps -A | grep 'wpa'
333 ? 00:00:00 wpa_supplicant
pi@raspi2:~ $
and now in between code tags

Code: Select all

pi@raspi2:~ $ ps -A | grep 'wpa'
  333 ?        00:00:00 wpa_supplicant
pi@raspi2:~ $

The intention is to run wpa_supplicant in the foreground and for this reason it is necessary to make sure that wpa_supplicant is not active in the background. With "ps -A|grep wpa" you can see if wpa_supplicant is running in the background, "kill -9 nnnn" is to remove any remaining processes, "sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf" makes wpa_supplicant run in the foreground.
The road to insanity is paved with static ip addresses

User avatar
davidcoton
Posts: 5026
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: wlan0: Not associated

Wed Jun 12, 2019 12:42 pm

sandifeet wrote:
Tue Jun 11, 2019 11:35 pm

Code: Select all

ps -A | grep 'wpa'
  502 ?        00:00:00 wpa_supplicant
pi@raspberrypi:~ $   379 ?        00:00:00 wpa_supplicant
bash: 379: command not found
sudo kill -9 379
Not sure if I should continue with the next command you asked me to put in as I think the second one could be teh problem. If you think I should put in last commands I will. Thanks
The ps ... command gives you the parameter for the next command -- refer back to Ernst's instructions. In your case "502", not "379".
So the command should have been:

Code: Select all

sudo kill -9 502
But it will be different next time!
Typing the line beginning "379" was just wrong, even with the right number!

When you insert code tags, you need to put the text BETWEEN the two tags, not after.
You can use "Preview" to make sure it's right, before you press "Submit"
Signature retired

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Wed Jun 12, 2019 2:34 pm

I have put in:

Code: Select all

sudo kill -9 502

but no response. Putting in the last long command from Ernst.

Code: Select all

$ sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
bash: $: command not found
pi@raspberrypi:~ $ Successfully initialized wpa_supplicant
bash: Successfully: command not found
pi@raspberrypi:~ $ wlan0: Trying to associate with 00:16:b6:95:0d:ab (SSID='XXXXXXXG' freq=2437 MHz)
bash: syntax error near unexpected token `('
pi@raspberrypi:~ $ wlan0: Associated with 00:16:b6:95:0d:ab
bash: wlan0:: command not found
pi@raspberrypi:~ $ wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
bash: wlan0:: command not found
pi@raspberrypi:~ $ wlan0: CTRL-EVENT-DISCONNECTED bssid=00:16:b6:95:0d:ab reason=0 locally_generated=1
bash: wlan0:: command not found
pi@raspberrypi:~ $ wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
bash: wlan0:: command not found
pi@raspberrypi:~ $ wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="XXXXXXXG" auth_failures=1 duration=10 reason=WRONG_KEY
bash: wlan0:: command not found
pi@raspberrypi:~ $ wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
bash: wlan0:: command not found

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: wlan0: Not associated

Wed Jun 12, 2019 3:08 pm

Don't paste the dollar sign in your terminal. That confuses the shell.
Paste this instead:

Code: Select all

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
To remove instances of the wpa_supplicant process, instead of ps/kill you can try:

Code: Select all

sudo killall wpa_supplicant
If your machine does not have the killall utility command installed, the following runs the command Ernst gave you and kills the corresponding process in one go:

Code: Select all

PID=$(ps -A | grep 'wpa' | xargs); [ -n "$PID" ] && sudo kill -9 ${PID%% *}
(stores the command output in a variable named PID; checks it is not empty and uses the 1st word in the output, the actual process ID, in the kill command.)
Copy-paste it exactly as is.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Wed Jun 12, 2019 3:21 pm

I apologise for being such a dummy here. I bought the raspi to learn how to code..........

I will now put in the first command & post the result that Epoch1970 has sent. Think I should do this one at a time:

Code: Select all

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
Shall I put Ernt's command in now without the first $ sign? Or line by line?

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

Re: wlan0: Not associated

Wed Jun 12, 2019 3:47 pm

sandifeet wrote:
Wed Jun 12, 2019 3:21 pm
I apologise for being such a dummy here. I bought the raspi to learn how to code..........

I will now put in the first command & post the result that Epoch1970 has sent. Think I should do this one at a time:

Code: Select all

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
STOP !!!! Something is very wrong here and I do not know (yet) what the problem could be.
After the line "Successfully initialized wpa_supplicant" there should have been mores line starting with "wlan0:"

Before I give you the next command I have to explain something very important, when I say enter the following command like this

Code: Select all

ps -A
it means that you have to enter the command on the console just like it has been given. Why I say enter the following command and it starts with "something" followed by a $ sign then I am giving you what I typed at the prompt and what happened.

Code: Select all

pi@raspi2:~ $ ps -A | grep 'wpa'
333 ? 00:00:00 wpa_supplicant
pi@raspi2:~ $
"pi@raspi2:~ $" is the prompt printed on the console
"ps -A | grep 'wpa'" is the command I typed
"333 ? 00:00:00 wpa_supplicant" is the output of the command.

I will have to follow up a bit later.
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Wed Jun 12, 2019 3:57 pm

Thankyou Ernst,
I have checked & more lines are there I will copy beneath. Looks a bit suss...I too cannot continue today. Thankyou Hasta manana

Code: Select all

[Successfully initialized wpa_supplicant
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
/code]

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: wlan0: Not associated

Wed Jun 12, 2019 4:05 pm

sandifeet wrote:
Tue Jun 11, 2019 11:35 pm
Ok attempting. PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Now next command result coming:
[/code]

For you information Raspbian Jessie is no longer supported.

The latest release of ""Raspbian Stretch with desktop and recommended software"" includes VLC.

https://www.raspberrypi.org/downloads/raspbian/
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

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

Re: wlan0: Not associated

Wed Jun 12, 2019 4:31 pm

sandifeet wrote:
Wed Jun 12, 2019 3:57 pm
Thankyou Ernst,
I have checked & more lines are there I will copy beneath. Looks a bit suss...I too cannot continue today. Thankyou Hasta manana

Code: Select all

Successfully initialized wpa_supplicant
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
The above result is as expected because you did not stop the wpa_supplicant service and you did not kill any wpa_supplicant processes before starting wpa_supplicant in the foreground
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Thu Jun 13, 2019 4:39 pm

Hello Ernst I have tried to stop the wpa_supplicant service by entering the following & don't seem to get a response:

Code: Select all

[ sudo service wpa_supplicant stop
pi@raspberrypi:~ $ ps -A | grep 'wpa'
  507 ?        00:00:00 wpa_supplicant
pi@raspberrypi:~ $ sudo kill -9 507
pi@raspberrypi:~ $ 
pi@raspberrypi:~ $ 
/code]

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

Re: wlan0: Not associated

Thu Jun 13, 2019 5:06 pm

Now run wpa_supplicant in the foreground:

Code: Select all

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
and see what messages will be displayed
The road to insanity is paved with static ip addresses

sandifeet
Posts: 18
Joined: Thu Jun 22, 2017 9:46 pm

Re: wlan0: Not associated

Thu Jun 13, 2019 5:40 pm

At the moment just this but don't think it has finished as the raspberry pi $ not come up. Maybe it is waiting for another command. Here's reply.

Code: Select all

Successfully initialized wpa_supplicant

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

Re: wlan0: Not associated

Thu Jun 13, 2019 6:16 pm

In the meanwhile I found that there are other ways to find information on your problem.
Please reboot the raspberry and then enter the following commands on the console.
After each command post the results in between [code] meaning here [/code] brackets.

Give us the information about your raspberry pi:

Code: Select all

cat /proc/device-tree/model;echo
And the kernel version:

Code: Select all

uname -a
Now see if rfkill is blocking wifi

Code: Select all

rfkill -list
Show us the interfaces

Code: Select all

ifconfig -a
and what information has been entered in wpa_supplicant.conf

Code: Select all

sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
Show us what networks you can find:

Code: Select all

iwlist wlan0 scan | grep 'ESSID'
What are the networks in the config:

Code: Select all

wpa_cli -i wlan0 list_networks
What is the status of wpa_supplicant:

Code: Select all

wpa_cli -i wlan0 status
Now start wpa_cli interactively as shown below:

Code: Select all

wpa_cli -i wlan0
and enter the following command

Code: Select all

reconfigure
Entering "quit" or Ctrl-C will get you out of wpa_cli but you should wait a few minutes to see status messages that you must post.
The road to insanity is paved with static ip addresses

Return to “Troubleshooting”