Skip to content

Conversation

@hsinyu-chen
Copy link
Contributor

@hsinyu-chen hsinyu-chen commented Mar 9, 2025

Thanks for sending a pull request!

How to submit a pull request

What does this implement/fix? Please describe.

  • add 320Mhz support

Does this close any currently open issues?

Additional context

  • to avoid major UI change , I change the graph navigation set overlapped about same as 320Mhz channel as a temporary solution , also set label angle for 6Ghz band to avoid text overlapping
  • the center freq of 320Mhz is correct reported in scanresult , but is at centerFreq1 , tested with Sony Xperia 1 VI but this against api description , I'm not sure it can be used
  • for use centerFreq1 , add 3rd args to calculateCenter func
  • for my country the 6Ghz band availability is very limited, I can only test channel 31 and 95

Where has this been tested?

Wifi 7 AP : Ubiquiti Unifi U7 Pro
Client Device : Sony Xperia 1 VI

Screenshot_20250310-011612.png

@hsinyu-chen
Copy link
Contributor Author

add to context :

  • the ScanResult.CHANNEL_WIDTH_320MHZ need API level 33 , not sure if should change the minimum (seems 24 now)
  • tried google but can't find reference to 320MHZ guardband number , use 3 as now

@VREMSoftwareDevelopment
Copy link
Owner

Thank you for creating a PR.

the center freq of 320Mhz is correct reported in scanresult , but it is at centerFreq1, but this against api description

Very Strange, it could be related to Ubiquiti Unifi U7 Pro and/or Sony Xperia 1 VI

Can you please provide some raw scan results for 320MHz and 160MHz?

Reference docs:

centerFreq0 - Not used if the AP bandwidth is 20 MHz  If the AP use 40, 80, 160 or 320MHz, this is the center frequency (in MHz)  if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz)
centerFreq1 - Only used if the AP bandwidth is 80 + 80 MHz  if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz)

@hsinyu-chen
Copy link
Contributor Author

hsinyu-chen commented Mar 10, 2025

  1. following data is all 160 and 320Mhz channel I can use here:

320MHZ channel 31 (control 5)

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
capabilities: [RSN-SAE+FT/SAE-CCMP][ESS][MFPR][MFPC], 
level: -58, frequency: 5975, 
timestamp: 298782642769, 
distance: ?(cm), 
distanceSd: ?(cm), 
passpoint: no, 
ChannelBandwidth: 5, 
centerFreq0: 6025, 
centerFreq1: 6105, 
standard: 11be, 
80211mcResponder: is not supported, 
80211azNtbResponder: is not supported, 
TWT Responder: yes, 
Radio Chain Infos: [RadioChainInfo: id=0, level=-59, RadioChainInfo: id=1, level=-67], 
interface name: wlan0

320MHZ channel 95 (control 85)

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
capabilities: [RSN-SAE+FT/SAE-CCMP][ESS][MFPR][MFPC], 
level: -60, 
frequency: 6375, 
timestamp: 299142163079, 
distance: ?(cm), distanceSd: ?(cm), 
passpoint: no, ChannelBandwidth: 5, 
centerFreq0: 6345, 
centerFreq1: 6265, 
standard: 11be, 
80211mcResponder: is not supported, 
80211azNtbResponder: is not supported, 
TWT Responder: yes, 
Radio Chain Infos: [RadioChainInfo: id=0, level=-65, RadioChainInfo: id=1, level=-62], 
interface name: wlan0

160MHZ channel 79(control 85)

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
capabilities: [RSN-SAE+FT/SAE-CCMP][ESS][MFPR][MFPC], 
level: -60, 
frequency: 6375, 
timestamp: 299669033474, 
distance: ?(cm), 
distanceSd: ?(cm), 
passpoint: no, 
ChannelBandwidth: 3, 
centerFreq0: 6385, 
centerFreq1: 6345, 
standard: 11be, 
80211mcResponder: is not supported, 
80211azNtbResponder: is not supported, 
TWT Responder: yes, 
Radio Chain Infos: [RadioChainInfo: id=0, level=-68, RadioChainInfo: id=1, level=-61], 
interface name: wlan0

160MHZ channel 15(control 5)

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
capabilities: [RSN-SAE+FT/SAE-CCMP][ESS][MFPR][MFPC], 
level: -50, 
frequency: 5975, 
timestamp: 299972822916, 
distance: ?(cm), 
distanceSd: ?(cm), 
passpoint: no, 
ChannelBandwidth: 3, 
centerFreq0: 5985, 
centerFreq1: 6025, 
standard: 11be, 
80211mcResponder: is not supported, 
80211azNtbResponder: is not supported, 
TWT Responder: yes, 
Radio Chain Infos: [RadioChainInfo: id=0, level=-53, RadioChainInfo: id=1, level=-53], 
interface name: wlan0

160MHZ channel 47(control 53)

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
capabilities: [RSN-SAE+FT/SAE-CCMP][ESS][MFPR][MFPC], 
level: -58, 
frequency: 6215, 
timestamp: 300231987585, 
distance: ?(cm), 
distanceSd: ?(cm), 
passpoint: no, 
ChannelBandwidth: 3, 
centerFreq0: 6225, 
centerFreq1: 6185, 
standard: 11be, 
80211mcResponder: is not supported, 
80211azNtbResponder: is not supported, 
TWT Responder: yes, 
Radio Chain Infos: [RadioChainInfo: id=0, level=-64, RadioChainInfo: id=1, level=-60], 
interface name: wlan0

https://www.rfwireless-world.com/calculators/WiFi-7-channel-number-to-center-frequency-conversion.html
this is reference I found for 6Ghz center freq.

  1. I finally found out how to run all unit test in android stuido , and correct most of them , but still got 3 left , I'm not sure what that 3 test is testing , if you can look into it will be nice , thanks

@VREMSoftwareDevelopment
Copy link
Owner

VREMSoftwareDevelopment commented Mar 15, 2025

Thanks for the information

320MHz channel 31 (control 5) - this one is a match

ChannelBandwidth: 5, standard: 11be
frequency: 5975 - channel 5
centerFreq0: 6025 - channel 15 (160MHz center)
centerFreq1: 6105 - channel 31 (320MHz center)

320MHz channel 95 (control 85) - this one does not match - channel 95 - frequency: 6425

ChannelBandwidth: 5, standard: 11be
frequency: 6375 - channel 85
centerFreq0: 6345 - channel 79 (160MHz center)
centerFreq1: 6265 - channel 63 (320MHz center)

160MHz channel 79 (control 85) - this one is a match

ChannelBandwidth: 3, standard: 11be
frequency: 6375 -  channel 85
centerFreq0: 6385 -  channel 87 (80MHz center)
centerFreq1: 6345 -  channel 79 (160MHz center)

160MHz channel 15 (control 5) - this one is a match

ChannelBandwidth: 3, standard: 11be
frequency: 5975 - channel 5
centerFreq0: 5985 - channel 7
centerFreq1: 6025 -  channel 15

160MHz channel 47 (control 53) - this one is a match

ChannelBandwidth: 3, standard: 11be
frequency: 6215 - channel 53
centerFreq0: 6225 - channel 55
centerFreq1: 6185 - channel 47

! One data sample data is strange, the rest do match

still got 3 left

Sets are overlapping now, that the reason for the failures.
Do not worry about these failed tests, since this needs to be reworked anyway

@hsinyu-chen
Copy link
Contributor Author

320MHz channel 95 (control 85) - this one does not match - channel 95 - frequency: 6425

this one is not clear , since the Unifi network only allow user to select control channel , which is 85 , so I'm not very sure it's on 95 (from the chart it seems), I think we need other people with other hardware to test

@VREMSoftwareDevelopment
Copy link
Owner

Is it possible to re-test 320MHz with control channel 85, based on scan result center channel needs to be 63?

@hsinyu-chen
Copy link
Contributor Author

Is it possible to re-test 320MHz with control channel 85, based on scan result center channel needs to be 63?

Screenshot_20250316-221706.png

Screenshot_20250316-221807.png

Any thoughts?

@hsinyu-chen
Copy link
Contributor Author

Is it possible to re-test 320MHz with control channel 85, based on scan result center channel needs to be 63?

image
image
control channel 85 can be 63 or 95 , I have no control of it , or I'm total misunderstanding how unifi or wifi7 channel works here :(

@hsinyu-chen
Copy link
Contributor Author

hsinyu-chen commented Mar 16, 2025

FYI
I have 2 AP , one is on control channel 5, one is on 85 , this is the results from wifiman when I stand at middle point of both ap

Screenshot_20250316-222932.png

and this is raw scan results from wifi analyzer debug mode

SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:4b:90, 
frequency: 5975, 
ChannelBandwidth: 5, 
centerFreq0: 6025, 
centerFreq1: 6105, 
SSID: "PAT_HOME 5G", 
BSSID: 2a:70:4e:7e:77:98,
frequency: 6375,
ChannelBandwidth: 5, 
centerFreq0: 6345, 
centerFreq1: 6265,

@VREMSoftwareDevelopment
Copy link
Owner

Thanks for the information

@codecov
Copy link

codecov bot commented Mar 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.10%. Comparing base (73710e1) to head (31f1270).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #511   +/-   ##
=========================================
  Coverage     95.09%   95.10%           
  Complexity      915      915           
=========================================
  Files           131      131           
  Lines          2712     2715    +3     
  Branches        208      209    +1     
=========================================
+ Hits           2579     2582    +3     
  Misses           48       48           
  Partials         85       85           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VREMSoftwareDevelopment VREMSoftwareDevelopment merged commit a962728 into VREMSoftwareDevelopment:main Mar 22, 2025
5 checks passed
@VREMSoftwareDevelopment
Copy link
Owner

Hi @hsinyu-chen,

The following changes have been committed to the main branch:

  • Reworked Graph Channel Display (2.4/5/6 GHz)
  • Access Point Pop-up Details (including channel range information)

Would it be possible to conduct testing for the 5/6 GHz frequency bands and 160/320 MHz channel widths?

Your comments or recommendations on the changes would be highly appreciated.

Additionally, it's possible to obtain the APK without performing a local build. The artifacts are available via this workflow.

Thanks

@hsinyu-chen
Copy link
Contributor Author

5Ghz screenshot
Screenshot_20250326-225349.png

6Ghz screenshot
Screenshot_20250326-225423.png

Channel 31 popup window , the channel field show -1 -> 63 , seems weird.
Screenshot_20250326-225453.png

And this is channel 95, which is the one I failed to get correct(?) center frequency
Screenshot_20250326-230251.png

For reference, WiFi man results
Screenshot_20250326-230535.png

In the record, the popup show both when I click the graph, I think it iterate through all SSID on the click point is that by design?

screen-20250326-225554.mp4

Do you need

@hsinyu-chen
Copy link
Contributor Author

will report 160Mhz result later, need wait everyone go sleep so I can change the AP setting without effect them

@VREMSoftwareDevelopment
Copy link
Owner

Probably need more raw scan results from wifi analyzer debug mode for 160 and 320
Something is not right, switch using center1 for 320 from raw result, and values look incorrect

In the record, the popup show both when I click the graph, I think it iterate through all SSID on the click point is that by design?

Yes, if more than 1 AP is displayed close to each other, by clicking it will iterate over them as pop-up

@VREMSoftwareDevelopment
Copy link
Owner

??? Maybe for 320 need to look at both center0 and center1 and use some kind of formula

Probably having raw results for both 160 and 320 will help

Again thanks for your help

@hsinyu-chen
Copy link
Contributor Author

hsinyu-chen commented Mar 26, 2025

??? Maybe for 320 need to look at both center0 and center1 and use some kind of formula

Probably having raw results for both 160 and 320 will help

Again thanks for your help

can we have something that can get raw result in the app without local debugger attached?

@VREMSoftwareDevelopment
Copy link
Owner

VREMSoftwareDevelopment commented Mar 26, 2025

Please try the following:

  1. Enable Developer Options on your Phone https://support.surfshark.com/hc/en-us/articles/360009643980-How-to-enable-Developer-options-on-an-Android-device
  2. To view Wi-Fi scan results in developer mode on your Android phone, navigate to Settings > Developer Options > Networking:
    • Enable Wi-Fi verbose logging
    • Disable Wi-Fi scan throttling

This may not give all details as available in ScanResult

Another Developer Options link: https://developer.android.com/studio/debug/dev-options

@hsinyu-chen
Copy link
Contributor Author

Please try the following:

  1. Enable Developer Options on your Phone https://support.surfshark.com/hc/en-us/articles/360009643980-How-to-enable-Developer-options-on-an-Android-device

  2. To view Wi-Fi scan results in developer mode on your Android phone, navigate to Settings > Developer Options > Networking:

    • Enable Wi-Fi verbose logging
    • Disable Wi-Fi scan throttling

This may not give all details as available in ScanResult

Another Developer Options link: https://developer.android.com/studio/debug/dev-options

I tried , but not detail enough for us , will get ScanResult later, maybe cloud add copy raw ScanResult button inside current popup later on

@hsinyu-chen
Copy link
Contributor Author

hsinyu-chen commented Mar 26, 2025

@VREMSoftwareDevelopment I have confirm the ScanResult is same as last time I proved, I have dig this and I think maybe the issue is on the Unifi side(wifi man display logic)

this is linux kernal code for calculate wifi channel wireless/util.c#L136

and I port it to javascript , feed data from my scanresult, ported code gist

and the output

320Mhz 31 (control 5)
  c0_ch:15
  c1_ch:31
320Mhz 95 (control 85)
  c0_ch:79
  c1_ch:63
160Mhz 79(control 85)
  c0_ch:87
  c1_ch:79
160Mhz 15(control 5)
  c0_ch:7
  c1_ch:15
160Mhz 47(control 53)
  c0_ch:55
  c1_ch:47

so the channel (center freq) is all matched other than 320Mhz 95 (control 85) one
I dig about this , and I think it is correct , wifi bandwith is not fixed , it grow dynamically by client request
reference 1
reference 2
and you only can config beacon channel on the AP, which is 85 for this case, and for the beacon channel 85, there has 2 posible 320Mhz channel 63 and 95 which is overlapped , I don't think there is a way to determine which one is correct (and maybe no one is, base on the 20Mhz growing bandwith)
this also a issue within Unifi Network reference

so I think we are all good here

Add to this
If I put 2 AP on channel that is no overlapping the results are same on both app(due to country limitations, I can only select 160Mhz for 2nd AP otherwise it'll overlapping)

Screenshot_20250327-031212.png

Screenshot_20250327-031355.png

@VREMSoftwareDevelopment
Copy link
Owner

Looks like 160 work good center1 is actually center
For 320 need to do some hack to make it look reasonable
Hopefully they will fix API in future

Will post when new hack is available

@VREMSoftwareDevelopment
Copy link
Owner

Hi @hsinyu-chen,

I wanted to inform you that new code to calculate the center for 160/320 MHz widths has been committed to the main branch.

Your feedback or recommendations on these changes would be greatly appreciated.

Additionally, you can obtain the APK without performing a local build. The artifacts are available through this workflow.

Looking forward to your insights!

Best regards

@hsinyu-chen
Copy link
Contributor Author

hsinyu-chen commented Mar 29, 2025

@VREMSoftwareDevelopment I test the app and look the code , I think it's too hacky and may not present actually situation.

  • 2 AP beacon channel 5 , and beacon channel 85
    320+320
  • 2 AP beacon channel 5, and beacon channel 53
    320+320_2

the first one looks "right" but it is not accurate , the 85 should be able to use 320MHZ-1 channel 63 or 320MHZ-0 95
but from the image it look like it can only use 95
image

the second one have same issue ,on the bad way , the beacon channel 53 can use 320MHZ-1 channel 63 , but due to current center calculation , it look like it is using 31 exclusively
image2

IMO for best present wifi7 320Mhz channel usage, maybe it only display 20MHZ beacon channel as solid color , and a dash line border for possible channels?

@VREMSoftwareDevelopment
Copy link
Owner

maybe it only display 20MHZ beacon channel as solid color , and a dash line border for possible channels?

This is not trivial to do.
Need to think about it.

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

Successfully merging this pull request may close these issues.

2 participants