gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Tue Sep 13, 2016 7:17 pm

nl3prc wrote:after rpi-update you now get kernel 4.4.19+
Thanks for the info. However, I just used "sudo apt-get update" and am still seeing 4.4.13.

(As I'm still feeling my way with Raspbian, I should probably note that I also followed a suggestion that came with the update to use autoremove, which removed python-urwide.)

User avatar
DougieLawson
Posts: 36169
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Trouble connecting pi 3 to router via WiFi

Tue Sep 13, 2016 8:13 pm

What you need to do is simplify your /etc/wpa_supplicant/wpa_supplicant.conf file.

Code: Select all

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

network={
        ssid="your_SSID"
        psk="yourWPApassword"
}
let wpa_supplicant work out what's needed to associate with your access point.

You also need to make sure that the network with your_SSID is not hidden. Hiding does nothing useful (it just makes it difficult to connect) a hidden network needs an extra

Code: Select all

bssid=aa:bb:cc:dd:ee:ff
line with the MAC address for your router to connect.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Tue Sep 13, 2016 8:37 pm

DougieLawson wrote:What you need to do is simplify your /etc/wpa_supplicant/wpa_supplicant.conf file.

Code: Select all

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

network={
        ssid="your_SSID"
        psk="yourWPApassword"
}
let wpa_supplicant work out what's needed to associate with your access point.

You also need to make sure that the network with your_SSID is not hidden. Hiding does nothing useful (it just makes it difficult to connect) a hidden network needs an extra

Code: Select all

bssid=aa:bb:cc:dd:ee:ff
line with the MAC address for your router to connect.
That bssid line - it should go in wpa_supplicant.conf as well?
I'm assuming yes, and off to try that. I think I'll shut down and disconnect the ethernet first, so it has nothing to distract it from the wireless connection...

Having tried that, I can report that the only apparent change to the situation is that when I attempt to connect to the wireless, the "key_mgmt=WPA-PSK" line gets automatically re-written to wpa_supplicant.conf.

User avatar
nl3prc
Posts: 160
Joined: Sun Jul 24, 2016 12:39 pm
Location: Den Helder the netherlands

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 10:17 am

To update your kernel and modules

Code: Select all

rpi-update

beefie
Posts: 1
Joined: Wed Sep 14, 2016 10:07 am

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 10:53 am

As a noob who spent most of last night struggling with similar issues I thought I should share something that worked for me.

Basically whilst I successfully connected via wifi initially, the connection was dropped shortly afterwards and it generally refused to connect thereafter, other than briefly after a reboot in some cases even when I disabled wireless security etc.

Eventually after checking the config files etc I traced the problem to interference on the wifi channel that my router was using.

This was relatively easily diagnosed by running a wireless scan from the command prompt i.e. sudo iwlist wlan0 scan. In my case two networks on the scan (mine and a neighbours) were using channel 12 so a quick change of channel in the router settings and all was fine. Rock solid since then (touch wood).

Given I havent changed my router channel for some time and havent had any similar issues with any other devices dropping connections it seems that the Pi might be more sensitive to this issue that other devices. I have no idea why this would be the case.

Anyway I am sure this wont be the solution for everyone but might be something worth checking.

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 4:15 pm

nl3prc wrote:To update your kernel and modules

Code: Select all

rpi-update
You've taught me something new - thank you kindly.

I'm now seeing version "4.4.20-v7+"

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 4:24 pm

beefie wrote:As a noob who spent most of last night struggling with similar issues I thought I should share something that worked for me...
I very much appreciate your kindness in taking the time to share that tip. In my case, I seem to have the only wireless hereabouts on channel 2. It's interesting to note however that no less than three others are using channel 6 - I wonder if they are having problems?

User avatar
MojaMike
Posts: 5
Joined: Thu Sep 08, 2016 12:33 am

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 9:28 pm

Another new Pi-3 owner here. Found this topic while searching for a solution to my similar WiFi problem. Hopefully the following information will be useful.

Not sure how orthodox these settings are...but here's the workaround that I currently have until I find a proper configuration that works for me with the new dhcpcd.

- I left the originally installed 'interfaces' file alone.

- My 'wpa_supplicant.conf' file looks like this:

Code: Select all

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

network=(
	bssid=XX:XX:XX:XX:XX:XX	# router WiFi MAC address
	ssid="MyRouter"			  # router SSID
	scan_ssid=1					# not broadcasting (I know...)
	key_mgmt=WPA-PSK			 # using WPA2/AES
	psk="****************"	 # passphrase
)
- And I added this to the end of the original 'dhcpcd.conf' file:

Code: Select all

### My entries are as follows:

# not using ipv6
ipv4only

# ethernet
interface eth0
dhcp
static routers=192.168.1.1					# router ip address
static domain_name_servers=192.168.1.1	# router ip address
inform 192.168.1.***							# ip address reserved for Pi-3

# wi-fi
interface wlan0
static domain_name_servers=192.168.1.1
static routers=192.168.1.1
inform 192.168.1.***
Not ideal, but at least I now know my wi-fi hardware is working. Still looking forward to finding a solution that works correctly with dhcpcd over Wi-Fi and ethernet.

BTW: I am using Channel 6. :)

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Wed Sep 14, 2016 11:28 pm

Thanks for the input Mike. I tried editing the files per your examples, but no joy. Actually had a problem running that way; it messed with my ethernet connection (it indicated I had one, but I couldn't connect to any websites). I put them back to vanilla and ethernet is good again, but no wifi.

User avatar
MojaMike
Posts: 5
Joined: Thu Sep 08, 2016 12:33 am

Re: Trouble connecting pi 3 to router via WiFi

Thu Sep 15, 2016 9:59 pm

@gaffer

I got my wi-fi connection problem worked-out and posted the results here.

See if this is of any help...
- Mike

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Fri Sep 16, 2016 7:45 am

Thanks again for your help Mike. I followed the link and tried it as you suggested, but to no avail. I still got the "bad passcode" response despite providing the correct passcode. That was the last straw, and I decided it was time to turn off the Access Control list on my router as Dougie had suggested early on, at least long enough to see if that would let me connect.

I went back to the bare bones settings in wpa_supplicants, with nothing but the ssid and passcode entries, and back to the vanilla dhcpcd.conf as well. Then I rebooted and boom - connected first try. The next question was, after having done it once, could I connect again with the Access List enabled? I decided to try it.

First, I looked at the attached devices in my Router Manager via my Windows 7 laptop. There were two unknown devices showing, one for my Rpi's ethernet connection and one for its wireless. I recognized the MAC addresses, having been messing with this all week. Then I unplugged the Rpi's ethernet, did a refresh in the Router Manager, and the depths of my idiocy were revealed: the MAC address that went away wasn't the one I was expecting to go. I went back to the Access List, and confirmed it - the MAC address I'd put on the list was the Rpi's ethernet address, not its wireless address!

I changed the MAC address in the Access list, re-enabled Access Control, rebooted the pi and connected again, smooth as silk. So it was down to my fundamental error all along - when I'd read the MAC address for my pi and put it into the Access Control list, I'd read the wrong one. Never had a clue, spent all that time trying different workarounds but it was simply impossible with the wrong MAC address in the list.

I'm not sorry for myself - I fully deserve the headaches I caused myself - but I am truly sorry for all the trouble I've put everyone else to. Thanks to all for your efforts on my behalf, and most especially THANK YOU to Dougie who had all the right answers from the git go.

User avatar
MojaMike
Posts: 5
Joined: Thu Sep 08, 2016 12:33 am

Re: Trouble connecting pi 3 to router via WiFi

Fri Sep 16, 2016 4:23 pm

@gaffer: Good to hear that you got it working.

gaffer
Posts: 32
Joined: Fri Sep 09, 2016 2:14 am

Re: Trouble connecting pi 3 to router via WiFi

Fri Sep 16, 2016 7:55 pm

MojaMike wrote:@gaffer: Good to hear that you got it working.
Thanks Mike. I really did appreciate your input.

What's interesting is that I've just reinstalled Raspian (due to a different problem, see here: viewtopic.php?p=1038276#p1038276), and I connected like magic without doing anything in the way of preparation. Literally, I followed these steps:

1) Reinstall Raspian (wiping everything I'd had before, according to the Noobs warning)
2) Click the connection icon at upper right, select my router from the list presented, and type in my passphrase.

That was it - it took less than 5 seconds to connect and I had internet. I still haven't connected the ethernet cable; I used the wireless to do my sudo apt-get update and upgrade.

I now understand why I couldn't connect in the previous incarnation - I had the wrong MAC address in my router's access list. Had I gotten it right the first time around, I'm sure it would have done the same and this thread would never have existed. Like a great many software problems, it boiled down to the computer's pernicious habit of doing what you tell it to do rather than what you want it to do. :D

Return to “Troubleshooting”