Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iwinfo scan returning bad signal levels #305

Closed
lantis1008 opened this issue Jul 1, 2018 · 83 comments
Closed

iwinfo scan returning bad signal levels #305

lantis1008 opened this issue Jul 1, 2018 · 83 comments

Comments

@lantis1008
Copy link

lantis1008 commented Jul 1, 2018

Hi,

Is iwinfo wlan1 scan supposed to work or has it not been supported?
Signal level is always reported as -256dBm

root@Gargoyle:~# iwinfo wlan1 scan
Cell 01 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 1
          Signal: -256 dBm  Quality: 70/70
          Encryption: mixed WPA/WPA2 PSK (TKIP, CCMP)

Cell 02 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 1
          Signal: -256 dBm  Quality: 70/70
          Encryption: none

Cell 03 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 1
          Signal: -256 dBm  Quality: 70/70
          Encryption: none

Cell 04 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 1
          Signal: -256 dBm  Quality: 70/70
          Encryption: WPA2 PSK (CCMP)

Cell 05 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 3
          Signal: -256 dBm  Quality: 70/70
          Encryption: none

Cell 06 - Address: xx:xx:xx:xx:xx:xx
          ESSID: "xxx"
          Mode: Master  Channel: 6
          Signal: -256 dBm  Quality: 70/70
          Encryption: none

Device: WRT32X

driver name: mwlwifi
chip type: 88W8964
hw version: 7
driver version: 10.3.8.0-20180615
firmware version: 0x09030206
power table loaded from dts: yes
firmware region code: 0x0
mac address: 60:38:e0:c5:ca:51
2g: enable
5g: disable
antenna: 4 4
irq number: 50
ap macid support: 0000ffff
sta macid support: 00010000
macid used: 00000001
radio: enable
iobase0: e1680000
iobase1: e1900000
tx limit: 1024
rx limit: 16384

Also, why is this device showing up as Power table loaded from dts = yes? The DTS definitely doesn't contain a powertable and this is one of the newer devices which should be hardcoded.

@yuhhaurlin
Copy link
Collaborator

This is WRT3200ACM?

@lantis1008
Copy link
Author

No WRT32X
https://www.linksys.com/us/p/P-WRT32X/

Should be very similar hardware to WRT3200ACM

@yuhhaurlin
Copy link
Collaborator

Please use firmware for WRT32X.

@yuhhaurlin
Copy link
Collaborator

You can report problem related to WRT3200ACM here. Thanks.

@lantis1008
Copy link
Author

I am using WRT32X firmware. It is officially supported by Openwrt now. You will not support it or investigate issue?

@yuhhaurlin
Copy link
Collaborator

As I know, it uses proprietary driver.

@yuhhaurlin
Copy link
Collaborator

So you mean it can use mwlwifi now?

@lantis1008
Copy link
Author

Yes it uses mwlwifi. The hardware is almost exactly the same as WRT3200ACM, but there are some minor differences.
I wonder if these differences are causing the issues, and had hoped you might be able to investigate?

Are you able to get one of these devices for testing internally?

@yuhhaurlin
Copy link
Collaborator

Due to it dose not use mwlwifi, I will not test it.

@lantis1008
Copy link
Author

It DOES use mwlwifi

@yuhhaurlin
Copy link
Collaborator

WRT32X should use proprietary driver.

@lantis1008
Copy link
Author

Why?

@jukkapirinen
Copy link

It uses mwlwifi (88W8964)

https://wikidevi.com/wiki/Linksys_WRT32X

@yuhhaurlin yuhhaurlin reopened this Jul 2, 2018
@yuhhaurlin
Copy link
Collaborator

I will check it later.

@yuhhaurlin
Copy link
Collaborator

Yes. The merged OpenWrt repository (I got it on 20180601) can build image for WRT32X. I will check it later.

@jukkapirinen
Copy link

Yes it pretty recent openwrt/openwrt@bfbdeeb

@lantis1008 you are using gargoyle?

@lantis1008
Copy link
Author

@bbogey yes. For all intents and purposes it should be identical for this issue, but will happily test Openwrt to check.
I had intended to do so this evening (although yesterday I finally put this router into full time production as my gateway. Might have been a bit premature).
I’m seeing hostapd issues as well which may be related but I am not with the device currently.

@BrainSlayer
Copy link

BrainSlayer commented Jul 2, 2018

the WRT32X is identical to the WRT3200ACM. just enclosure is different. no hw difference. interesting point in the posted informations.
power table loaded from dts: yes
firmware region code: 0x0

powertable loading from dts is not supported for 8964. so it seems there is a problem with the powertable data on that chipset and the region code doesnt look correct as well

@yuhhaurlin
Copy link
Collaborator

@BrainSlayer Yes. That is what I suspect, I will get WRT32X to check if it has the same problem.

@lantis1008
Copy link
Author

For reference, my device is an AU region code.

@BrainSlayer
Copy link

@yuhhaurlin : i get one soon as well. so i can check if i have the same behaviour on that device

@yuhhaurlin
Copy link
Collaborator

@BrainSlayer Thanks.

@eduperez
Copy link

eduperez commented Jul 2, 2018

On a WRT3200ACM, running LEDE 17.01.4 plus mwlwifi c2f82f1, I see the same behaviour: running "iw wlan_2g scan" or "iw wlan_5g scan", both report "signal: 0.00 dBm" for all stations found.

@lantis1008
Copy link
Author

@eduperez what about
cat /sys/kernel/debug/ieee80211/phy0/mwlwifi/info
?

Is it reporting info ok?

@eduperez
Copy link

eduperez commented Jul 2, 2018

cat /sys/kernel/debug/ieee80211/phy0/mwlwifi/info

driver name: mwlwifi
chip type: 88W8964
hw version: 7
driver version: 10.3.8.0-20180615
firmware version: 0x09030206
power table loaded from dts: no
firmware region code: 0x30
mac address: 60:38:e0:bc:34:e2
2g: disable
5g: enable
antenna: 4 4
irq number: 105
ap macid support: 0000ffff
sta macid support: 00010000
macid used: 00000007
radio: enable
iobase0: e0f00000
iobase1: e1180000
tx limit: 1024
rx limit: 16384

@lantis1008
Copy link
Author

Ok so that issue may only be WRT32X, but iw scan may be others.
Thanks for your input

@BrainSlayer
Copy link

i can reproduce it with dd-wrt as well using the iw utility. so its not a WRT32X specific issue

@ValCher1961
Copy link

@lantis1008.
you applied a patch - regfree?

@BrainSlayer
Copy link

@yuhhaurlin btw. the original wrt32x from linksys does overload the power tables on 8964 for CN, AU and AH regions. so your comment is simply wrong. see that code snipped from original firmware

    case "$CERT" in
            CN)
                    if [ -f /etc/config/wireless ]; then
                            uci set wireless.@wifi-device[0].regioncode=0x91
                            uci set wireless.@wifi-device[1].regioncode=0x91
                            uci commit wireless
                    fi
                    iwpriv wdev0 setcmd "loadpwrgrpstbl /etc/mrvl/145.ini"
                    iwpriv wdev1 setcmd "loadpwrgrpstbl /etc/mrvl/145.ini"
            ;;
            AU)
                    if [ -f /etc/config/wireless ]; then
                            uci set wireless.@wifi-device[0].regioncode=0x81
                            uci set wireless.@wifi-device[1].regioncode=0x81
                            uci commit wireless
                    fi
                    iwpriv wdev0 setcmd "loadpwrgrpstbl /etc/mrvl/129.ini"
                    iwpriv wdev1 setcmd "loadpwrgrpstbl /etc/mrvl/129.ini"
            ;;
            AH)
                    if [ -f /etc/config/wireless ]; then
                            uci set wireless.@wifi-device[0].regioncode=0x90
                            uci set wireless.@wifi-device[1].regioncode=0x90
                            uci commit wireless
                    fi
                    iwpriv wdev0 setcmd "loadpwrgrpstbl /etc/mrvl/144.ini"
                    iwpriv wdev1 setcmd "loadpwrgrpstbl /etc/mrvl/144.ini"
            ;;
    esac

@BrainSlayer
Copy link

but that doesnt affect US of course and the current bug is visible on US devices so far. i havent got my hands on a EU model yet for checking

@yuhhaurlin
Copy link
Collaborator

I think it is related to rssi of received packets. It is not related to power table. However, I will check it.

@lantis1008
Copy link
Author

Mine is AU model @BrainSlayer.
Are you saying that I should adjust DTS to provide a power table for the above listed regions?
Of course, driver modification also required to go along with it.

Would it need to be new format table like you list above or one of th existing tables from earlier device (like 1900AC) would do? Or that depends entirely on what yuhhaulin decides to do for the solution.

@BrainSlayer
Copy link

i agree, but this shouldnt affect the noise level which has a problem too. but hard to say whats wrong here

@yuhhaurlin
Copy link
Collaborator

For current version of firmware of 8964, it won't allow you to download power table if power table is programmed in EEPROM. This issue should be related to rssi of received packets. If rssi of client is all right, I think I need to trace iwinfo to see what happened.

@yuhhaurlin
Copy link
Collaborator

@BrainSlayer Yes, WRT32X with updated firmware of 8964, it can load power table for CN, AU and AH. This should be done later for mwlwifi.

@yuhhaurlin
Copy link
Collaborator

For updated firmware, it will allow driver to load power table. However, it will decide if the loading power table takes effect or not according to region code.

@yuhhaurlin
Copy link
Collaborator

For issues #280, I will modify mwlwifi to load power table if it exists with new firmware. In this way, driver won't block setting of country code.

Firmware will decide if setting takes effect according region code.

@lantis1008
Copy link
Author

Do you have any thoughts on why
cat /sys/kernel/debug/ieee80211/phy0/mwlwifi/info

Shows “0” for my region code?

@lantis1008
Copy link
Author

If my region code isn’t detected correctly, your solution may not work.

@yuhhaurlin
Copy link
Collaborator

It is WRT32X?

@lantis1008
Copy link
Author

Yes, AU region version (WRT32X-AU)

@yuhhaurlin
Copy link
Collaborator

I have no idea why WRT32X does not have region code. I got one here. Maybe I will check it later when I try to work for #280. I will check and fix this issue first.

@yuhhaurlin
Copy link
Collaborator

Originally WRT32X is designed for Marvell proprietary driver. Since mwlwifi can work for it now, I will check issues related to it. However, the priority won't be high. I will check bad signal first.

@lantis1008
Copy link
Author

I appreciate that. Thanks.

One thought on the region code. If mine is in AU and that is one of the three which can load an external power table, this may have something to do with it?
@BrainSlayer has a unit which is not part of these 3 and his is detected OK.

@yuhhaurlin
Copy link
Collaborator

Yes, it is possible. Just like 88W8864.

@yuhhaurlin
Copy link
Collaborator

I can reproduce this issue on our RD board with 88W8964 module. Signal of associated station is all right, but signal of scan result is not correct (always -256 dbm). I will check it.

@BrainSlayer
Copy link

BrainSlayer commented Aug 17, 2018

@lantis1008 if AU requires manual power table loading like i found out, the region code is 0 and undefined. that means its not locked to a specific country. the driver needs to configure the country code then. this is also what you see in the script i posted which has been taken from the original firmware. so in theory you can program this device manually by software to any powertable or region you want. but as yuhhaurlin stated before, the table loading hasnt been implemented yet for 88w8964, so your device will not run with correct power table settings. so the behaviour of your device is undefined. i dont know if there is any default builtin to the firmware (but i expect there is something like a default value since it may destroy the wifi unit otherwise with wrong power settings). but let yuhhaurlin fix the signal issue first and i hope the power table loading will be fixed soon after it. its not complicated to implement and i may already know how to implement this if it works like in the older chipsets. there are just additional parameters required for the new chipset. and for my bad i cannot test it since my device is a US region model which is locked

@lantis1008
Copy link
Author

I assume in the scenario it describes it pulls the value from something like:
CERT=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p')

Thanks for your investigation and explanations so far.
If yuhhaurlin requires any testing done, I’m available of course as always.

@BrainSlayer
Copy link

@lantis1008 correct. its stored in a mtd settings partition

admin1_passphrase=**********
admin2_passphrase=********
cert_region=US
default_passphrase=*********
default_ssid=Linksys03476
deviceType=urn:home-linksys-com:device:Router:1
devinfo_version=20170517.1
hw_mac_addr=60:38:E0:C6:7A:58
hw_revision=1
hw_version=48SAM204.0GA
manufacturer=Linksys
manufacturerURL=http://www.linksys.com
manufacturer_date=2017/10/17
mfg_data_version=1
modelDescription=Simultaneous Dual-Band Wireless-AC Gigabit Router
modelNumber=WRT32X
recovery_key=22495
serial_number=22C1060A703476
sw_version=v2.0.9
tc_passphrase=********
tc_ssid=**********
uuid_key=27F2F9C4-7353-7CBE-BB2A-109F45926452
wps_device_pin=**********

@yuhhaurlin
Copy link
Collaborator

88W8864 is all right. 88W8964 has problem, the root cause is that 88W8964 does not report receive signal to mac80211 for beacon packets. I will check how to fix it. It takes time. Thanks for your information.

@lantis1008
Copy link
Author

Thanks for the update @yuhhaurlin

@yuhhaurlin
Copy link
Collaborator

Fixed by 757340a. Thanks for your help.

@lantis1008
Copy link
Author

I will test as soon as i can.
Would you like me to open a NEW issue to track the power table issues for WRT32X?

@yuhhaurlin
Copy link
Collaborator

No. Issue #280 is used to track loading power table and remove restriction of country code.

@lantis1008
Copy link
Author

This works great. Thanks!

@yuhhaurlin
Copy link
Collaborator

Yes, I have tested this fix. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants