lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.01k stars 278 forks source link

"ERROR: Your adapter can not transmit to channel..." because output of `iw phy ... info` probably changed recently #368

Closed whxvd closed 6 months ago

whxvd commented 6 months ago

I am on a recent Arch Linux system. create_ap recently stopped working. It terminated with the message "ERROR: Your adapter can not transmit to channel 1, frequency band 2.4GHz."

After some investigation, the problem seems to be that the parsing of the output of iw phy ... info in can_transmit_to_channel does not work anymore. The output of iw phy ... info on my system includes:

Frequencies:
    * 2412.0 MHz [1] (20.0 dBm)
    * 2417.0 MHz [2] (20.0 dBm)
    * 2422.0 MHz [3] (20.0 dBm)
    * 2427.0 MHz [4] (20.0 dBm)
    * 2432.0 MHz [5] (20.0 dBm)
    * 2437.0 MHz [6] (20.0 dBm)
    * 2442.0 MHz [7] (20.0 dBm)
    * 2447.0 MHz [8] (20.0 dBm)
    * 2452.0 MHz [9] (20.0 dBm)
    * 2457.0 MHz [10] (20.0 dBm)
    * 2462.0 MHz [11] (20.0 dBm)
    * 2467.0 MHz [12] (20.0 dBm)
    * 2472.0 MHz [13] (20.0 dBm)
    * 2484.0 MHz [14] (disabled)

The .0 in the frequencies probably is new, and cannot be recognized by the

grep " 24[0-9][0-9] MHz \[${CHANNEL_NUM}\]"

in can_transmit_to_channel. When I change that to

grep " 24[0-9][0-9]\(\.[0-9]\)\? MHz \[${CHANNEL_NUM}\]"

everything works again. But I am not 100% sure that the grep regex syntax introduced by that is 100% correct, or whether it is the best possible way to match.

joanbm commented 6 months ago

It is related to the iw 6.7 update and should be fixed by #367

SalaheddineS commented 6 months ago

It is related to the iw 6.7 update and should be fixed by #367

Hey joanbm , the issue is still persistent in my case

lakinduakash commented 6 months ago

I merged #367 . Can yo please check now?

whxvd commented 6 months ago

Hi @lakinduakash,

I merged #367 . Can yo please check now?

I tested the current master branch, and it works on my end with my use-case. Thank you!