Scanning for networks while in access point mode

Hi I’m trying to build scripts on the TX1 so the device starts as an access point, provides a GUI to list available Wifi networks, user selects a network and it leaves AP mode and connects to Wifi. I’m running into a few problems if someone can shed some light on possible solutions.

  1. While in AP mode (op_mode 2) if I run $ sudo iwlist wlan0 scan it says the network adapter does not support scanning. This does work with op_mode 0. How can I scan while in AP mode?

  2. I wrote a bash script following these instructions to create an AP: https://devtalk.nvidia.com/default/topic/910608/jetson-tx1/setting-up-wifi-access-point-on-tx1/post/4902927/#4902927 but I’m having trouble swapping back to Wifi. I know the settings are being cleared. What’s the best way to restart networking after you’ve made changes to /etc/network/interfaces?

Thanks!

I haven’t experimented with the wifi, but depending on what software is present, this might do the job:

sudo service networking restart
# (see also "service networking status")

I also cannot scan in AP mode:

iw dev wlan0 scan

command failed: Invalid argument (-22)

iwlist wlan0 scan

wlan0 Interface doesn’t support scanning : Invalid argument

kernel log shows these errors:

Feb 23 23:57:48 orbitty kernel: [85260.642719] CFG80211-ERROR) __wl_cfg80211_scan : Invalid Scan Command at SoftAP mode
Feb 23 23:57:48 orbitty kernel: [85260.642788] CFG80211-ERROR) wl_cfg80211_scan : scan error (-22)

  1. Is Scanning supported in AP mode? Is it a bug? Any special kernel config options for bc wifi driver?

  2. Is automatic channel selection supported? Like setting channel=0 in hostapd config?

here is my iw list:

# iw list
Wiphy phy0
        Band 1:
                Capabilities: 0x1020
                        HT20
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT RX MCS rate indexes supported: 0-7
                HT TX MCS rate indexes are undefined
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                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
        Band 2:
                Capabilities: 0x1020
                        HT20
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT RX MCS rate indexes supported: 0-7
                HT TX MCS rate indexes are undefined
                Frequencies:
                        * 5180 MHz [36] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5240 MHz [48] (20.0 dBm)
                        * 5260 MHz [52] (20.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (20.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (20.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (20.0 dBm) (passive scanning, no IBSS, radar detection)
                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
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        Coverage class: 0 (up to 0m)
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * CMAC (00-0f-ac:6)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * Unknown mode (10)
        software interface modes (can always be added):
        valid interface combinations:
                 * #{ AP } <= 1, #{ managed } <= 2, #{ P2P-client, P2P-GO } <= 2, #{ Unknown mode (10) } <= 1, #{ IBSS } <= 1,
                   total <= 4, #channels <= 2
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * new_beacon
                 * set_bss
                 * join_ibss
                 * set_pmksa
                 * del_pmksa
                 * flush_pmksa
                 * remain_on_channel
                 * action
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * Unknown command (82)
                 * Unknown command (81)
                 * Unknown command (75)
                 * Unknown command (89)
                 * 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
                 * 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
                 * Unknown mode (10): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * Unknown mode (10): 0x40 0xd0
        WoWLAN support:
                 * wake up on anything (device continues operating normally)

Hi DmitriK,

  1. We don’t support scanning in AP mode
  2. Valid channel can be selected from config file. If channel is not specified then a channel will be picked up by WiFi FW.

Re: If channel is not specified then a channel will be picked up by WiFi FW.

Randomly?

No, it would pick a fixed one.