Skip to content

Modifying tx power limits

Brian Webb edited this page Oct 26, 2019 · 3 revisions

Note It is up to the user to ensure that they maintain a ERP that is within the maximum for the regulatory region that they are in. This is not an endorsement to exceed ERP limits in any way.

This information is derived from this askubuntu question/response: https://askubuntu.com/questions/1165300/how-to-increase-txpower-of-my-wifi-device

Verify current limits and regulatory region setting

iw reg get

Build a modified regulatory database

This section describes how to create a modified database if required to achieve maximum ERP.

Install required packages

Note: This assumes an Ubuntu Bionic based system. The package names or installation methods might be different for other distributions.

apt install python-future python-m2crypto libgcrypt20 libgcrypt20-dev libnl-3-dev libnl-genl-3-dev

Download the packages required to rebuild the regulatory database

wget https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/snapshot/wireless-regdb-master-2019-06-03.tar.gz

wget https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/snapshot/crda-4.14.tar.gz

Unpack the files

tar xfv crda-4.14.tar.gz

tar xfv wireless-regdb-master-2019-06-03.tar.gz

Change the restrictions

Edit the file for your country/region and modify the restriction to fit your use case.

The file is in: ./wireless-regdb-master-2019-06-03/db.txt

Rebuild the regulatory database

cd wireless-regdb-master-2019-06-03/

make

Backup the current set of database files (just in case)

cp /lib/firmware/regulatory.db /lib/firmware/regulatory.db-backup

cp /lib/firmware/regulatory.db.p7s /lib/firmware/regulatory.db.p7s-backup

cp /lib/crda/regulatory.bin /lib/crda/regulatory.bin-backup

Apply the modifications

cp regulatory.db regulatory.db.p7s /lib/firmware/

cp regulatory.bin /lib/crda/

Sign and validate

cp *.pub.pem ../crda-4.14/pubkeys

cp /lib/crda/pubkeys/*@*pub.pem ../crda-4.14/pubkeys/

Fix the install for Ubuntu

Replace

Build the crda directory

cd ../crda-4.14/

make REG_BIN=/lib/crda/regulatory.bin

make REG_BIN=/lib/crda/regulatory.bin install

Reboot and test

Reboot the machine and test by changing the wifi power level:

ifconfig <device> down

iw dev <device> set txpower fixed 2500

ifconfig <device> up