AP mode of Linux

Hi,

I’m trying to run my Eragon 410c in AP mode with no success. About Eragon 410c, it runs on the same SoC as Dragonboard 410C.
I’m trying with hostapd and dnsmasq. Hostapd works fine at some level but it is not able to create AP, it hangs while executing, no AP is generated.
I’m using http://www.96boards.org/forums/topic/ap-mode-on-linux/ as refernce.
NOTE: I have to stop network-manager and wpa_supplicant services to work with hostapd so far otherwise hostapd stops with following error:

wcn36xx: ERROR Timeout! No SMD response in 500ms
wcn36xx: ERROR Failed to push NV to chip

So I took reference from https://github.com/lwfinger/rtlwifi_new/issues/16 link.

Following is my current output of hostapd execution after stopping network-manager and wpa_supplicant service:

root@linaro-developer:~# hostapd -dd /etc/hostapd/hostapd.conf 
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supports Probe Response offload in AP mode
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 4 iftype 3 (AP)
nl80211: Failed to set interface 4 to mode 3: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 4 iftype 3 (AP)
nl80211: Mode change succeeded while interface is down
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x558945cd80
nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0x0 (WLAN_FC_STYPE_ASSOC_REQ) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0x20 (WLAN_FC_STYPE_REASSOC_REQ) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0xa0 (WLAN_FC_STYPE_DISASSOC) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0xc0 (WLAN_FC_STYPE_DEAUTH) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x558945cd80 match=
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x558945cd80 match=
nl80211: Add own interface ifindex 4
nl80211: if_indices[16]: 4
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 40 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 40 MHz 20 mBm (no IR)
nl80211: 5735-5835 @ 40 MHz 20 mBm (no IR)
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
hw vht capab: 0x0, conf vht capab: 0x0
Completing interface initialization
Mode: IEEE 802.11g  Channel: 10  Frequency: 2457 MHz
DFS 0 channels required radar detection
nl80211: Set freq2457 (ht_enabled=1, vht_enabled=0, bandwidth=20 MHz, cf1=2457 MHz, cf2=0 MHz)
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x558945d6f0 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
wlan0: Deauthenticate all stations
nl80211: send_mlme - da= ff:ff:ff:ff:ff:ff noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0xc0 (WLAN_FC_STYPE_DEAUTH) nlmode=3
nl80211: send_mlme -> send_frame
nl80211: send_frame - Use bss->freq=2457
nl80211: send_frame -> send_frame_cmd
nl80211: CMD_FRAME freq=2457 wait=0 no_cck=0 no_ack=0 offchanok=0
CMD_FRAME - hexdump(len=26): c0 00 00 00 ff ff ff ff ff ff 02 00 28 30 c2 2e 02 00 28 30 c2 2e 00 00 02 00
nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2457 wait=0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 02:00:28:30:c2:2e and ssid "Test"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=4):
     54 65 73 74                                       Test            
PSK (ASCII passphrase) - hexdump_ascii(len=10): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Got 0/20 bytes from /dev/random
random: Only 0/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=55): 80 00 00 00 ff ff ff ff ff ff 02 00 28 30 c2 2e 02 00 28 30 c2 2e 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 04 54 65 73 74 01 08 82 84 8b 96 0c 12 18 24 03 01 0a
nl80211: Beacon tail - hexdump(len=119): 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 2d 1a 0c 00 1f ff 00 00 00 00 00 00 00 00 00 48 00 01 00 00 00 00 00 00 0
nl80211: ifindex=4
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=4):
     54 65 73 74                                       Test            
nl80211: proberesp (offload) - hexdump(len=174): 50 00 00 00 00 00 00 00 00 00 02 00 28 30 c2 2e 02 00 28 30 c2 2e 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 04 54 65 73 74 01 08 82 84 8b 96 0c 12 18 24 00
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x3
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x10
nl80211: group_cipher=0x10
nl80211: beacon_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
nl80211: proberesp_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
nl80211: assocresp_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=4 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: Setup of interface done.
ctrl_iface not configured!
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Ignore interface down event since interface wlan0 is up
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=2 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=2 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=2 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randoness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=2 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x5584578ab8 key_idx=2 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key

This is where it stops and hangs.
Following log is kernel’s ring buffer.

[  644.078475] wcn36xx: firmware WLAN version 'WCN v2.0 RadioPhy vRhea_GF_1.12 with 19.2MHz XO' and CRM version 'CNSS-PR-2-0-1-2-c1-00010'
[  644.078501] wcn36xx: firmware API 1.5.1.2, 41 stations, 2 bssids
[  644.081684] wcn36xx: FW Cap MCC
[  644.081699] wcn36xx: FW Cap P2P
[  644.081710] wcn36xx: FW Cap SLM_SESSIONIZATION
[  644.081722] wcn36xx: FW Cap DOT11AC_OPMODE
[  644.081733] wcn36xx: FW Cap SAP32STA
[  644.081744] wcn36xx: FW Cap TDLS
[  644.081755] wcn36xx: FW Cap P2P_GO_NOA_DECOUPLE_INIT_SCAN
[  644.081767] wcn36xx: FW Cap WLANACTIVE_OFFLOAD
[  644.081777] wcn36xx: FW Cap BEACON_OFFLOAD
[  644.081789] wcn36xx: FW Cap SCAN_OFFLOAD
[  644.081800] wcn36xx: FW Cap BCN_MISS_OFFLOAD
[  644.081811] wcn36xx: FW Cap STA_POWERSAVE
[  644.081821] wcn36xx: FW Cap STA_ADVANCED_PWRSAVE
[  644.081833] wcn36xx: FW Cap BCN_FILTER
[  644.081844] wcn36xx: FW Cap RTT
[  644.081855] wcn36xx: FW Cap RATECTRL
[  644.081866] wcn36xx: FW Cap WOW
[  644.081877] wcn36xx: FW Cap WLAN_ROAM_SCAN_OFFLOAD
[  644.081888] wcn36xx: FW Cap SPECULATIVE_PS_POLL
[  644.081899] wcn36xx: FW Cap IBSS_HEARTBEAT_OFFLOAD
[  644.081911] wcn36xx: FW Cap WLAN_SCAN_OFFLOAD
[  644.081922] wcn36xx: FW Cap WLAN_PERIODIC_TX_PTRN
[  644.081933] wcn36xx: FW Cap ADVANCE_TDLS
[  644.081943] wcn36xx: FW Cap BATCH_SCAN
[  644.081954] wcn36xx: FW Cap FW_IN_TX_PATH
[  644.081966] wcn36xx: FW Cap EXTENDED_NSOFFLOAD_SLOT
[  644.081976] wcn36xx: FW Cap CH_SWITCH_V1
[  644.081988] wcn36xx: FW Cap HT40_OBSS_SCAN
[  644.081999] wcn36xx: FW Cap UPDATE_CHANNEL_LIST
[  644.082010] wcn36xx: FW Cap UNKNOWN
[  644.082020] wcn36xx: FW Cap UNKNOWN
[  644.082031] wcn36xx: FW Cap UNKNOWN
[  644.082042] wcn36xx: FW Cap UNKNOWN
[  644.082052] wcn36xx: FW Cap UNKNOWN
[  644.082063] wcn36xx: FW Cap UNKNOWN
[  644.082074] wcn36xx: FW Cap UNKNOWN
[  644.082085] wcn36xx: FW Cap UNKNOWN
[  644.082095] wcn36xx: FW Cap UNKNOWN
[  644.082106] wcn36xx: FW Cap UNKNOWN
[  644.094519] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  644.545988] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1355.350197] qcom-tz-pil soc:pronto_rproc: fatal error received: halMsg.c:4860:halMsg_DelBss: Invalid BSSIndex 0
[ 1355.350325]  remoteproc0: crash detected in soc:pronto_rproc: type fatal error
[ 1355.365637]  remoteproc0: handling crash #1 in soc:pronto_rproc
[ 1355.366457]  remoteproc0: recovering soc:pronto_rproc

Thanks in advance.
JJ

Hello,

You can enable WiFi AP using hostapd. But you need to set up DHCP server to allow AP to assign IP address.

Install DHCP server using below command and configure dhcpd.config.
sudo apt-get -y install iw hostapd isc-dhcp-server

after installation and configuration, run below script.

SCRIPT THAT STARTS HOTSPOT MODE

Wait until wlan interface shows up

MYWLAN=""
while [ “$MYWLAN” == “” ]
do
echo -n “Waiting for wlan.txt”
date
sleep 2
MYWLAN=ifconfig | grep ^wlan | cut -d ’ ’ -f 1
done

cd /etc/default
sed -i -r “s/INTERFACES=.*$/INTERFACES=”$MYWLAN"/" isc-dhcp-server

cd /etc/hostapd
cat > hostapd.conf << EOF
interface=$MYWLAN
driver=nl80211
ssid=My410C
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=MySecretPassword

EOF

cd /etc/default
cat > hostapd << EOF
DAEMON_CONF="/etc/hostapd/hostapd.conf"
EOF

sudo service NetworkManager stop
sudo ifconfig $MYWLAN 192.168.1.69
sudo service isc-dhcp-server start
sudo hostapd -dd /etc/hostapd/hostapd.conf &

I followed above procedure and able to see SSID in my mobile. Below is console log from my eragon board.

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supports Probe Response offload in AP mode
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 4 iftype 3 (AP)
nl80211: Failed to set interface 4 to mode 3: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 4 iftype 3 (AP)
nl80211: Mode change succeeded while interface is down
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x27acf7b0
nl80211: Register frame type=0xb0 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0x0 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0x20 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0xa0 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0xc0 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0xd0 nl_handle=0x27acf7b0 match=
nl80211: Register frame type=0x40 nl_handle=0x27acf7b0 match=
nl80211: Add own interface ifindex 4
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 40 MHz 20 mBm
nl80211: 2474-2494 @ 20 MHz 20 mBm
nl80211: 5170-5250 @ 40 MHz 20 mBm
nl80211: 5735-5835 @ 40 MHz 20 mBm
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_txpower=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
Completing interface initialization
Mode: IEEE 802.11g Channel: 1 Frequency: 2412 MHz
DFS 0 channels required radar detection
nl80211: Set freq 2412 (ht_enabled=0, vht_enabled=0, bandwidth=20 MHz, cf1=2412 MHz, cf2=0 MHz)
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x27ad00d0 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
wlan0: Deauthenticate all stations
nl80211: send_mlme - noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0xc0 nlmode=3
nl80211: send_mlme -> send_frame
nl80211: send_frame - Use bss->freq=2412
nl80211: send_frame -> send_frame_cmd
nl80211: CMD_FRAME freq=2412 wait=0 no_cck=0 no_ack=0 offchanok=0
CMD_FRAME - hexdump(len=26): c0 00 00 00 ff ff ff ff ff ff 02 00 ac 87 b5 ff 02 00 ac 87 b5 ff 00 00 02 00
nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2412 wait=0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 02:00:ac:87:b5:ff and ssid “My410C”
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=6):
4d 79 34 31 30 43 My410C
PSK (ASCII passphrase) - hexdump_ascii(len=16): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Got 0/20 bytes from /dev/random
random: Only 0/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
VLAN: vlan_set_name_type(name_type=2)
VLAN: vlan_set_name_type: SET_VLAN_NAME_TYPE_CMD name_type=2 failed: Package not installed
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=57): 80 00 00 00 ff ff ff ff ff ff 02 00 ac 87 b5 ff 02 00 ac 87 b5 ff 00 00 00 00 00 00 00 00 00 00 64 00 1
1 04 00 06 4d 79 34 31 30 43 01 08 82 84 8b 96 0c 12 18 24 03 01 01
nl80211: Beacon tail - hexdump(len=41): 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00 7f 08 00 0
0 00 00 00 00 00 40
nl80211: ifindex=4
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=6):
4d 79 34 31 30 43 My410C
nl80211: proberesp (offload) - hexdump(len=98): 50 00 00 00 00 00 00 00 00 00 02 00 ac 87 b5 ff 02 00 ac 87 b5 ff 00 00 00 00 00 00 00 00 00 00
64 00 11 04 00 06 4d 79 34 31 30 43 01 08 82 84 8b 96 0c 12 18 24 03 01 01 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 02 01 00 00 0f ac 0
2 01 00 00 0f ac 02 00 00 7f 08 00 00 00 00 00 00 00 40
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x1
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x8
nl80211: group_cipher=0x8
nl80211: beacon_ies - hexdump(len=10): 7f 08 00 00 00 00 00 00 00 40
nl80211: proberesp_ies - hexdump(len=10): 7f 08 00 00 00 00 00 00 00 40
nl80211: assocresp_ies - hexdump(len=10): 7f 08 00 00 00 00 00 00 00 40
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=32): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=2 addr=0x49fbc0 key_idx=1 set_tx=1 seq_len=0 key_len=32
broadcast key
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=4 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: Setup of interface done.
ctrl_iface not configured!
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_flags=0x1002 ()
nl80211: Ignore interface down event since interface wlan0 is up
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=6 linkmode=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
^[[A^[[A^[[B^[[B^[[Bwlan0: WPA rekeying GTK WPA: group state machine entering state SETKEYS (VLAN-ID 0) Get randomness: len=16 entropy=0 GTK - hexdump(len=32): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=2 addr=0x49fbc0 key_idx=2 set_tx=1 seq_len=0 key_len=32
broadcast key

Thanks for your reply.
AP is up and running fine now with your script.

When I try to connect my iPhone to the hotspot (on my Dragonboard), following this script, the iphone spinner keeps rotating and writing “No internet connection”.

The given steps allow to create a local WiFi network, but do not offer Internet access. If you have a network interface with internet access (e.g. eth0), you typically need to enable IP forwarding / NAT.

$ sysctl net.ipv4.ip_forward=1
$ iptables -P FORWARD ACCEPT
$ iptables -F FORWARD
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Here are steps to configure a wireless connection as AP mode using “nmcli” command:

  1. To create a WIFI Access Point, first create the connection:

nmcli con add type wifi ifname wlan0 con-name dragonboard_ap autoconnect yes ssid dragonboard_ap

  1. Set up the Wi-Fi as AP mode:

nmcli con modify dragonboard_ap 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared

  1. Set up the password for your access point (e.g. for a WPA2 AP):

nmcli con modify dragonboard_ap wifi-sec.key-mgmt wpa-psk
nmcli con modify dragonboard_ap wifi-sec.psk “1234567890”

  1. Enable the connection:

nmcli con up dragonboard_ap

Link: http://www.instructables.com/id/Wi-Fi-Network-As-Access-Point-AP-Mode-on-DragonBoa/

1 Like