Site Tools


projects:software:openwrt_custom_wireless-regdb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:software:openwrt_custom_wireless-regdb [2023/10/30 14:05] – [Installing your Custom wireless-regdb Package] fix missing /tmp Andrew Yongprojects:software:openwrt_custom_wireless-regdb [2024/03/23 11:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== OpenWrt Custom wireless-regdb ====== ====== OpenWrt Custom wireless-regdb ======
  
 +Note: Do not use the patch below if you are in Singapore, as wireless-regdb is now maintained once again and updated Singapore regulatory rules have been released.
 +
 +
 +This information is just provided for reference in case one needs to test changes to wireless-regdb on an OpenWrt wireless AP.
 ===== Motivation ===== ===== Motivation =====
  
-As wireless-regdb has [[http://lists.infradead.org/pipermail/wireless-regdb/2023-May/001439.html|no]] [[https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb#sending_updates_to_the_regulatory_database#sending_updates_to_the_regulatory_database|maintainer]] at time of writing, it'unlikely that [[http://lists.infradead.org/pipermail/wireless-regdb/2023-September/001454.html|my Wi-Fi 6E regulatory updates for Singapore]] will propagate to Linux distributions anytime soon.+As wireless-regdb had[[http://lists.infradead.org/pipermail/wireless-regdb/2023-May/001439.html|no]] [[https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb#sending_updates_to_the_regulatory_database#sending_updates_to_the_regulatory_database|maintainer]] it was unlikely that [[http://lists.infradead.org/pipermail/wireless-regdb/2023-September/001454.html|my Wi-Fi 6E regulatory updates for Singapore]] would propagate to Linux distributions anytime soon (as of the September 2023 IMDA TS SRD release).
  
 Thankfully, it is pretty straightforward to set up a functional Wi-Fi 6E network, as only the Access Point requires a regulatory update, while stations (clients) do not. This is because the regulatory framework restricts [[https://wireless.wiki.kernel.org/en/developers/regulatory/processing_rules#beacon_hints|the initiation of radiation (beacons)]], while clients are free to connect to any frequency the hardware is able to receive beacons on (even if it cannot initiate radiation on that frequency). Thankfully, it is pretty straightforward to set up a functional Wi-Fi 6E network, as only the Access Point requires a regulatory update, while stations (clients) do not. This is because the regulatory framework restricts [[https://wireless.wiki.kernel.org/en/developers/regulatory/processing_rules#beacon_hints|the initiation of radiation (beacons)]], while clients are free to connect to any frequency the hardware is able to receive beacons on (even if it cannot initiate radiation on that frequency).
  
-===== Making a Custom wireless-regdb =====+===== I Am Lazy and Trusting ===== 
 + 
 +Running OpenWrt 23.05.2? Here is my prebuilt package using the steps below (Option B): {{ :projects:software:wireless-regdb_2023-09-03-ab7ed562-1_all.ipk |}} 
 + 
 +  - ''ssh root@YOUR_ROUTER_IP'' 
 +  - ''opkg install %%http://ndoo.sg/_media/projects:software:wireless-regdb_2023-09-03-ab7ed562-1_all.ipk%%'' 
 +  - ''reboot'' 
 + 
 +===== Building a Custom wireless-regdb Package ===== 
 + 
 +==== Prerequisite - Prepare OpenWrt Build Environment ==== 
 + 
 +  - Install [[https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem|OpenWrt build prerequisites]] 
 +  - Clone OpenWrt source (adjust branch as needed, depending on what you're running):\\ ''%%git clone --depth=1 --branch v23.05.2 https://github.com/openwrt/openwrt.git%%'' 
 +  - Configure the build:\\ ''make menuconfig'' 
 +    - Target system: ''x86'' (or respective to the computer you are building on) to save CPU time by not having to cross-compile (the wireless-regdb package is noarch) 
 +    - Target profile: ''Generic x86'' (this is the default) 
 +    - Firmware → wireless-regdb → ''<M>'' 
 +    - Exit and save 
 +  - Build tools and toolchain (this will take ~30 min, depending on your CPU performance):\\ ''make -j$(getconf _NPROCESSORS_ONLN) tools/install''\\ ''make -j$(getconf _NPROCESSORS_ONLN) toolchain/install'' 
 + 
 +==== Option A - Quick and Dirty - Using a Patch ==== 
 + 
 +This is quick and dirty because (1) it generates a package with the same version number (unless you update the Makefile metadata) and (2) it will break with a change in wireless-regdb releases that change db.txt or (3) the patch series that comes with OpenWrt. 
 + 
 +This was only tested on OpenWrt=v23.05.2 and wireless-regdb=2023.09.01. 
 + 
 +  - Download the snippet below to your cloned OpenWrt repo (it goes in ''package/firmware/wireless-regdb/patches/''):\\ <file diff package/firmware/wireless-regdb/patches/999-SG-regd-2023-sep.patch> 
 +Index: wireless-regdb-2023.09.01/db.txt 
 +=================================================================== 
 +--- wireless-regdb-2023.09.01.orig/db.txt 
 ++++ wireless-regdb-2023.09.01/db.txt 
 +@@ -1584,25 +1584,27 @@ country SE: DFS-ETSI 
 +  # 60 GHz band channels 1-4 (ETSI EN 302 567) 
 +  (57000 - 66000 @ 2160), (40) 
 +  
 +-# https://www.imda.gov.sg/-/media/Imda/Files/Regulation-Licensing-and-Consultations/ICT-Standards/Telecommunication-Standards/Radio-Comms/IMDATSSRD.pdf 
 +-# IMDA TS SRD, Issue 1 Revision 1, April 2019, subsequently "IMDA TS SRD" 
 +-# 2400 - 2483.5 MHz: IMDA TS SRD, Table 1 (25); ANSI C63.10-2013 and FCC Part 15 Section 15.247 or EN 300 328 
 +-# 5150 - 5350 MHz: IMDA TS SRD, Table 1 (29); FCC Part 15 Section 15.407 (1) 5.15-5.25 GHz (2) 5.25-5.35 GHz; EN 301 893 
 +-# 5470 - 5725 MHz: IMDA TS SRD, Table 1 (30); FCC Part 15 Section 15.407 (2) 5.47-5.725 GHz; EN 301 893 
 +-# 5725 - 5850 MHz: IMDA TS SRD, Table 1 (27); FCC Part 15 Section 15.247; FCC Part 15 Section 15.407 (3) 5.725-5.85 GHz 
 +-# 57000 - 66000 MHz: IMDA TS SRD, Table 1 (31); ETSI EN 302 567 
 +-# Note: 27dBm for 5470-5725MHz bands is 3dBm reduction per FCC Part 15 Section 15.407 (2) 5.47-5.725 GHz; EN 301 893 as referenced by IMDA TS SRD 
 ++# https://www.imda.gov.sg/-/media/imda/files/regulation-licensing-and-consultations/ict-standards/telecommunication-standards/radio-comms/imdatssrd.pdf 
 ++# IMDA TS SRD, Issue 1 Revision 3, Sep 2023, subsequently "IMDA TS SRD" 
 ++# 2400 - 2483.5 MHz: IMDA TS SRD, Table 1 Sub-band 32e 
 ++# 5150 - 5350 MHz: IMDA TS SRD, Table 1 Sub-band 33a 
 ++# 5470 - 5725 MHz: IMDA TS SRD, Table 1 Sub-band 34 
 ++# 5725 - 5850 MHz: IMDA TS SRD, Table 1 Sub-band 35 
 ++# 5945 - 6425 MHz: IMDA TS SRD, Table 1 Sub-band 45b 
 ++# 57000 - 66000 MHz: IMDA TS SRD, Table 1 Sub-band 40 
 ++# Note: 500mW for 5470-5725MHz bands per FCC Part 15 Section 15.407 (2) 5.47-5.725 GHz as referenced by IMDA TS SRD 
 + #  AU and BG regulatory domains use the same interpretation of cited FCC and ETSI standards 
 +-# Note: The transmit power for 5250-5350MHz bands can be raised by 3dBm when TPC is implemented: IMDA TS SRD Table 1 (29) 
 +-# Note: The transmit power for 5470-5725MHz bands can be raised by 3dBm when TPC is implemented: IMDA TS SRD Table 1 (30) 
 ++# Note: The transmit power for 5250-5350MHz bands can be raised by 3dBm when TPC is implemented: IMDA TS SRD, Table 1 Sub-band 33a 
 ++# Note: The transmit power for 5470-5725MHz bands can be raised by 3dBm when TPC is implemented: IMDA TS SRD Table 1 Sub-band 34 
 +  
 + country SG: DFS-FCC 
 +- (2400 - 2483.5 @ 40), (23) 
 +- (5150 - 5250 @ 80), (23), AUTO-BW 
 +- (5250 - 5350 @ 80), (20), DFS, AUTO-BW 
 +- (5470 - 5725 @ 160), (27), DFS 
 +- (5725 - 5850 @ 80), (30) 
 +- (57000 - 66000 @ 2160), (40) 
 ++ (2400 - 2483.5 @ 40), (200 mW) 
 ++ (5150 - 5250 @ 80), (200 mW), AUTO-BW 
 ++ (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW 
 ++ (5470 - 5725 @ 160), (500 mW), DFS, AUTO-BW 
 ++ (5725 - 5850 @ 80), (1000 mW), AUTO-BW 
 ++ (5945 - 6425 @ 320), (250 mW), NO-OUTDOOR 
 ++ (57000 - 66000 @ 2160), (10000 mW) 
 +  
 + # SI as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893) 
 + # and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)</file> 
 +  - ''make package/firmware/wireless-regdb/{clean,compile} V=s'' 
 +  - Locate your freshly baked package:\\ ''$ ls bin/packages/*/base/wireless-regdb*.ipk''\\ ''bin/packages/powerpc_8548/base/wireless-regdb_2023.09.01-1_all.ipk'' 
 + 
 +==== Option B - Cleaner - Using Our Own wireless-regdb Repository ==== 
 + 
 +This is cleaner because the generated package version will track both the source commit ID and date, making it unambigious which package you have installed. 
 + 
 +=== Make Changes to wireless-regdb's regulatory.txt ===
  
 Long way: Long way:
Line 19: Line 106:
   - [[https://github.com/ndoo/wireless-regdb|My GitHub repo]]   - [[https://github.com/ndoo/wireless-regdb|My GitHub repo]]
  
-===== Building a Custom wireless-regdb Package =====+=== Building wireless-regdb Package from Our Custom Repo ===
  
 The proper way to do this would be to create a new OpenWrt package with a different name, e.g. wireless-regdb-sg6e that provides wireless-regdb, but we just want quick and dirty hack for Wi-Fi 6E enablement while waiting for wireless-regdb's next release, we can just edit the existing wireless-regdb Makefile to pull from our Git repo with the changes we want. The proper way to do this would be to create a new OpenWrt package with a different name, e.g. wireless-regdb-sg6e that provides wireless-regdb, but we just want quick and dirty hack for Wi-Fi 6E enablement while waiting for wireless-regdb's next release, we can just edit the existing wireless-regdb Makefile to pull from our Git repo with the changes we want.
  
-  - Install [[https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem|OpenWrt build prerequisites]] +
-  - Clone OpenWrt source (adjust branch as needed, depending on what you're running):\\ ''%%git clone --depth=1 --branch v23.05.0 https://github.com/openwrt/openwrt.git%%'' +
-  - Choose the target architecture and device of your AP (the built package is actually generic/noarch, but this is required anyway):\\ ''make menuconfig'' +
-  - Build tools and toolchain (this will take ~30 min, depending on your CPU performance):\\ ''make tools/install''\\ ''make toolchain/install''+
   - Download the snippet below to your cloned OpenWrt repo and run ''git apply wireless-regdb-sg.patch'' (or just patch it by hand):\\ <file diff wireless-regdb-sg.patch>   - Download the snippet below to your cloned OpenWrt repo and run ''git apply wireless-regdb-sg.patch'' (or just patch it by hand):\\ <file diff wireless-regdb-sg.patch>
 diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile
Line 49: Line 133:
    
  PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>  PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
-  + 
-</file>\\ To use your own wireless-regdb repo, change the following variables:+</file>\\ (You may have to add/remove a newline if you are getting an error during apply, due to DokuWiki limitations)\\ To use your own wireless-regdb repo, change the following variables:
     * PKG_SOURCE_URL - Git repo URL     * PKG_SOURCE_URL - Git repo URL
     * PKG_SOURCE_VERSION - Git commit hash     * PKG_SOURCE_VERSION - Git commit hash
Line 63: Line 147:
  
   - Copy the package to your AP:\\ ''scp -O bin/packages/*/base/wireless-regdb*.ipk root@YOUR_ROUTER_IP:/tmp/''   - Copy the package to your AP:\\ ''scp -O bin/packages/*/base/wireless-regdb*.ipk root@YOUR_ROUTER_IP:/tmp/''
-  - Install the package on your AP:\\ ''ssh root@YOUR_ROUTER_IP''\\ ''opkg install /tmp/wireless-regdb*.ipk''+  - Install the package on your AP:\\ ''ssh root@YOUR_ROUTER_IP''\\ ''opkg install %%--%%force-downgrade /tmp/wireless-regdb*.ipk''
   - Reboot your AP:\\ ''ssh root@YOUR_ROUTER_IP''\\ ''reboot''   - Reboot your AP:\\ ''ssh root@YOUR_ROUTER_IP''\\ ''reboot''
   - Try out your updated regulatory rules!   - Try out your updated regulatory rules!
projects/software/openwrt_custom_wireless-regdb.1698674708.txt.gz · Last modified: 2023/10/30 14:05 by Andrew Yong