Closed kphanipavan closed 9 months ago
@garywill
Wonderful! Thank you for PR @kphanipavan !
Although I don't have a 5G wifi hardware to test, it looks great, I'll merge it.
Actually I've been thinking about changing -c <channel>
's behavior.
If user specify a channel then the script auto fallbacks to another, that is not wanted.
So let's just don't add a --force_channel
option, but make -c
have --force_channel
's feature.
I'll bump version to 0.7.x after merging this
Regarding the force channel behaviour, I found this to be the expected behaviour when I started using your script.
But, IMO, having it the current way can provide a verbose interface to the user. One can suggest a channel with -c, let the script decide if it is valid, and if the user wants to, they can enforce it using --force_channel.
Already in dev branch and I did some modifications and changes. Please share your opinions and comments.
Will merge into master finally
Can I have some more context for 183cf44934a528a20ffa77755e8a419280ae5e5f, other than this, everything looks fine. Tested 0.7.0b just now, working as intended.
When hostapd run, it will output its .conf
file path
This is what I get on my PC:
Starting hostapd
Setting /usr/sbin/hostapd to complain mode.
Warning: profile hostapd represents multiple programs
Warning: profile hostapd represents multiple programs
hostapd PID: 5532
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.oXo0Ky/hostapd.conf
Using interface x0wlan0 with hwaddr 2e:ee:68:xxxxxx and ssid "xxx"
x0wlan0: interface state UNINITIALIZED->ENABLED
x0wlan0: AP-ENABLED
When hostapd run, it will output its
.conf
file path
Doesn't seem to happen on mine for some reason, tq for clarification.
Also, may I know why the b for version?
Doesn't seem to happen on mine for some reason
Really? What's your hostapd version? To check if I was the only one who see these lines
hostapd PID: 5532
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.oXo0Ky/hostapd.conf
I searched issues for users' logs. Seems people do have those two lines
The reason of version b (beta) to differ from a stable release is:
-c
behavior changed. I can't ensure there's 100% bug-free on the script logicSo, we need to give some time for users to test
Hostapd version: v2.11-devel, built from source.
I will see if theres a config option to change for the build.
b now makes sense, cheers...
Addresses #51 and below
Fixes:
--hs20
flag, subject to the user's hostapd build.--force_channel
flag. Some WiFi cards, like my Intel AX201, can transmit to a channel while being connected to a WiFi AP in different channel.--use_ht
and--use_vht
separately to addrequire_ht
andrequire_vht
config option to hostapd config. They are mandatory if--ht_capab
or--vht_capab
are used.Tests:
1. Using the stock config:
Command:
Fails to turn on hotspot as the WiFi card is already connected to my Univ's 5G WiFi, which is on channel 56 and which is not supported, as seen below:
Screenshot:
![Screenshot_20230928_122253](https://github.com/garywill/linux-router/assets/60005847/81bf7e26-f8ac-491d-a8f9-67b828e19c43)2. Using
--force_channel
flag to overcome above:Command:
Hostapd starts, but the channel width defaults to 40MHz. Below is a screenshot from the app
Wifiman
, showing analysis of the wifi created.Screenshot:
3. Using the remaining flags for wider channel:
Command:
WiFi starts with 80MHz channel as seen in the below screenshot.
Screenshot:
Guide to choosing the flag arguments for 80MHz channel and above:
Guide
* Run `iw list | grep -i -A 15 "band 1"` to get a list of HT Capabilities. Example: ![Screenshot_20230928_131635](https://github.com/garywill/linux-router/assets/60005847/f94baa13-a428-4173-8828-09aed3c98a63) result: [HT40+][HT40-][SHORT-GI-40][SHORT-GI-20][RX-STBC1][DSSS_CCK-40] * Run `iw list | grep -i -A 15 "vht capabilities"` to get a list of VHT Capabilities. Example: ![Screenshot_20230928_132040](https://github.com/garywill/linux-router/assets/60005847/43c1b281-b4cd-4263-abcd-a51ee741ea2e) result: [MAX-MPDU-11454][VHT160][RXLDPC][SHORT-GI-80][SHORT-GI-160][TX-STBC-2BY1][SU-BEAMFORMEE][MU-BEAMFORMEE]Pick a base channel and check whether your WiFi card can transmit at your desired frequency.
Guide
* Check the specifications for your card, make sure it supports 5GHz N or AC wireless. * Check if the AP can be initiated on the desired channel, using `iw list | grep -E "dBm\)|\(disabled\)"`Decide whether you want to use 40, 80 or 160MHz channel and pick the corresponding index: 0 for 40MHz 1 for 80MHz 2 for 160MHz 3 for 80+80MHz
From WLAN Channels, in the 5GHz table and under the F0 Index column, pick the index under the required channel width which includes your base channel, called the segment 0 channel.
Example:
Example:I wanted 80MHz channel with base channel as 149. The channel index corresponding to those settings is 155.
After collecting the required data, use this format:
--use_vht --force_channel --seg0_center_freq_idx <segment 0 channel> -c <base channel> --vht_channel_width <channel width index>
So for my setup:
--use_vht --force_channel --seg0_center_freq_idx 155 -c 149 --vht_channel_width 1
Notes: