14

I need my RPi 3 to connect to a Wi-Fi network using channel 12, but I'm not able to get the built-in Wi-Fi adapter to use this channel.

This is what I've done:

$ sudo apt-get install wireless-regdb iw crda
$ sudo iw reg set NO
$ sudo iwlist wlan0 channel
wlan0     11 channels in total; available frequencies :
      Channel 01 : 2.412 GHz
      Channel 02 : 2.417 GHz
      Channel 03 : 2.422 GHz
      Channel 04 : 2.427 GHz
      Channel 05 : 2.432 GHz
      Channel 06 : 2.437 GHz
      Channel 07 : 2.442 GHz
      Channel 08 : 2.447 GHz
      Channel 09 : 2.452 GHz
      Channel 10 : 2.457 GHz
      Channel 11 : 2.462 GHz

As you can see the list doesn't include channel 12 (or 13). Is there a way to enable channel 12 for the built-in adapter?

Update: This is what I get in dmesg:

[    5.506232] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[    5.756813] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
[    5.756854] brcmfmac: brcmf_add_if: ignore IF event
[    5.765557] cfg80211: Calling CRDA to update world regulatory domain
[    5.867878] lirc_rpi: auto-detected active high receiver on GPIO pin 18
[    5.875184] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0
[    5.875222] lirc_rpi: driver registered!
[    5.885249] bcm2835-rng 3f104000.rng: hwrng registered
[    5.902514] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    6.026071] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
[    6.026108] cfg80211: World regulatory domain updated:
[    6.026124] cfg80211:  DFS Master region: unset
[    6.026141] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[    6.026173] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.026197] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.026211] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[    6.026246] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[    6.026277] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[    6.026307] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[    6.026332] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[    6.026345] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[    6.026421] cfg80211: Calling CRDA for country: NO
[    6.070591] cfg80211: Regulatory domain changed to country: NO
[    6.070607] cfg80211:  DFS Master region: ETSI
[    6.070613] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[    6.070621] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.070628] cfg80211:   (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2301 mBm), (N/A)
[    6.070635] cfg80211:   (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[    6.070643] cfg80211:   (5470000 KHz - 5795000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s)
[    6.070650] cfg80211:   (5815000 KHz - 5850000 KHz @ 35000 KHz), (N/A, 3301 mBm), (0 s)
[    6.070656] cfg80211:   (17100000 KHz - 17300000 KHz @ 200000 KHz), (N/A, 2000 mBm), (N/A)
[    6.070662] cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
  • 1
    Have you set your region. Different administrations have different bands, and WiFi will not permit unauthorised frequencies. – Milliways Mar 3 '16 at 9:14
  • Yes, if I understand it correctly, this command should have set the region: sudo iw reg set NO – perja Mar 3 '16 at 10:22
  • There are probably many ways to fiddle with regional settings. Why not just use raspi-config to do it the standard way. – Milliways Mar 3 '16 at 10:25
  • 3
    Okay, I also did a update/upgrade/dist-upgrade and a rpi-update and a BRANCH=next rpi-update as part of this process. I don't know if any of them were also necessary. – joan Mar 3 '16 at 13:04
  • 1
    @joan: that was it! sudo BRANCH=next rpi-update and then a reboot resolved the issue. – perja Mar 3 '16 at 14:21
9

I've just had an identical problem. The solution, in my case, was to follow joan's suggestion from the comments underneath the question.

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo rpi-update

[reboot]

sudo branch=next rpi-update

[reboot]

On completion, channels 12 and 13 appear in the list produced by iwlist wlan0 channel.

  • 3
    For the record: after "sudo branch=next rpi-update" kernel was update from 4.1.18 to 4.4.3 and firmware from something to 41f8b4812ad653abf321b8c54cb4bee57ebdb129 (from /boot/.firmware_revision). – perja Mar 3 '16 at 17:34
  • you made my day. – blfuentes Mar 18 '16 at 19:17
  • How do you get rpi-update command? – IgorGanapolsky Jul 18 '16 at 1:37
  • 1
    @IgorGanapolsky "In normal circumstances there is NEVER a need to run rpi-update as it always gets you to the leading edge firmware and kernel and because that may be a testing version it could leave your RPi unbootable". raspberrypi.org/forums/viewtopic.php?p=916911#p916911 – Milliways Aug 4 '16 at 0:07
  • If you use channel 13 make sure you are allowed to in your region. – Piotr Kula Sep 22 '16 at 18:05
5

Following @goobering's answer didn't quite do it for me. I was able to update my firmware but once I tried running sudo branch=next rpi-update it told me I was already at the latest. I was not.

Using @perja's firmware hash (below the original answer) I ran;

sudo rpi-update 41f8b4812ad653abf321b8c54cb4bee57ebdb129

This got me from 4.1.18 to 4.4.3.

This means (for me at least) the complete steps were;

sudo raspi-config (set Wifi Country to GB, or a country that works for you)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update
shutdown -r now
sudo rpi-update 41f8b4812ad653abf321b8c54cb4bee57ebdb129
shutdown -r now

And viola, I can now see channel 12!

I have a feeling you could roll up those rpi-updates into one command but it feels safer to grab the latest master first, do a succesful reboot then try 4.4.3.

The bootup time on the 3 is so quick anyway ;-)

Related blog post

2

The solution by Shan-Desai works well, but I encountered a problem while implementing it.

When I wanted to set the Wlan channel, I was getting an error stating that the device is in use and busy. But after turning the device off and back on again [software-wise] the problem went away. So what I did is the following

$ sudo apt-get install wireless-regdb iw crda
$ sudo iw reg set CA 
$ sudo ifconfig wlan0 down
$ sudo ifconfig wlan0 up
$ sudo iwconfig wlan0 channel 11

Another matter to make note of is the fact that channel changes reset to default upon each reboot of the RPi. So in order to keep those changes on your RPi, I would suggest writing a shell script in the root directory and calling it in crontab upon reboot. I did so by

$ nano wlan0_setup.sh

and populate the file by the following:

$ sudo iw reg set CA 
$ sudo ifconfig wlan0 down
$ sudo ifconfig wlan0 up
$ sudo iwconfig wlan0 channel 11

I then saved the file and made it an executable shell script by running

$ sudo chmod +x /home/pi/wlan0_setup.sh

Now that the script is executable by running

$ sh wlan0_setup.sh

we can add it in the crontab by executing

$ crontab -e 

when the crontab opens, go to the end of the file and add the following

@reboot sh /home/pi/wlan0_setup.sh

then save and exit the editor. By doing so, the wlan0_setup.sh script will run upon each and every reboot of the RPi.

I hope this helps, wish you all luck.

1

Thanks for the reply Toby, it seems the SHA-1 commit hash as an argument to rpi-update command was necessary to update firmware to the make it working to see channel 12 and 13.

But I also have to thank to Shan-Desai as setting up the country code using iw reg set $COUNTRYCODE command was very important part of the process as well - without this settings there were only 11 channels allowed/visible all the time as the default and the set country code was 00 (not sure whether this one really belongs to any country or whether it was just "safe setting" for all countries around the world).

Mig

1

Reporting in from the future - (where the raspian kernel is 4.9) I can tell that sudo raspi-config now offers a option Set wifi country under localization. From there you can set a locale that enables the channel 12 and 13.

  • I get an error with this option: "Could not communicate with wpa_supplicant" followed by "There was an error running option I4 Change Wi-fi Country". – glenneroo Sep 14 '18 at 1:50
0

To add a note to this query

I have a Raspberry Pi - 2 Model B and I use a LogiLink WiFi adapter on it.

Upon performing iwlist scan I can see all Channels from 1 to 14 (yes! I can scan channel 14)

But if I actually want to use channel 12 or 13 using iwconfig wlan0 channel 12 or iwconfig wlan0 channel 13 I cannot do it initially since the it returns

Error for wireless request "Set Frequency" (8B04) :
SET failed on device wlan0 ; Invalid argument.

Since I am in Europe I can access these channels according to regulations and use them. This got solved according to the following steps

sudo apt-get update
sudo apt-get install wireless-regdb iw crda

and then did the following

sudo iw reg set *In CAPS your Country Code*

sure enough now iwconfig wlan0 channel 13 will work and the status can be checked using iwconfig wlan0

This might be a bit off topic but this works well since I did not have the problems of not being able to scan channels 12 and 13 but not being able to use it.

I got the information using This Link in German

Note

please check with your Country standardization whether or not you can use the latter channels or not since in some countries these channels are used for other purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.