balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Help with Wi-Fi

Sun Dec 09, 2018 1:52 pm

I have followed the guide (https://www.raspberrypi.org/documentati ... /README.md) for setting up wireless networking but don't get an IP address assigned.

If I run iwlist wlan0 scan I do see the SSID I have in my /etc/wpa_supplicant/wpa_supplicant.conf. Can I tell if it is a security problem? ie is there any logging I can switch on to see if it is due to a security problem?

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Help with Wi-Fi

Sun Dec 09, 2018 2:41 pm

Can you post your /etc/wpa_supplicant/wpa_supplicant.conf here in code tags please?

Obviously hide the SSID / Password :lol:
Need Pi spray - these things are breeding in my house...

balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Re: Help with Wi-Fi

Sun Dec 09, 2018 4:57 pm

Code: Select all

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


network={
    ssid="2.4G-Tulipan"
    psk="password"
#    proto=WPA
#    key_mgmt=WPA-PSK
}
The commented lines are things I tried to get it working...

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Help with Wi-Fi

Sun Dec 09, 2018 11:07 pm

You do need to have a country code for your WiFi.

Have a read through this thread for the simplest way to set it up viewtopic.php?p=1389183
Need Pi spray - these things are breeding in my house...

balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Re: Help with Wi-Fi

Mon Dec 10, 2018 10:38 am

Andyroo wrote:
Sun Dec 09, 2018 11:07 pm
You do need to have a country code for your WiFi.
Thanks for that!

I used raspi-config to set up Wi-Fi and now it works, although I'm not sure how.... After setting country code I saw that

COUNTRY=XX

was added to /etc/wpa_supplicant/wpa_supplicant.conf but I found I could comment it out and Wi-Fi continued to work, so I guess it must be set somewhere else.... or could it be that the dongle gets updated...?

DirkS
Posts: 9629
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Help with Wi-Fi

Mon Dec 10, 2018 11:03 am

balanga wrote:
Mon Dec 10, 2018 10:38 am
I could comment it out and Wi-Fi continued to work,
Does it survive a reboot?

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Help with Wi-Fi

Mon Dec 10, 2018 11:04 am

To be honest I know it configures some radios but had assumed it does it each time.

Never bothered commenting out bits that are needed once as they may be needed again :lol:
Need Pi spray - these things are breeding in my house...

balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Re: Help with Wi-Fi

Mon Dec 10, 2018 12:52 pm

DirkS wrote:
Mon Dec 10, 2018 11:03 am
balanga wrote:
Mon Dec 10, 2018 10:38 am
I could comment it out and Wi-Fi continued to work,
Does it survive a reboot?
Yes

balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Re: Help with Wi-Fi

Mon Dec 10, 2018 12:59 pm

One problem I have noticed with Wi-Fi is the IP address assigned is sometimes 169.254.116.184. This depends on where I use my RPi...

Does it depend on the distance from the router?

Would running iwlist wlan0 scan reveal anything?

DirkS
Posts: 9629
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Help with Wi-Fi

Mon Dec 10, 2018 1:51 pm

balanga wrote:
Mon Dec 10, 2018 12:59 pm
One problem I have noticed with Wi-Fi is the IP address assigned is sometimes 169.254.116.184. This depends on where I use my RPi...
That's a link-local / APIPA address. If you don't get an address from a DHCP server (and no address manually configured) you will get this.

balanga
Posts: 108
Joined: Sat Aug 23, 2014 6:56 pm

Re: Help with Wi-Fi

Mon Dec 10, 2018 5:07 pm

DirkS wrote:
Mon Dec 10, 2018 1:51 pm
balanga wrote:
Mon Dec 10, 2018 12:59 pm
One problem I have noticed with Wi-Fi is the IP address assigned is sometimes 169.254.116.184. This depends on where I use my RPi...
That's a link-local / APIPA address. If you don't get an address from a DHCP server (and no address manually configured) you will get this.
Why don't I get an IP address from the DHCP server, given that a scan sees SSID referenced in wpa_supplicant.conf?

Is it because the signal is too weak, and would the output of a iwlist scan provide any useful info as to why dhcp does not provide an IP address?

DirkS
Posts: 9629
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Help with Wi-Fi

Mon Dec 10, 2018 7:01 pm

balanga wrote:
Mon Dec 10, 2018 5:07 pm
DirkS wrote:
Mon Dec 10, 2018 1:51 pm
balanga wrote:
Mon Dec 10, 2018 12:59 pm
One problem I have noticed with Wi-Fi is the IP address assigned is sometimes 169.254.116.184. This depends on where I use my RPi...
That's a link-local / APIPA address. If you don't get an address from a DHCP server (and no address manually configured) you will get this.
Why don't I get an IP address from the DHCP server, given that a scan sees SSID referenced in wpa_supplicant.conf?

Is it because the signal is too weak, and would the output of a iwlist scan provide any useful info as to why dhcp does not provide an IP address?
Is a DHCP server configured on the network? Could be that it takes too long, but then I would expect you still get a 'proper' dhcp address after a while
You may want to check the logs for messages from dhcpcd (e.g. 'dmesg | grep dhcp' )

Code: Select all

dmesg | grep dhcp

Return to “Networking and servers”