RTL88x2BU-Linux-Driver icon indicating copy to clipboard operation
RTL88x2BU-Linux-Driver copied to clipboard

changing txpower

Open t3therdev opened this issue 5 years ago • 83 comments
trafficstars

With this driver, no matter what we do the output of:

iw dev or iw wlan0 info

is: txpower 12.00 dBm

when trying to set: (after forcing down) iw dev wlan0 set txpower fixed 20mBm or 30mBm, nothing changes.

The makefile has these options:

CONFIG_TXPWR_BY_RATE = y CONFIG_TXPWR_BY_RATE_EN = y CONFIG_TXPWR_LIMIT = y CONFIG_TXPWR_LIMIT_EN = n

But they don't seem to change anything.

Has anyone been able to set the txpower to 20mBm or 30 or something other than 12?

t3therdev avatar Aug 02 '20 07:08 t3therdev

txpower is not implemented in the official driver. https://github.com/RinCat/RTL88x2BU-Linux-Driver/blob/master/os_dep/linux/ioctl_cfg80211.c#L4180

RinCat avatar Aug 02 '20 08:08 RinCat

Lucky for you, I just updated to the last official driver I can found, and it "seems" support change TX power. It can be set and read, but I have no way to test if it actually changed TX power.

Use iw wlan0 set txpower fixed 2000 to change to 20.00 dBm.

RinCat avatar Aug 02 '20 12:08 RinCat

Compiled and working. Seems it actually sets it on the adapter itself. I went back to the old driver on another OS and it was now 20dbm. Updating the driver definitely changed it from 12 to 20. But this driver DOES let you change it. Thanks so much!

t3therdev avatar Aug 02 '20 17:08 t3therdev

When running hostapd we are seeing: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE wlan0: interface state COUNTRY_UPDATE->HT_SCAN

t3therdev avatar Aug 02 '20 17:08 t3therdev

That seems normal, it need to check country regulations.

RinCat avatar Aug 03 '20 00:08 RinCat

Hi, so after running a test with 2 clients overnight we got all these errors hostapd stopped working. Have you seen this before?

Inline: { "syslog":"Aug 5 14:10:01 vcsap kern.warn kernel: [48033.953634] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:03 vcsap kern.warn kernel: [48036.089528] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:05 vcsap kern.warn kernel: [48038.255838] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:07 vcsap kern.warn kernel: [48040.347789] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:09 vcsap kern.warn kernel: [48042.491983] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:10 vcsap kern.warn kernel: [48043.082505] RTW: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:TKIP Aug 5 14:10:11 vcsap kern.warn kernel: [48044.626960] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:13 vcsap kern.warn kernel: [48046.774126] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:16 vcsap kern.warn kernel: [48048.895168] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:18 vcsap kern.warn kernel: [48051.028812] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:20 vcsap kern.warn kernel: [48053.118811] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:22 vcsap kern.warn kernel: [48055.284013] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:24 vcsap kern.warn kernel: [48057.419150] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:26 vcsap kern.warn kernel: [48059.550532] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:28 vcsap kern.warn kernel: [48061.686648] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:30 vcsap kern.warn kernel: [48063.824479] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:33 vcsap kern.warn kernel: [48065.958207] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event! Aug 5 14:10:35 vcsap kern.warn kernel: [48068.131861] RTW: ERROR _btmpoper_cmd: Didn't get H2C Rsp Event!

Basically thousands of those errors.

t3therdev avatar Aug 05 '20 14:08 t3therdev

No, but the code shows the error is H2C API command timeout. Is the device under heavy load?

RinCat avatar Aug 05 '20 15:08 RinCat

At that time no, but sometimes yes. How can we prevent it? Are there any run-time flags or anything we can set? Or how to handle/recover from it? It crashes the driver I think and requires a reboot.

t3therdev avatar Aug 05 '20 15:08 t3therdev

I feel like this wasn't an issue in the older driver. Can you tell me where I can get your 5.6 version and do a comparison test?

t3therdev avatar Aug 05 '20 15:08 t3therdev

https://github.com/RinCat/RTL88x2BU-Linux-Driver/archive/314b662331971b10eb484fbcedb06bf5abfcb211.zip Latest 5.6 version.

RinCat avatar Aug 05 '20 15:08 RinCat

Any ideas on those errors?

t3therdev avatar Aug 05 '20 15:08 t3therdev

The manufacturer also provided me with an updated hostapd/wpa supplicant if that helps.

t3therdev avatar Aug 05 '20 15:08 t3therdev

No ideas, since I have never encountered this bug. You may try unload and load the driver again to see if it reset. hostapd/wpa should be fine.

RinCat avatar Aug 05 '20 15:08 RinCat

How about this errors:

RTW: ERROR rtl8822b_c2h_handler_no_io: C2H(9) enqueue FAIL! RTW: [HALMAC] [ALWAYS]shall R reg twice!! RTW: ERROR [HALMAC] [ERR] Dump efuse in suspend

t3therdev avatar Aug 05 '20 15:08 t3therdev

How can we disable btrtl (bluetooth driver for same wireless card) and btusb for that card?

t3therdev avatar Aug 05 '20 15:08 t3therdev

RTW: [HALMAC] [ALWAYS]shall R reg twice!! RTW: ERROR [HALMAC] [ERR] Dump efuse in suspend

is normal. But

RTW: ERROR rtl8822b_c2h_handler_no_io: C2H(9) enqueue FAIL!

is not.

RinCat avatar Aug 05 '20 15:08 RinCat

Bluetooth is disabled, or you have anything in /proc/net/rtl88x2bu/wlan0/btcoex?

RinCat avatar Aug 05 '20 15:08 RinCat

its empty

t3therdev avatar Aug 05 '20 15:08 t3therdev

we can recompile with CONFIG_BT_COEXIST = n instead of yes and try it also...

t3therdev avatar Aug 05 '20 15:08 t3therdev

You can give it a try

RinCat avatar Aug 05 '20 15:08 RinCat

Any issue setting this in makefile? CONFIG_POWER_SAVING = n

We also set: iw dev wlan0 set power_save off

t3therdev avatar Aug 05 '20 18:08 t3therdev

you can turn it off

RinCat avatar Aug 05 '20 18:08 RinCat

So today we have the following failure on the latest 5.8 driver:

RTW: WARN _beamforming_leave:

and then it deauth's the wifi device...and no longer allow anything to connect without a reboot.

t3therdev avatar Aug 06 '20 20:08 t3therdev

Set rtw_beamform_cap=0 to disable beamform. But I think you probably crashed the device for some reason. Make sure it has enough power supply and not overheat.

RinCat avatar Aug 06 '20 20:08 RinCat

still getting these errors which break the ap...? any ideas?

[75756.600303] RTW: WARN _beamforming_leave: xx:xx:xx:xx:xx:xx is neither beamforming ee or er!! [75756.600309] RTW: WARN _beamforming_leave: xx:xx:xx:xx:xx:xx is neither beamforming ee or er!!

t3therdev avatar Aug 07 '20 20:08 t3therdev

That means the mac address interface is not found.

RinCat avatar Aug 07 '20 20:08 RinCat

mac for what? why does it break the ap?

t3therdev avatar Aug 07 '20 20:08 t3therdev

Maybe the interface disappeared for some reason. It cannot found an interface with the mac address.

RinCat avatar Aug 08 '20 01:08 RinCat

Hi, so our adapter is usb 2.0 and no matter what modprobe command comes up it seems to be trying usb 3.0 mode. is there any other way to force usb 2.0 other than during modprobe? such as in the makefile?

t3therdev avatar Aug 11 '20 14:08 t3therdev

No, and the default is not switch unless you set rtw_switch_usb_mode=1.

RinCat avatar Aug 11 '20 20:08 RinCat