Skip to content

fix: attempt to use channel of $WIFI_IFACE if default channel fails #466

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

Merged
merged 2 commits into from
Mar 12, 2025
Merged

fix: attempt to use channel of $WIFI_IFACE if default channel fails #466

merged 2 commits into from
Mar 12, 2025

Conversation

sudoAlphaX
Copy link
Contributor

@sudoAlphaX sudoAlphaX commented Feb 23, 2025

This patch attempts to fallback to an existing $WIFI_IFACE_CHANNEL if
current $CHANNEL does not work. In cases, hardware reports as multiple
channels available to transmit, hence the script uses channel 1 as
default. But it fails when trying to transmit on channel 1.

This patch modifies can_transmit_to_channel function checking to check if
$CHANNEL is equal to $WIFI_IFACE_CHANNEL. If not, it sets $CHANNEL to be
the same as $WIFI_IFACE_CHANNEL and checks can_transmit_to_channel. If
passed, ap is created on the same channel as $WIFI_IFACE_CHANNEL. Else,
it safely fails.

This is a rewrite of PR #450

Fixes #344

This patch attempts to fallback to an existing $WIFI_IFACE_CHANNEL if
current $CHANNEL does not work. In cases, hardware reports as multiple
channels available to transmit, hence the script uses channel 1 as
default. But it fails when trying to transmit on channel 1.

This patch modifies can_transmit_to_channel function to check if
$CHANNEL is equal to $WIFI_IFACE_CHANNEL. If not, it sets $CHANNEL to be
the same as $WIFI_IFACE_CHANNEL and checks can_transmit_to_channel. If
passed, ap is created on the same channel as $WIFI_IFACE_CHANNEL. Else,
it safely fails.
@sudoAlphaX
Copy link
Contributor Author

@jfly please check if this works for you.
However this is just a rewrite of the previous PR so it is unlikely it would work in your scenario.

@sudoAlphaX
Copy link
Contributor Author

sudoAlphaX commented Feb 23, 2025

okay no this fails magnificently when using a config file. I still have to work on it.

@sudoAlphaX sudoAlphaX marked this pull request as draft February 23, 2025 15:31
This commit is an addition to f0f68e9 where it fails when using config
file. This patch allows `default` option for the FREQ_BAND config option.
It also creates changes the `--mkconfig` option to detect whether or not
one is using a specific frequency band.
@sudoAlphaX sudoAlphaX marked this pull request as ready for review February 28, 2025 10:08
@sudoAlphaX
Copy link
Contributor Author

yup should work nice now. Please test

@lakinduakash
Copy link
Owner

If someone can test and let me know whether it works, I'll merge, right now i don't have a way to test it. Thanks

@sudoAlphaX
Copy link
Contributor Author

Any updates?

In any case, it works for me (my wifi adapter is weird, thats why i wrote the patch), and maybe 1 ACK from me.

@lakinduakash lakinduakash merged commit c0f153b into lakinduakash:master Mar 12, 2025
2 checks passed
@sudoAlphaX sudoAlphaX deleted the fallback-wifi-channel branch March 12, 2025 10:00
@JingMatrix
Copy link

In my device, the create_ap fails with channel 1, but the function can_transmit_to_channel always return true.
The problem can be solve if I mannually bypass this function, please tell what I can help further.

@sudoAlphaX
Copy link
Contributor Author

In my device, the create_ap fails with channel 1, but the function can_transmit_to_channel always return true. The problem can be solve if I mannually bypass this function, please tell what I can help further.

Are you able to manually set a channel using the -c flag? If so, the problem is that the fallback isn't working properly. Am I getting this correctly?

@JingMatrix
Copy link

@sudoAlphaX Yeah, you are right.

@sudoAlphaX
Copy link
Contributor Author

sudoAlphaX commented Apr 23, 2025

@JingMatrix

please give me the output of this, with the -dd flag for hostapd debugging:

diff --git a/src/scripts/create_ap b/src/scripts/create_ap
index be781c1..bcb17fa 100755
--- a/src/scripts/create_ap
+++ b/src/scripts/create_ap
@@ -1702,15 +1702,30 @@ if [[ -n "$COUNTRY" && $USE_IWCONFIG -eq 0 ]]; then
 fi
 
 # Fallback to currently connected channel if the adapter can not transmit to the default channel (1)
+echo -e "[DEBUG] Initial channel check: WIFI_IFACE='${WIFI_IFACE}', CHANNEL='${CHANNEL}', FREQ_BAND='${FREQ_BAND}', USING_DEFAULT_CHANNEL='${USING_DEFAULT_CHANNEL}', WIFI_IFACE_CHANNEL='${WIFI_IFACE_CHANNEL}'" >&2
 if can_transmit_to_channel "${WIFI_IFACE}" "${CHANNEL}"; then
+    echo -e "[DEBUG] can_transmit_to_channel '${WIFI_IFACE}' '${CHANNEL}' (Freq: ${FREQ_BAND}GHz) succeeded." >&2
     echo "Transmitting to channel ${CHANNEL}..."
 else
+    echo -e "[DEBUG] can_transmit_to_channel '${WIFI_IFACE}' '${CHANNEL}' (Freq: ${FREQ_BAND}GHz) failed. Checking fallback conditions." >&2
+    echo -e "[DEBUG] Fallback check values: USING_DEFAULT_CHANNEL='${USING_DEFAULT_CHANNEL}', WIFI_IFACE_CHANNEL='${WIFI_IFACE_CHANNEL}', CHANNEL='${CHANNEL}', FREQ_BAND='${FREQ_BAND}'" >&2
+    echo -e "[DEBUG] Condition 1: USING_DEFAULT_CHANNEL -eq 1 -> $(($USING_DEFAULT_CHANNEL == 1))" >&2
+    echo -e "[DEBUG] Condition 2: WIFI_IFACE_CHANNEL -ne CHANNEL (${WIFI_IFACE_CHANNEL} != ${CHANNEL}) -> $(($WIFI_IFACE_CHANNEL != $CHANNEL))" >&2
     if [[ $USING_DEFAULT_CHANNEL -eq 1 && $WIFI_IFACE_CHANNEL -ne $CHANNEL ]]; then
-        echo -e "Your adapter can not transmit to channel ${CHANNEL}" >&2
+        echo -e "[DEBUG] Fallback condition met (USING_DEFAULT_CHANNEL=1 AND WIFI_IFACE_CHANNEL != CHANNEL)." >&2
+        echo -e "Your adapter can not transmit to channel ${CHANNEL} (Freq: ${FREQ_BAND}GHz)" >&2
         CHANNEL=$WIFI_IFACE_CHANNEL
+        echo -e "[DEBUG] Set CHANNEL to WIFI_IFACE_CHANNEL: '${CHANNEL}'" >&2
         echo -e "Falling back to channel ${CHANNEL}"
-        can_transmit_to_channel "${WIFI_IFACE}" "${CHANNEL}" || die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz."
+        echo -e "[DEBUG] Re-checking can_transmit_to_channel '${WIFI_IFACE}' '${CHANNEL}' (Freq: ${FREQ_BAND}GHz)..." >&2
+        if can_transmit_to_channel "${WIFI_IFACE}" "${CHANNEL}"; then
+            echo -e "[DEBUG] can_transmit_to_channel '${WIFI_IFACE}' '${CHANNEL}' (Freq: ${FREQ_BAND}GHz) succeeded after fallback." >&2
+        else
+            echo -e "[DEBUG] can_transmit_to_channel '${WIFI_IFACE}' '${CHANNEL}' (Freq: ${FREQ_BAND}GHz) FAILED even after fallback." >&2
+            die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz."
+        fi
     else
+        echo -e "[DEBUG] Fallback condition NOT met (USING_DEFAULT_CHANNEL != 1 OR WIFI_IFACE_CHANNEL == CHANNEL). Cannot proceed with initial channel ${CHANNEL}." >&2
         die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz."
     fi
 fi

also

$ sudo iw phy and $ sudo iwlist <wifi_interface> channel

Ill try to find the problem.

@JingMatrix
Copy link

The log after applying your patch:

Config dir: /tmp/create_ap.wlp0s20f3.conf.YFRtbqd8
PID: 47850
Network Manager found, set ap0 as unmanaged device... DONE
wlp0s20f3 is already associated with channel 9 (2452.0 MHz)
multiple channels supported
Creating a virtual WiFi interface... ap0 created.
[DEBUG] Initial channel check: WIFI_IFACE='ap0', CHANNEL='1', FREQ_BAND='2.4', USING_DEFAULT_CHANNEL='1', WIFI_IFACE_CHANNEL='9'
[DEBUG] can_transmit_to_channel 'ap0' '1' (Freq: 2.4GHz) succeeded.
Transmitting to channel 1...
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlp0s20f3.conf.YFRtbqd8/hostapd_ctrl
Failed to set beacon parameters
Interface initialization failed
ap0: interface state UNINITIALIZED->DISABLED
ap0: AP-DISABLED 
ap0: Unable to setup interface.
ap0: interface state DISABLED->DISABLED
ap0: AP-DISABLED 
ap0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface ap0 wasn't started
nl80211: deinit ifname=ap0 disabled_11b_rates=0

Error: Failed to run hostapd, maybe a program is interfering.
Low entropy detected, starting haveged
haveged: command socket is listening at fd 4
If an error like 'n80211: Could not configure driver mode' was thrown
try running the following before starting create_ap:
    nmcli r wifi off
    rfkill unblock wlan

Doing cleanup.. done

Output of iw phy is

Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 20
	max scan IEs length: 356 bytes
	max # sched scan SSIDs: 20
	max # match sets: 8
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports RSN-IBSS.
	Device supports AP-side u-APSD.
	Device supports T-DLS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP-128 (00-0f-ac:4)
		* GCMP-128 (00-0f-ac:8)
		* GCMP-256 (00-0f-ac:9)
		* CMAC (00-0f-ac:6)
		* GMAC-128 (00-0f-ac:11)
		* GMAC-256 (00-0f-ac:12)
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * P2P-client
		 * P2P-GO
		 * P2P-device
	Band 1:
		Capabilities: 0x19ef
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 7935 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT Max RX data rate: 300 Mbps
		HT TX/RX MCS rate indexes supported: 0-15
		HE Iftypes: managed, P2P-client
			HE MAC Capabilities (0x78019a30abc0):
				+HTC HE Supported
				Trigger Frame MAC Padding Duration: 2
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				32-bit BA Bitmap
				OM Control
				Maximum A-MPDU Length Exponent: 3
				RX Control Frame to MultiBSS
				A-MSDU in A-MPDU
				Multi-TID Aggregation TX: 7
				UL 2x996-Tone RU
			HE PHY Capabilities: (0x023f4e09fd098c160ffc01):
				HE40/2.4GHz
				Punctured Preamble RX: 15
				Device Class: 1
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				Full Bandwidth UL MU-MIMO
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				SU Beamformee
				Beamformee STS <= 80Mhz: 7
				Beamformee STS > 80Mhz: 7
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				Triggered SU Beamforming Feedback
				Triggered MU Beamforming Feedback
				PPE Threshold Present
				Power Boost Factor ar
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				Max NC: 2
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				20MHz in 40MHz HE PPDU 2.4GHz
				20MHz in 160/80+80MHz HE PPDU
				80MHz in 160/80+80MHz HE PPDU
				TX 1024-QAM
				RX 1024-QAM
				RX Full BW SU Using HE MU PPDU with Compression SIGB
				RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		HE Iftypes: AP, P2P-GO
			HE MAC Capabilities (0x70011a100000):
				+HTC HE Supported
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				OM Control
				Maximum A-MPDU Length Exponent: 3
			HE PHY Capabilities: (0x02200e090009800401c400):
				HE40/2.4GHz
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				PPE Threshold Present
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				TX 1024-QAM
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 2412.0 MHz [1] (22.0 dBm)
			* 2417.0 MHz [2] (22.0 dBm)
			* 2422.0 MHz [3] (22.0 dBm)
			* 2427.0 MHz [4] (22.0 dBm)
			* 2432.0 MHz [5] (22.0 dBm)
			* 2437.0 MHz [6] (22.0 dBm)
			* 2442.0 MHz [7] (22.0 dBm)
			* 2447.0 MHz [8] (22.0 dBm)
			* 2452.0 MHz [9] (22.0 dBm)
			* 2457.0 MHz [10] (22.0 dBm)
			* 2462.0 MHz [11] (22.0 dBm)
			* 2467.0 MHz [12] (22.0 dBm)
			* 2472.0 MHz [13] (22.0 dBm)
			* 2484.0 MHz [14] (disabled)
	Band 2:
		Capabilities: 0x19ef
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 7935 bytes
			DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 4 usec (0x05)
		HT Max RX data rate: 300 Mbps
		HT TX/RX MCS rate indexes supported: 0-15
		VHT Capabilities (0x039071f6):
			Max MPDU length: 11454
			Supported Channel Width: 160 MHz
			RX LDPC
			short GI (80 MHz)
			short GI (160/80+80 MHz)
			TX STBC
			SU Beamformee
			MU Beamformee
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 0 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 0 Mbps
		VHT extended NSS: supported
		HE Iftypes: managed, P2P-client
			HE MAC Capabilities (0x78018a30abc0):
				+HTC HE Supported
				Trigger Frame MAC Padding Duration: 2
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				32-bit BA Bitmap
				OM Control
				Maximum A-MPDU Length Exponent: 1
				RX Control Frame to MultiBSS
				A-MSDU in A-MPDU
				Multi-TID Aggregation TX: 7
				UL 2x996-Tone RU
			HE PHY Capabilities: (0x0c3f4e09fd098c160ffc01):
				HE40/HE80/5GHz
				HE160/5GHz
				Punctured Preamble RX: 15
				Device Class: 1
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				Full Bandwidth UL MU-MIMO
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				SU Beamformee
				Beamformee STS <= 80Mhz: 7
				Beamformee STS > 80Mhz: 7
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				Triggered SU Beamforming Feedback
				Triggered MU Beamforming Feedback
				PPE Threshold Present
				Power Boost Factor ar
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				Max NC: 2
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				20MHz in 40MHz HE PPDU 2.4GHz
				20MHz in 160/80+80MHz HE PPDU
				80MHz in 160/80+80MHz HE PPDU
				TX 1024-QAM
				RX 1024-QAM
				RX Full BW SU Using HE MU PPDU with Compression SIGB
				RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE RX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		HE Iftypes: AP, P2P-GO
			HE MAC Capabilities (0x70010a100000):
				+HTC HE Supported
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				OM Control
				Maximum A-MPDU Length Exponent: 1
			HE PHY Capabilities: (0x0c200e090009800401c400):
				HE40/HE80/5GHz
				HE160/5GHz
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				PPE Threshold Present
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				TX 1024-QAM
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE RX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5180.0 MHz [36] (22.0 dBm) (no IR)
			* 5200.0 MHz [40] (22.0 dBm) (no IR)
			* 5220.0 MHz [44] (22.0 dBm) (no IR)
			* 5240.0 MHz [48] (22.0 dBm) (no IR)
			* 5260.0 MHz [52] (22.0 dBm) (no IR, radar detection)
			* 5280.0 MHz [56] (22.0 dBm) (no IR, radar detection)
			* 5300.0 MHz [60] (22.0 dBm) (no IR, radar detection)
			* 5320.0 MHz [64] (22.0 dBm) (no IR, radar detection)
			* 5340.0 MHz [68] (disabled)
			* 5360.0 MHz [72] (disabled)
			* 5380.0 MHz [76] (disabled)
			* 5400.0 MHz [80] (disabled)
			* 5420.0 MHz [84] (disabled)
			* 5440.0 MHz [88] (disabled)
			* 5460.0 MHz [92] (disabled)
			* 5480.0 MHz [96] (disabled)
			* 5500.0 MHz [100] (22.0 dBm) (no IR, radar detection)
			* 5520.0 MHz [104] (22.0 dBm) (no IR, radar detection)
			* 5540.0 MHz [108] (22.0 dBm) (no IR, radar detection)
			* 5560.0 MHz [112] (22.0 dBm) (no IR, radar detection)
			* 5580.0 MHz [116] (22.0 dBm) (no IR, radar detection)
			* 5600.0 MHz [120] (22.0 dBm) (no IR, radar detection)
			* 5620.0 MHz [124] (22.0 dBm) (no IR, radar detection)
			* 5640.0 MHz [128] (22.0 dBm) (no IR, radar detection)
			* 5660.0 MHz [132] (22.0 dBm) (no IR, radar detection)
			* 5680.0 MHz [136] (22.0 dBm) (no IR, radar detection)
			* 5700.0 MHz [140] (22.0 dBm) (no IR, radar detection)
			* 5720.0 MHz [144] (disabled)
			* 5745.0 MHz [149] (22.0 dBm)
			* 5765.0 MHz [153] (22.0 dBm)
			* 5785.0 MHz [157] (22.0 dBm)
			* 5805.0 MHz [161] (22.0 dBm)
			* 5825.0 MHz [165] (22.0 dBm)
			* 5845.0 MHz [169] (22.0 dBm)
			* 5865.0 MHz [173] (22.0 dBm)
			* 5885.0 MHz [177] (disabled)
			* 5905.0 MHz [181] (disabled)
	Band 4:
		HE Iftypes: managed, P2P-client
			HE MAC Capabilities (0x78018a30abc0):
				+HTC HE Supported
				Trigger Frame MAC Padding Duration: 2
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				32-bit BA Bitmap
				OM Control
				Maximum A-MPDU Length Exponent: 1
				RX Control Frame to MultiBSS
				A-MSDU in A-MPDU
				Multi-TID Aggregation TX: 7
				UL 2x996-Tone RU
			HE PHY Capabilities: (0x0c3f4e09fd098c160ffc01):
				HE40/HE80/5GHz
				HE160/5GHz
				Punctured Preamble RX: 15
				Device Class: 1
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				Full Bandwidth UL MU-MIMO
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				SU Beamformee
				Beamformee STS <= 80Mhz: 7
				Beamformee STS > 80Mhz: 7
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				Triggered SU Beamforming Feedback
				Triggered MU Beamforming Feedback
				PPE Threshold Present
				Power Boost Factor ar
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				Max NC: 2
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				20MHz in 40MHz HE PPDU 2.4GHz
				20MHz in 160/80+80MHz HE PPDU
				80MHz in 160/80+80MHz HE PPDU
				TX 1024-QAM
				RX 1024-QAM
				RX Full BW SU Using HE MU PPDU with Compression SIGB
				RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE RX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		HE Iftypes: AP, P2P-GO
			HE MAC Capabilities (0x70010a100000):
				+HTC HE Supported
				Multi-TID Aggregation Support: 7
				Broadcast TWT
				OM Control
				Maximum A-MPDU Length Exponent: 1
			HE PHY Capabilities: (0x0c200e090009800401c400):
				HE40/HE80/5GHz
				HE160/5GHz
				LDPC Coding in Payload
				NDP with 4x HE-LTF and 3.2us GI
				STBC Tx <= 80MHz
				STBC Rx <= 80MHz
				DCM Max Constellation: 1
				DCM Max Constellation Rx: 1
				Sounding Dimensions <= 80Mhz: 1
				Sounding Dimensions > 80Mhz: 1
				PPE Threshold Present
				HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
				HE ER SU PPDU 4x HE-LTF 0.8us GI
				TX 1024-QAM
			HE RX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set <= 80 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE RX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			HE TX MCS and NSS set 160 MHz
				1 streams: MCS 0-11
				2 streams: MCS 0-11
				3 streams: not supported
				4 streams: not supported
				5 streams: not supported
				6 streams: not supported
				7 streams: not supported
				8 streams: not supported
			PPE Threshold 0x61 0x1c 0xc7 0x71 
		Bitrates (non-HT):
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
		Frequencies:
			* 5955.0 MHz [1] (22.0 dBm) (no IR)
			* 5975.0 MHz [5] (22.0 dBm) (no IR)
			* 5995.0 MHz [9] (22.0 dBm) (no IR)
			* 6015.0 MHz [13] (22.0 dBm) (no IR)
			* 6035.0 MHz [17] (22.0 dBm) (no IR)
			* 6055.0 MHz [21] (22.0 dBm) (no IR)
			* 6075.0 MHz [25] (22.0 dBm) (no IR)
			* 6095.0 MHz [29] (22.0 dBm) (no IR)
			* 6115.0 MHz [33] (22.0 dBm) (no IR)
			* 6135.0 MHz [37] (22.0 dBm) (no IR)
			* 6155.0 MHz [41] (22.0 dBm) (no IR)
			* 6175.0 MHz [45] (22.0 dBm) (no IR)
			* 6195.0 MHz [49] (22.0 dBm) (no IR)
			* 6215.0 MHz [53] (22.0 dBm) (no IR)
			* 6235.0 MHz [57] (22.0 dBm) (no IR)
			* 6255.0 MHz [61] (22.0 dBm) (no IR)
			* 6275.0 MHz [65] (22.0 dBm) (no IR)
			* 6295.0 MHz [69] (22.0 dBm) (no IR)
			* 6315.0 MHz [73] (22.0 dBm) (no IR)
			* 6335.0 MHz [77] (22.0 dBm) (no IR)
			* 6355.0 MHz [81] (22.0 dBm) (no IR)
			* 6375.0 MHz [85] (22.0 dBm) (no IR)
			* 6395.0 MHz [89] (22.0 dBm) (no IR)
			* 6415.0 MHz [93] (22.0 dBm) (no IR)
			* 6435.0 MHz [97] (disabled)
			* 6455.0 MHz [101] (disabled)
			* 6475.0 MHz [105] (disabled)
			* 6495.0 MHz [109] (disabled)
			* 6515.0 MHz [113] (disabled)
			* 6535.0 MHz [117] (disabled)
			* 6555.0 MHz [121] (disabled)
			* 6575.0 MHz [125] (disabled)
			* 6595.0 MHz [129] (disabled)
			* 6615.0 MHz [133] (disabled)
			* 6635.0 MHz [137] (disabled)
			* 6655.0 MHz [141] (disabled)
			* 6675.0 MHz [145] (disabled)
			* 6695.0 MHz [149] (disabled)
			* 6715.0 MHz [153] (disabled)
			* 6735.0 MHz [157] (disabled)
			* 6755.0 MHz [161] (disabled)
			* 6775.0 MHz [165] (disabled)
			* 6795.0 MHz [169] (disabled)
			* 6815.0 MHz [173] (disabled)
			* 6835.0 MHz [177] (disabled)
			* 6855.0 MHz [181] (disabled)
			* 6875.0 MHz [185] (disabled)
			* 6895.0 MHz [189] (disabled)
			* 6915.0 MHz [193] (disabled)
			* 6935.0 MHz [197] (disabled)
			* 6955.0 MHz [201] (disabled)
			* 6975.0 MHz [205] (disabled)
			* 6995.0 MHz [209] (disabled)
			* 7015.0 MHz [213] (disabled)
			* 7035.0 MHz [217] (disabled)
			* 7055.0 MHz [221] (disabled)
			* 7075.0 MHz [225] (disabled)
			* 7095.0 MHz [229] (disabled)
			* 7115.0 MHz [233] (disabled)
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * new_station
		 * new_mpath
		 * set_mesh_config
		 * set_bss
		 * authenticate
		 * associate
		 * deauthenticate
		 * disassociate
		 * join_ibss
		 * join_mesh
		 * remain_on_channel
		 * set_tx_bitrate_mask
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * tdls_mgmt
		 * tdls_oper
		 * start_sched_scan
		 * probe_client
		 * set_noack_map
		 * register_beacons
		 * start_p2p_device
		 * set_mcast_rate
		 * connect
		 * disconnect
		 * channel_switch
		 * set_qos_map
		 * add_tx_ts
		 * set_multicast_to_unicast
		 * Unknown command (156)
	WoWLAN support:
		 * wake up on disconnect
		 * wake up on magic packet
		 * wake up on pattern match, up to 20 patterns of 16-128 bytes,
		   maximum packet offset 0 bytes
		 * can do GTK rekeying
		 * wake up on GTK rekey failure
		 * wake up on EAP identity request
		 * wake up on 4-way handshake
		 * wake up on rfkill release
		 * wake up on network detection, up to 8 match sets
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	valid interface combinations:
		 * #{ managed } <= 1, #{ P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
		   total <= 3, #channels <= 2
		 * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
		   total <= 3, #channels <= 1
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	Device supports TX status socket option.
	Device supports HT-IBSS.
	Device supports SAE with AUTHENTICATE command
	Device supports low priority scan.
	Device supports scan flush.
	Device supports per-vif TX power setting
	P2P GO supports CT window setting
	P2P GO supports opportunistic powersave setting
	Driver supports full state transitions for AP/GO clients
	Driver supports a userspace MPM
	Driver/device bandwidth changes during BSS lifetime (AP/GO mode)
	Device adds DS IE to probe requests
	Device can update TPC Report IE
	Device supports static SMPS
	Device supports dynamic SMPS
	Device supports WMM-AC admission (TSPECs)
	Device supports configuring vdev MAC-addr on create.
	Device supports randomizing MAC-addr in scans.
	Device supports randomizing MAC-addr in sched scans.
	Device supports randomizing MAC-addr in net-detect scans.
	max # scan plans: 2
	max scan plan interval: 65535
	max scan plan iterations: 254
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0x40 0xb0 0xc0 0xd0
		 * managed: 0x40 0xb0 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * mesh point: 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-device: 0x40 0xb0 0xd0
	Supported extended features:
		* [ VHT_IBSS ]: VHT-IBSS
		* [ RRM ]: RRM
		* [ MU_MIMO_AIR_SNIFFER ]: MU-MIMO sniffer
		* [ SCAN_START_TIME ]: scan start timestamp
		* [ BSS_PARENT_TSF ]: BSS last beacon/probe TSF
		* [ BEACON_RATE_LEGACY ]: legacy beacon rate setting
		* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
		* [ FILS_MAX_CHANNEL_TIME ]: FILS max channel attribute override with dwell time
		* [ ACCEPT_BCAST_PROBE_RESP ]: accepts broadcast probe response
		* [ OCE_PROBE_REQ_HIGH_TX_RATE ]: probe request TX at high rate (at least 5.5Mbps)
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ PROTECTED_TWT ]: protected Target Wake Time (TWT) support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ BEACON_PROTECTION_CLIENT ]: beacon prot. for clients support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
		* [ PROT_RANGE_NEGO_AND_MEASURE ]: support for MFP in range measurement negotiation/procedure
		* [ POWERED_ADDR_CHANGE ]: can change MAC address while up
		* [ DFS_CONCURRENT ]: DFS channel use under concurrent DFS master
		* [ SPP_AMSDU_SUPPORT ]: SPP A-MSDU support

Result of iwlist wlp0s20f3 channel is

wlp0s20f3  32 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Channel 36 : 5.18 GHz
          Channel 40 : 5.2 GHz
          Channel 44 : 5.22 GHz
          Channel 48 : 5.24 GHz
          Channel 52 : 5.26 GHz
          Channel 56 : 5.28 GHz
          Channel 60 : 5.3 GHz
          Channel 64 : 5.32 GHz
          Channel 100 : 5.5 GHz
          Channel 104 : 5.52 GHz
          Channel 108 : 5.54 GHz
          Channel 112 : 5.56 GHz
          Channel 116 : 5.58 GHz
          Channel 120 : 5.6 GHz
          Channel 124 : 5.62 GHz
          Channel 128 : 5.64 GHz
          Channel 132 : 5.66 GHz
          Channel 136 : 5.68 GHz
          Channel 140 : 5.7 GHz
          Current Frequency:2.452 GHz (Channel 9)

@lakinduakash
Copy link
Owner

lakinduakash commented Jul 19, 2025

So probably I need to revert, I didn't have a device to test 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.

Hotspot fails with unhelpful message when wifi card only supports AP on the same channel
3 participants