1 2 3 Previous Next 34 Replies Latest reply on Sep 2, 2020 2:38 AM by ZhengbaoZ_96

    RasPi4 WiFi problem with KR country code

    JoKi_4755061

      The Raspberry Pi 4B implements WiFi with brcm43455.

      With WiFi country code KR(Korea), most of available channels are disabled:

       

      $ iw phy phy0 channels

      Band 1:

      * 2412 MHz [1] (disabled)

      * 2417 MHz [2] (disabled)

      * 2422 MHz [3] (disabled)

      * 2427 MHz [4] (disabled)

      * 2432 MHz [5] (disabled)

      * 2437 MHz [6] (disabled)

      * 2442 MHz [7] (disabled)

      * 2447 MHz [8] (disabled)

      * 2452 MHz [9] (disabled)

      * 2457 MHz [10] (disabled)

      * 2462 MHz [11] (disabled)

      * 2467 MHz [12] (disabled)

      * 2472 MHz [13] (disabled)

      * 2484 MHz [14] (disabled)

      Band 2:

      * 5170 MHz [34] (disabled)

      * 5180 MHz [36] (disabled)

      * 5190 MHz [38] (disabled)

      * 5200 MHz [40] (disabled)

      * 5210 MHz [42] (disabled)

      * 5220 MHz [44] (disabled)

      * 5230 MHz [46] (disabled)

      * 5240 MHz [48] (disabled)

      * 5260 MHz [52] (disabled)

      * 5280 MHz [56] (disabled)

      * 5300 MHz [60] (disabled)

      * 5320 MHz [64] (disabled)

      * 5500 MHz [100] (disabled)

      * 5520 MHz [104] (disabled)

      * 5540 MHz [108] (disabled)

      * 5560 MHz [112] (disabled)

      * 5580 MHz [116] (disabled)

      * 5600 MHz [120] (disabled)

      * 5620 MHz [124] (disabled)

      * 5640 MHz [128] (disabled)

      * 5660 MHz [132] (disabled)

      * 5680 MHz [136] (disabled)

      * 5700 MHz [140] (disabled)

      * 5720 MHz [144] (disabled)

      * 5745 MHz [149]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz

      * 5765 MHz [153]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz

      * 5785 MHz [157]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz

      * 5805 MHz [161]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz

      * 5825 MHz [165] (disabled)

       

      All 2.4GHz channels are disabled, and most of 5GHz channels are disabled.

      Actually totally unusable.

      When I set the country code to GB:

       

      $ iw phy phy0 channels

      Band 1:

      * 2412 MHz [1]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 2417 MHz [2]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 2422 MHz [3]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 2427 MHz [4]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 2432 MHz [5]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40- HT40+

      * 2437 MHz [6]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40- HT40+

      * 2442 MHz [7]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40- HT40+

      * 2447 MHz [8]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40- HT40+

      * 2452 MHz [9]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40- HT40+

      * 2457 MHz [10]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 2462 MHz [11]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 2467 MHz [12]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 2472 MHz [13]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 2484 MHz [14] (disabled)

      Band 2:

      * 5170 MHz [34] (disabled)

      * 5180 MHz [36]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 5190 MHz [38] (disabled)

      * 5200 MHz [40]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 5210 MHz [42] (disabled)

      * 5220 MHz [44]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40+

      * 5230 MHz [46] (disabled)

      * 5240 MHz [48]

      Maximum TX power: 20.0 dBm

      Channel widths: 20MHz HT40-

      * 5260 MHz [52]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5280 MHz [56]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5300 MHz [60]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5320 MHz [64]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5500 MHz [100]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5520 MHz [104]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5540 MHz [108]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5560 MHz [112]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5580 MHz [116]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5600 MHz [120]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5620 MHz [124]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5640 MHz [128]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5660 MHz [132]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40+

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5680 MHz [136]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz HT40-

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5700 MHz [140]

      Maximum TX power: 20.0 dBm

      No IR

      Radar detection

      Channel widths: 20MHz

      DFS state: usable (for 19 sec)

      DFS CAC time: 60000 ms

      * 5720 MHz [144] (disabled)

      * 5745 MHz [149] (disabled)

      * 5765 MHz [153] (disabled)

      * 5785 MHz [157] (disabled)

      * 5805 MHz [161] (disabled)

      * 5825 MHz [165] (disabled)

       

      Now the WiFi is usable.

       

      How could the correct WiFi country code make it malfunction?

      I want to know when I can have fixed firmware for this problem.

       

      PS. I remember the Raspberry Pi 3B+ also has same problem.

        • 1. Re: RasPi4 WiFi problem with KR country code
          ZhengbaoZ_96

          Hello:

           

             Would you please share the NVRAM file from the board ?  by the way I want to know how you are setting your country code now ,   and if the country code is KR/0 ?

          • 2. Re: RasPi4 WiFi problem with KR country code
            JoKi_4755061

            Thanks for your reply ZhengbaoZ_96,

            WiFi country setting is done by raspi-config, and the country code is just KR. (AFAIK)

            I don't know what is the NVRAM file you mentioned.

            However, of course I will give it to you to solve this problem.

            Please tell me how to find it.

            • 3. Re: RasPi4 WiFi problem with KR country code
              ZhengbaoZ_96

              Hello:

                 you can try to find *.cal in file directory in Raspberry , I don't know if nvram is open to customers in Raspberry.   I got this one from Raspberry qa..

                 Seems they are asking customer to configure the band you needed ,  not limited to your country code.

              You can choose the one you needed.

              On the Raspberry Pi 3B+ and Raspberry Pi 4B, you will also need to set the country code, so that the 5GHz networking can choose the correct frequency bands. You can do this using the raspi-config application: select the 'Localisation Options' menu, then 'Change Wi-Fi Country'. Alternatively, you can edit the wpa_supplicant.conf file and add the following. (Note: you need to replace 'GB' with the 2 letter ISO code of your country. See Wikipedia for a list of 2 letter ISO 3166-1 country codes.)

              country=GB

              1 of 1 people found this helpful
              • 4. Re: RasPi4 WiFi problem with KR country code
                ZhengbaoZ_96

                country=KR,  so your question is kR in wpa_supplicant.conf can't work , is that right ?

                1 of 1 people found this helpful
                • 5. Re: RasPi4 WiFi problem with KR country code
                  JoKi_4755061

                  Yes. Can't use WiFi with country code KR. (Which is correct)

                  • 6. Re: RasPi4 WiFi problem with KR country code
                    JoKi_4755061

                    ZhengbaoZ_96

                    Is there any on-going investigation about this problem?

                    • 7. Re: RasPi4 WiFi problem with KR country code
                      ZhengbaoZ_96

                      Hello:

                       

                          Our country regulatory is set as country_code/rev as usual,   we often provide customer to set the country to US/0, XR/4,or other options..  but raspberry didn't release interface to their customer to change rev to match the setting.   Hypothetically,  raspberry set the XR in their driver to XR/0 ,  but it is disabled in default, so customer can't change it to XR/1 or XR/4 ,etc...  I believe we have good code/rev in the release to Raspberry , but the setting in driver is wrong .  if you want to solve the issue, you need to get the driver , try to find the match position of the code, then to change the code/rev to have a test .

                      • 8. Re: RasPi4 WiFi problem with KR country code
                        JoKi_4755061

                        ZhengbaoZ_96

                        Thank you for your reply. It helped me to understand what the real problem is. It looks like that the brcmfmac driver choose the first match by country code regardless of revision.

                        1. Can you please explain what the revision is for?

                        2. Can I assume the highest revision is recent and the one to be used?

                        • 9. Re: RasPi4 WiFi problem with KR country code
                          ZhengbaoZ_96

                          revision is for different customers , or for different regulatory requirements.

                          Most popular revision for KR is KR/4 ..

                          • 10. Re: RasPi4 WiFi problem with KR country code
                            JoKi_4755061

                            ZhengbaoZ_96

                            It looks like that the brcmfmac43455-sdio.clm_blob provided within Raspberry Pi OS has 10 entries with KR country code. (revision 0 to 9) From the document "Cypress Wi-Fi CLM Regulatory Manual", this kind of clm_blob is "Master CLM". Right? Is it okay and expected to distribute the master clm for an end-user product like Raspberry Pi?

                            If yes, is there a open interface for Linux to specify country code with revision?

                            If no, is it possible for you to provide a "Per Product CLM" which has single working KR entry (maybe it is KR/4 in master clm)?

                            • 11. Re: RasPi4 WiFi problem with KR country code
                              JoKi_4755061

                              I found cyfmac43455-sdio.clm_blob included in the latest Cypress Linux WiFi driver release. It looks like a "Per Product CLM", and it looks like having single KR entry. I replaced existing brcmfmac43455-sdio.clm_blob with renamed cyfmac43455-sdio.clm_blob, my RasPi4 booted okay, and got many enabled channels:

                               

                              $ iw phy0 channels

                              Band 1:

                                  * 2412 MHz [1]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2417 MHz [2]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2422 MHz [3]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2427 MHz [4]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2432 MHz [5]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2437 MHz [6]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2442 MHz [7]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2447 MHz [8]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2452 MHz [9]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2457 MHz [10]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2462 MHz [11]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2467 MHz [12]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2472 MHz [13]

                                    Maximum TX power: 13.0 dBm

                                    Channel widths: 20MHz

                                  * 2484 MHz [14] (disabled)

                              Band 2:

                                  * 5170 MHz [34] (disabled)

                                  * 5180 MHz [36]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40+ VHT80

                                  * 5190 MHz [38] (disabled)

                                  * 5200 MHz [40]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40- VHT80

                                  * 5210 MHz [42] (disabled)

                                  * 5220 MHz [44]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40+ VHT80

                                  * 5230 MHz [46] (disabled)

                                  * 5240 MHz [48]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40- VHT80

                                  * 5260 MHz [52] (disabled)

                                  * 5280 MHz [56] (disabled)

                                  * 5300 MHz [60] (disabled)

                                  * 5320 MHz [64] (disabled)

                                  * 5500 MHz [100] (disabled)

                                  * 5520 MHz [104] (disabled)

                                  * 5540 MHz [108] (disabled)

                                  * 5560 MHz [112] (disabled)

                                  * 5580 MHz [116] (disabled)

                                  * 5600 MHz [120] (disabled)

                                  * 5620 MHz [124] (disabled)

                                  * 5640 MHz [128] (disabled)

                                  * 5660 MHz [132] (disabled)

                                  * 5680 MHz [136] (disabled)

                                  * 5700 MHz [140] (disabled)

                                  * 5720 MHz [144] (disabled)

                                  * 5745 MHz [149]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40+ VHT80

                                  * 5765 MHz [153]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40- VHT80

                                  * 5785 MHz [157]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40+ VHT80

                                  * 5805 MHz [161]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz HT40- VHT80

                                  * 5825 MHz [165]

                                    Maximum TX power: 20.0 dBm

                                    Channel widths: 20MHz

                               

                              I will compare this list with recent Korean regulation.

                              • 12. Re: RasPi4 WiFi problem with KR country code
                                JoKi_4755061

                                The channel list above looks not matching with Korean regulation. Why should channels 52 ~ 144 be disabled? The only KR entry in the cyfmac43455-sdio.clm_blob is not KR/4?

                                • 13. Re: RasPi4 WiFi problem with KR country code
                                  ZhengbaoZ_96

                                  hello:

                                   

                                  Have a try to see if attached wl tool can be used in Raspberri ,  then use below command to have a test after up of the board:

                                   

                                  wl down

                                  wl country KR/4

                                  wl up

                                  • 14. Re: RasPi4 WiFi problem with KR country code
                                    JoKi_4755061

                                    ZhengbaoZ_96

                                    Both two binaries are executable on my RPi4, but looks not compatible with brcmfmac driver:

                                     

                                    pi@raspi4b:~/Downloads $ ./wl down

                                    ./wl: wl driver adapter not found

                                    pi@raspi4b:~/Downloads $ ./wl_fmac_rpi3 down

                                    ./wl_fmac_rpi3: wl driver adapter not found

                                    1 2 3 Previous Next