oblique / create_ap

[NOT MAINTAINED] This script creates a NATed or Bridged WiFi Access Point.
BSD 2-Clause "Simplified" License
4.45k stars 1k forks source link

ERROR: Your adapter can not transmit to channel 149, frequency band 5GHz. #107

Closed elegracer closed 9 years ago

elegracer commented 9 years ago

I'm using Archlinux, and I installed create_ap with yaourt -S create_ap.

Also manually installed those dependencies. When I tried to set up a wireless access point from my Ethernet, I got the result:

$ sudo create_ap wlp3s0 enp4s0f2 Soaph huangkaishabi
[sudo] hk 的密码:
Config dir: /tmp/create_ap.wlp3s0.conf.TE9xj8nH
PID: 13053
Warning: nmcli (1.0.6) and NetworkManager (1.0.4) versions don't match. Use --nocheck to suppress the warning.
Network Manager found, set ap0 as unmanaged device... DONE
wlp3s0 is already associated with channel 149 (5745 MHz), fallback to channel 149
Creating a virtual WiFi interface... Warning: nmcli (1.0.6) and NetworkManager (1.0.4) versions don't match. Use --nocheck to suppress the warning.
Warning: nmcli (1.0.6) and NetworkManager (1.0.4) versions don't match. Use --nocheck to suppress the warning.
Warning: nmcli (1.0.6) and NetworkManager (1.0.4) versions don't match. Use --nocheck to suppress the warning.
Warning: nmcli (1.0.6) and NetworkManager (1.0.4) versions don't match. Use --nocheck to suppress the warning.
ap0 created.

ERROR: Your adapter can not transmit to channel 149, frequency band 5GHz.

Doing cleanup.. done

Even if I add --freq-band 2.4 will I get the same output.

How should I get this successful? Thanks!

elegracer commented 9 years ago

Here is my iw list output:

Wiphy phy0
        max # scan SSIDs: 20
        max scan IEs length: 425 bytes
        max # sched scan SSIDs: 20
        max # match sets: 11
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Device supports AP-side u-APSD.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * 00-0f-ac:10
                * GCMP (00-0f-ac:8)
                * 00-0f-ac:9
                * CMAC (00-0f-ac:6)
                * 00-0f-ac:13
                * 00-0f-ac:11
                * 00-0f-ac:12
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x11e2
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 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
                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 MHz [1] (22.0 dBm)
                        * 2417 MHz [2] (22.0 dBm)
                        * 2422 MHz [3] (22.0 dBm)
                        * 2427 MHz [4] (22.0 dBm)
                        * 2432 MHz [5] (22.0 dBm)
                        * 2437 MHz [6] (22.0 dBm)
                        * 2442 MHz [7] (22.0 dBm)
                        * 2447 MHz [8] (22.0 dBm)
                        * 2452 MHz [9] (22.0 dBm)
                        * 2457 MHz [10] (22.0 dBm)
                        * 2462 MHz [11] (22.0 dBm)
                        * 2467 MHz [12] (22.0 dBm) (no IR)
                        * 2472 MHz [13] (22.0 dBm) (no IR)
        Band 2:
                Capabilities: 0x11e2
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 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 (0x038071a0):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        TX STBC
                        SU 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
                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 MHz [36] (22.0 dBm) (no IR)
                        * 5200 MHz [40] (22.0 dBm) (no IR)
                        * 5220 MHz [44] (22.0 dBm) (no IR)
                        * 5240 MHz [48] (22.0 dBm) (no IR)
                        * 5260 MHz [52] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5280 MHz [56] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5300 MHz [60] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5320 MHz [64] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5500 MHz [100] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5520 MHz [104] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5540 MHz [108] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5560 MHz [112] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5580 MHz [116] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5600 MHz [120] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5620 MHz [124] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5640 MHz [128] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5660 MHz [132] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5680 MHz [136] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5700 MHz [140] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5720 MHz [144] (22.0 dBm) (no IR, radar detection)
                          DFS state: usable (for 1434183 sec)
                          DFS CAC time: 0 ms
                        * 5745 MHz [149] (22.0 dBm) (no IR)
                        * 5765 MHz [153] (22.0 dBm) (no IR)
                        * 5785 MHz [157] (22.0 dBm) (no IR)
                        * 5805 MHz [161] (22.0 dBm) (no IR)
                        * 5825 MHz [165] (22.0 dBm) (no IR)
        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
                 * set_wds_peer
                 * start_sched_scan
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * channel_switch
                 * set_qos_map
                 * add_tx_ts
                 * connect
                 * disconnect
        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 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 0xd0
        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 11 match sets
                 * wake up on TCP connection
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
                   total <= 3, #channels <= 2
        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 a userspace MPM
        Device supports static SMPS
        Device supports dynamic SMPS
        Device supports WMM-AC admission (TSPECs)
        Device supports configuring vdev MAC-addr on create.
oblique commented 9 years ago
wlp3s0 is already associated with channel 149 (5745 MHz), fallback to channel 149

Most of wifi adapters can only use one channel. So, if they are connected to an AP then create_ap can only create an AP on that channel. You are connected to a 5GHz channel but your adapter does not support trasmition on that channels.

        valid interface combinations:
                 * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
                   total <= 3, #channels <= 2

Probably your adapter can have two different channels, edit create_ap and remove line CHANNEL=$WIFI_IFACE_CHANNEL (now is at 1425 line). After that try again and tell me if it works or not.

elegracer commented 9 years ago

Thanks, I will have a try and tell you if it works or not. :)

elegracer commented 9 years ago

Well, still not working. This time, the output becomes like this.

$ sudo create_ap wlp3s0 enp4s0f2 Soaph huangkaishabi
Config dir: /tmp/create_ap.wlp3s0.conf.GGPcxFs4
PID: 1528
Network Manager found, set ap0 as unmanaged device... DONE
wlp3s0 is already associated with channel 149 (5745 MHz), fallback to channel 149
Creating a virtual WiFi interface... ap0 created.

ERROR: Your adapter can not transmit to channel 1, frequency band 5GHz.

Doing cleanup.. done
oblique commented 9 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}
elegracer commented 9 years ago

Unfortunately, not working... T_T

$ sudo create_ap wlp3s0 enp4s0f2 Soaph huangkaishabi
Config dir: /tmp/create_ap.wlp3s0.conf.PwcIDDGU
PID: 29058
Network Manager found, set ap0 as unmanaged device... DONE
Creating a virtual WiFi interface... ap0 created.
RTNETLINK answers: Device or resource busy

ERROR: Maybe your WiFi adapter does not fully support virtual interfaces.
       Try again with --no-virt.

Doing cleanup.. done
oblique commented 9 years ago

Ok thanks. I'm closing the issue since it's not a bug. To workarround this you can do one of the following:

elegracer commented 9 years ago

However, in windows, I could easily create a AP with a tool, maybe it's the settings issue.

oblique commented 9 years ago

You can still create AP with your adapter, but you can not use 5ghz frequency. Because you are connected an AP then you can only transmit to the frequency your are already connected. If you connect to another AP that uses 2.4ghz or get your Internet access from another interface (ethernet or another wifi adapter) then you will not have any problem.

oblique commented 9 years ago

BTW, if on Windows you can create 5ghz AP, then it's a driver limitation in Linux. Your iw list reports that you can only transmit on 2.4ghz. So, to bypass this limitation you can edit the driver code in the kernel.

elegracer commented 9 years ago

Thank you so much, you helped me find the way to fix this problem! :)

oblique commented 9 years ago

No problem :)

parkerlreed commented 7 years ago

@oblique FWIW those two edits (CHANNEL line removal and is_wifi_connected) actually worked for mine! I am connected to a 5GHz network as the Internet connection and broadcasting on 2.4. Thanks for the tips!

ghost commented 6 years ago

Those two edits also fixed the same issue for me. Shouldn't this be implemented by default or something?

rapidrex commented 6 years ago

I know this is an old thread but I wanted to say this worked for me too! One thing I will add for future readers... You need to run make again to build the create_ap after you make the edits. I don't think that was mentioned here. Might be obvious but I know some may try this without knowledge of what you are actually doing.

parkerlreed commented 6 years ago

@rapidrex I just edited the script directly last time. You probably edited in the build directory and the Makefile just copies to /usr/bin. You can edit directly in /usr/bin if desired.

lumos42 commented 6 years ago

Yep.. worked for me too!

2m commented 6 years ago

These two changes worked for me as well.

miroslav-slobodnik commented 6 years ago

Works for me after two mentioned changes.

phdsky commented 5 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

This worked for me. Thanks to oblique!

deng-xi commented 5 years ago

unfortunatelly, it doesn't work for me

deng-xi commented 5 years ago

I resolved my problem by using the command "sudo create_ap wlp3s0 wlp3s0 ssid password &" , and my drive supports software AP, you can reference this article https://bbs.deepin.org/forum.php?mod=viewthread&tid=45024

3v1n0 commented 5 years ago

I was facing this too, so using https://github.com/oblique/create_ap/issues/107#issuecomment-140786781 and https://github.com/oblique/create_ap/issues/107#issuecomment-140064666 worked.

However, maybe this could be just fixed properly by making create_ap to honor --freq-band parameter? So that if 2.4 is used to repeat a 5Ghz network it just works?

zintown commented 5 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

This worked for me. Thanks to oblique!

Could you please tell me where the function is? I can't find it

GitHub30 commented 5 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

Thanks. It works

dyang-7 commented 5 years ago

(no IR) sudo iw reg set NZ

jqtruong commented 5 years ago

been getting this error and not knowing much about how it all works, i tried a few things to get passed this error, albeit a different channel value.

steps to fix was disconnecting the adapter from the network, then try the create_ap command again. That said, i also deleted the previously-created-and-failed ap0 virtual interface with iw dev ap0 del and the /tmp/create_ap.* files; not sure if that was necessary... And then reconnected to a wifi network.

qdm12 commented 5 years ago

Hi all!

Sorry I'm a wifi AP newbie here; My machine is connected through Ethernet and I would like to broadcast using its Wifi chip/antennas using the 5GHz frequency band. It works on 2.4GHz but I get the following error when trying on 5GHz (with other 5GHz channels too):

ERROR: Your adapter can not transmit to channel 36, frequency band 5GHz.

Where can I find if my Wifi device actually supports AP mode in 5GHz in the output from iw list?

I have attached the output of iw list.

Thanks!

EDIT: Answering my own question

If you have 5xxxMHz listed as another frequency band from iw list this means you can potentially broadcast in 5GHz. If you see the (no IR), this means it cannot be used for regulatory reasons. In my case, my driver was not set to a particular country so all the 5GHz channels were blocked.

I had to do this to change it to Canada CA:

echo "WIRELESS_REGDOM=\"CA\"" > /etc/conf.d/wireless-regdom
echo "options cfg80211 ieee80211_regdom=CA" > /etc/modprobe.d/cfg80211.conf
cat > /etc/systemd/system/set_crda_country.service <<EOL
[Unit]
Description=Sets country for CRDA
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/sbin/iw reg set CA
StandardOutput=tty

[Install]
WantedBy=network-pre.target
EOL
chmod +x /etc/systemd/system/set_crda_country.service
systemctl enable set_crda_country.service
systemctl daemon-reload
systemctl start set_crda_country.service

Check if the no IR disappeared with iw list. If it did not, then reboot the machine and it should do it at boot before the network is up. Now I can broadcast in 5GHz 😄 Cheers !

parkerlreed commented 5 years ago

@qdm12 What OS are you using? Arch at least has a crda package where you only have to uncomment a line in /etc/conf.d and reboot the machine.

qdm12 commented 5 years ago

Oh good to know! I'm indeed using Arch, I probably also installed crda as well. Anyway, it works now hopefully it can help a fellow user!

langyxxl commented 5 years ago

Works for me after two mentioned changes. my laptop is ThinkPad E470c with 05:00.0 Network controller: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 31)

archie9211 commented 4 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

This worked for me. Thanks to oblique!

Could you please tell me where the function is? I can't find it

you need to edit /usr/bin/create_ap file.

worked for me too.

rifaimartin commented 4 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

solved, thanks

Chrunchbang commented 4 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

it worked for me too, thanks oblique!

jaypatel149 commented 4 years ago

[sudo] password for naguruul: SSID: k Passphrase: Retype passphrase: Config dir: /tmp/create_ap.wlp2s0.conf.Wf27BTOr PID: 19602 Network Manager found, set ap0 as unmanaged device... DONE wlp2s0 is already associated with channel 13 (2472 MHz), fallback to channel 13 Creating a virtual WiFi interface... ap0 created.

ERROR: Your adapter can not transmit to channel 13, frequency band 2.4GHz.

Doing cleanup.. done

abhyamgupta123 commented 4 years ago

in my case i was able to solve the problem by first switching off the wifi connection at first and then created the AP through command line. after that i again tried to connect to wifi network , which i got connected successfully. So i would probably say that first try to disconnect your system from connected wifi network , after that try to make AP and after that connect to wifi network.

Hope this may help.

razvanursu commented 4 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

Worked for me too, thanks!

ghost commented 3 years ago

Find the function is_wifi_connected and replace it with:

is_wifi_connected() {
    return 1
}

This worked for me (in combination with the previous modification)!!! I'm successfully using my laptop to extend a 5ghz hotspot over 2.4ghz :smile:

So clearly there is room for improvement. Can this issue please be re-opened?? Edit: oh this project is unmaintained :frowning_face: