Archer C7 v2 and 5GHz Transmit Power

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Oober
Posts: 35
Joined: Wed Nov 28, 2018 1:07 pm

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Oober »

Lantis wrote:
Mon Jan 16, 2023 5:40 pm
Are you telling me that the GUI only lets you pick 23? Because from everything I see there it should let you select 26. Have you tried rebooting after setting your country code? It might still be picking up the defaults from the US.

I can’t comment on why it has changed. To reiterate from the last time you asked, we make NO changes to the transmit power. We follow the upstream regulatory database which keeps a history of all changes.
https://git.kernel.org/pub/scm/linux/ke ... log/db.txt
In recent history, FI has changed due to unification with other European country regulations.
Yes, you got it right. The GUI gives only 23 dBm maximum values. For testing purpose, I tried also with country code GB, same result. Interestingly, with country code US, it gives maximum of 25 dBm for 2.4 GHz (instead of 20 dBm of FI/UK settings), but also maxes at 23 dBm for 5 GHz.

I have rebooted the device every time after changing the country code.

For the background, I did not use my C7 for a while, but I just got it again into use. I upgraded to 1.13.0, without problems, but after the upgrade the maximums are decreased.

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Lantis »

Can you do
rm /tmp/cached_basic_vars
/usr/lib/gargoyle/cache_basic_vars
cat /tmp/cached_basic_vars

And post back that file please? If that file says 26dBm allowed, can you show a screenshot that it won’t let you pick 26 on the GUI?
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Oober
Posts: 35
Joined: Wed Nov 28, 2018 1:07 pm

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Oober »

Code: Select all

var isBcm94704 = false;
var allLanMacs = [];
allLanMacs.push("e8:94:f6:c7:a6:9f");
allLanMacs.push("e8:94:f6:c7:a6:9f");
allLanMacs.push("e8:94:f6:c7:a6:a0");
allLanMacs.push("e8:94:f6:c7:a6:a0");
var isRamips = false;
var wifiDevG=uciWirelessDevs.length > 0 ? uciWirelessDevs[0] : "";
var wifiDevA="";
var wirelessDriver="mac80211";
var mac80211Channels = [];
var mac80211ChFreqs = [];
var mac80211ChPwrs = [];
var nextCh=[];
var dualBandWireless=true;
nextCh     = [];
nextChFreq = [];
nextChPwr  = [];
wifiDevA="radio0";
var AwifiN = true;
var AwifiAC = true;
var maxACwidth = "80" ;
var AC80P80 = false;
nextCh.push(36); nextChFreq[36] = "5180MHz"; nextChPwr[36] = 23;
nextCh.push(40); nextChFreq[40] = "5200MHz"; nextChPwr[40] = 23;
nextCh.push(44); nextChFreq[44] = "5220MHz"; nextChPwr[44] = 23;
nextCh.push(48); nextChFreq[48] = "5240MHz"; nextChPwr[48] = 23;
nextCh.push(52); nextChFreq[52] = "5260MHz"; nextChPwr[52] = 20;
nextCh.push(56); nextChFreq[56] = "5280MHz"; nextChPwr[56] = 20;
nextCh.push(60); nextChFreq[60] = "5300MHz"; nextChPwr[60] = 20;
nextCh.push(64); nextChFreq[64] = "5320MHz"; nextChPwr[64] = 20;
nextCh.push(100); nextChFreq[100] = "5500MHz"; nextChPwr[100] = 26;
nextCh.push(104); nextChFreq[104] = "5520MHz"; nextChPwr[104] = 26;
nextCh.push(108); nextChFreq[108] = "5540MHz"; nextChPwr[108] = 26;
nextCh.push(112); nextChFreq[112] = "5560MHz"; nextChPwr[112] = 26;
nextCh.push(116); nextChFreq[116] = "5580MHz"; nextChPwr[116] = 26;
nextCh.push(120); nextChFreq[120] = "5600MHz"; nextChPwr[120] = 26;
nextCh.push(124); nextChFreq[124] = "5620MHz"; nextChPwr[124] = 26;
nextCh.push(128); nextChFreq[128] = "5640MHz"; nextChPwr[128] = 26;
nextCh.push(132); nextChFreq[132] = "5660MHz"; nextChPwr[132] = 26;
nextCh.push(136); nextChFreq[136] = "5680MHz"; nextChPwr[136] = 26;
nextCh.push(140); nextChFreq[140] = "5700MHz"; nextChPwr[140] = 26;
nextCh.push(149); nextChFreq[149] = "5745MHz"; nextChPwr[149] = 13;
nextCh.push(153); nextChFreq[153] = "5765MHz"; nextChPwr[153] = 13;
nextCh.push(157); nextChFreq[157] = "5785MHz"; nextChPwr[157] = 13;
nextCh.push(161); nextChFreq[161] = "5805MHz"; nextChPwr[161] = 13;
nextCh.push(165); nextChFreq[165] = "5825MHz"; nextChPwr[165] = 13;
nextCh.push(169); nextChFreq[169] = "5845MHz"; nextChPwr[169] = 13;
nextCh.push(173); nextChFreq[173] = "5865MHz"; nextChPwr[173] = 13;
mac80211Channels["A"] = nextCh ;
mac80211ChFreqs["A"]  = nextChFreq ;
mac80211ChPwrs["A"]   = nextChPwr ;
nextCh     = [];
nextChFreq = [];
nextChPwr  = [];
wifiDevG="radio1";
var GwifiN = true;
nextCh.push(1); nextChFreq[1] = "2412MHz"; nextChPwr[1] = 20;
nextCh.push(2); nextChFreq[2] = "2417MHz"; nextChPwr[2] = 20;
nextCh.push(3); nextChFreq[3] = "2422MHz"; nextChPwr[3] = 20;
nextCh.push(4); nextChFreq[4] = "2427MHz"; nextChPwr[4] = 20;
nextCh.push(5); nextChFreq[5] = "2432MHz"; nextChPwr[5] = 20;
nextCh.push(6); nextChFreq[6] = "2437MHz"; nextChPwr[6] = 20;
nextCh.push(7); nextChFreq[7] = "2442MHz"; nextChPwr[7] = 20;
nextCh.push(8); nextChFreq[8] = "2447MHz"; nextChPwr[8] = 20;
nextCh.push(9); nextChFreq[9] = "2452MHz"; nextChPwr[9] = 20;
nextCh.push(10); nextChFreq[10] = "2457MHz"; nextChPwr[10] = 20;
nextCh.push(11); nextChFreq[11] = "2462MHz"; nextChPwr[11] = 20;
nextCh.push(12); nextChFreq[12] = "2467MHz"; nextChPwr[12] = 20;
nextCh.push(13); nextChFreq[13] = "2472MHz"; nextChPwr[13] = 20;
mac80211Channels["G"] = nextCh ;
mac80211ChFreqs["G"]  = nextChFreq ;
mac80211ChPwrs["G"]   = nextChPwr ;
var wpad_eap = true;
var wpad_sae = true;
var wpad_owe = true;
var wpad_sb192 = true;
var distribTarget='ath79/generic';
var geo_ipaddress = "213.145.199.167"; var geo_countrycode = "FI";
See https://imgur.com/a/9BQ45M8 . I selected channel 132 for an example. Same result also with other 100/100+ -channels (except 149 and 157 which result max of 13 dBm).

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Lantis »

Ok, thanks for the screenshot and all the details. I think I’ve been able to identify a bug. Give me a day or so to figure out a solution and come back to you.

Just for your reassurance, if you leave power at “max” (i.e. don’t explicitly pick the power level) it will use the absolute maximum available (26) even if it thinks 23 is the maximum. It removes the configuration option entirely which makes it use the regulatory maximum.
This is a GUI bug only
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Oober
Posts: 35
Joined: Wed Nov 28, 2018 1:07 pm

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Oober »

Okay, thanks again for your effort!

Just let me know if you figure out how to fix this GUI bug.

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Lantis »

You can apply the following code change to your router to fix it.
https://github.com/ericpaulbishop/gargo ... 506c7069ea

Two things to note.
1. Your file won't look like that, the javascript will have been minimised.
2. The line numbers won't match up as I've made this change on the development branch which has changed significantly.

Just search for the getMaxTxPower function and have a crack.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Oober
Posts: 35
Joined: Wed Nov 28, 2018 1:07 pm

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Oober »

Thanks for the patch.

The problem is that the file (/www/js/basic.js) appears as a single line file in vi or nano.

Here is a part of the contents (which I suppose is appropriate):

Code: Select all

function getMaxTxPower(e){var i=txPowerMax;if("mac80211"==wirelessDriver){var t=getSelectedValue("A"==e?"wifi_channel1_5ghz":"wifi_channel1"),n="A"==e?getSelectedValue("wifi_channel1_seg2_5ghz"):null,a=mac80211ChPwrs[e],l=null==a?null:a[t],s=null==n?l:null==a?null:a[n];i=null==(l=null==l?l:Math.min(l,s))?i:l}return i}function updateTxPower(e,i,t){var n=getMaxTxPower(t),a=getSelectedValue(e),l="max"==a,s=document.getElementById(i).value,d=[];d.G=[["wifi_max_txpower","wifi_txpower","wifi_dbm"],["bridge_max_txpower","bridge_txpower","bridge_dbm"]],d.A=[["wifi_max_txpower_5ghz","wifi_txpower_5ghz","wifi_dbm_5ghz"],["bridge_max_txpower_5ghz","bridge_txpower_5ghz","bridge_dbm_5ghz"]];
Sorry for being dumb but which part should be replaced and which content?

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Lantis »

Not a dumb question. Like i said it will have been minified and if you're not used to looking at it, it looks nothing like the original.
You've copied a little too much, skinny it down to this:

Code: Select all

function getMaxTxPower(e){var i=txPowerMax;if("mac80211"==wirelessDriver){var t=getSelectedValue("A"==e?"wifi_channel1_5ghz":"wifi_channel1"),n="A"==e?getSelectedValue("wifi_channel1_seg2_5ghz"):null,a=mac80211ChPwrs[e],l=null==a?null:a[t],s=null==n?l:null==a?null:a[n];i=null==(l=null==l?l:Math.min(l,s))?i:l}return i}
then replace

Code: Select all

n="A"==e?getSelectedValue("wifi_channel1_seg2_5ghz"):null
with

Code: Select all

n=("A"==e)&&(getSelectedValue("wifi_channel_width_5ghz").match(/.*80P80/)!=null),n=n?getSelectedValue("wifi_channel1_seg2_5ghz"):null
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Oober
Posts: 35
Joined: Wed Nov 28, 2018 1:07 pm

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Oober »

Thanks, applied the patch, rebooted the device but the GUI still says maximum is 23 dBm.

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Archer C7 v2 and 5GHz Transmit Power

Post by Lantis »

Try Ctrl+F5 to refresh the javascript on the page
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply