amadeus84
Posts: 18
Joined: Sun Jun 22, 2014 5:55 pm

pi0 w wifi problem

Tue Sep 05, 2017 3:54 am

I have a bunch of RPi computers around my house connected wirelessly to my router and usually the connection is pretty spotty for the ones further away from the router.

Last week I got a pi0 w and ever since I tried to get wifi to work on it. I tried first stretch and then jessie and I did get it to work when it was very close to the router. In the process I learned various wifi commands like iw, iwconfig and iwlist, which I knew about, but never had to actually learn. So doing an

iwlist wlan0 scanning

on one of my working pi, I saw about 8 wifi networks available (me and my neighbors), most of them using the default channel 1 - just like mine. I figured this must be the reason for the weak connection for my distant PIs, so I set my router to channel 4. Lo and behold, all my RPis started to work flawlessly (knock on wood). All, except the pi0 w, that is.

Before switching the router to channel 4, I DID manage to get the pi0 w to work, in the very close proximity of the router. After switching to channel 4, with the exact same configuration as before, wlan0 does not have an IP address and route -n shows an empty routing table. The logs (journalctl) and iwconfig show it's not associated to anything. Then, it occurred to me that switching to channel 4 may have something to do with it, so I did

iw wlan0 info

which showed channel 1 (2412 MHz). Now I don't pretend to understand all the details of wifi communications, but since my router is set to channel 4, I would assume the wifi card should also be set to channel 4 as well. This certainly seems the case with my other (working) RPis, which all figured out on their own that they needed to be on channel 4. All my other RPis have edimax usb dongles.

So I tried to set the wifi card on the pi0 W to channel 4, but

iwconfig wlan0 channel 4
Error for wireless request "Set Frequency" (8b04) :
SET failed on device wlan0 ; Operation not supported.

I'm guessing this is a driver issue, or am I not doing this right?

I found this possibly related thread: https://github.com/RPi-Distro/repo/issues/51 so I replaced my
brcmfmac43430-sdio.txt with the one mentioned in the thread, but that didn't change anything.

Does anybody have the pi0 W working on a channel other than the default?

If it's any use, I also set my router to WPA2 only and 11n (300Mb), which the edimax of my other PIs seems to like. Can the pi0 W do 11n? Can this be the problem? I'm pretty sure it's the channel thing though. Sorry I can't post logs and such, since the pi is not connected.

amadeus84
Posts: 18
Joined: Sun Jun 22, 2014 5:55 pm

Re: pi0 w wifi problem

Thu Sep 07, 2017 12:42 am

So nobody in the advanced users forum knows how to or can try to change the wifi channel on a pi0 w?

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: pi0 w wifi problem

Thu Sep 07, 2017 7:31 am

It is only necessary to set a specific channel when configuring an Access Point. Wi-Fi clients automatically use the appropriate channel.

I don't know why your ZeroW is not working after you changed from 1 to 4. Is it seeing any networks when it scans?

amadeus84
Posts: 18
Joined: Sun Jun 22, 2014 5:55 pm

Re: pi0 w wifi problem

Thu Sep 07, 2017 11:03 pm

The pi0 W sees only my 2.4GHz network, nothing else. The other pis (using the edimax dongle) see my 2.4 and 5GHz networks and a neighbor or two. I know it should choose the channel on its own, but it doesn't seem to be happening. I want to know if other people are able to set it manually. Is this a hardware issue? Driver issue?

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

Re: pi0 w wifi problem

Thu Sep 07, 2017 11:13 pm

amadeus84 wrote:
Thu Sep 07, 2017 11:03 pm
The pi0 W sees only my 2.4GHz network, nothing else. The other pis (using the edimax dongle) see my 2.4 and 5GHz networks and a neighbor or two. I know it should choose the channel on its own, but it doesn't seem to be happening. I want to know if other people are able to set it manually. Is this a hardware issue? Driver issue?
Built-in wifi is a 2.4GHz only.
If you want to change the channel you do that on your access point. The clients will follow automatically.
Make sure you have the correct country code set in /etc/wpa_supplicant/wpa_supplicant.conf as some channels are only valid in certain countries / regions

amadeus84
Posts: 18
Joined: Sun Jun 22, 2014 5:55 pm

Re: pi0 w wifi problem

Thu Sep 07, 2017 11:34 pm

Copying from the pi0 w:

# iw wlan0 info
Interface wlan0
ifindex 2
wdev 0x1
addr b8:27:eb:8d:41:71
type managed
wiphy 0
channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz


iwlist wlan0 channel
wlan0 11 channels in total; available frquencies:
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
.......
Channel 11 : 2.462 GHz
Current Frequency:2.427 GHz (Channel 4)

Does that last line in the iwlist output mean the pi is on channel 4? What does the channel 1 from the iw output mean then?

If it is on channel 4, why is it not getting an IP address? My wpa_supplicant.conf contains

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

network={
ssid="MYSSID"
psk="mykey"
}


Just noticed, the other pis have country=GB, but channel 4 is the same for US and GB.

lbog
Posts: 218
Joined: Sun Mar 06, 2016 9:44 am

Re: pi0 w wifi problem

Fri Sep 08, 2017 8:17 am

amadeus84 wrote:
Thu Sep 07, 2017 11:34 pm

My wpa_supplicant.conf contains

Code: Select all

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

network={
    ssid="MYSSID"
    psk="mykey"
}
Try with:

Code: Select all

scan_ssid=1
frequency=2427
scan_freq=2427
freq_list=2427
in the network-block.

amadeus84
Posts: 18
Joined: Sun Jun 22, 2014 5:55 pm

Re: pi0 w wifi problem

Sat Sep 09, 2017 12:39 am

Unfortunately that didn't help.

I noticed in the logs I have the following:

wlan0: CTRL-EVENT-ASSOC-REJECT status_code=16
wlan0: CRTL-EVENT-SSID-TEMP-DISABLED id=0 ssid="myssid" auth_failures=1 duration=10 reason=CONN_FAILED

Return to “Advanced users”