Wifi AP creation with Rel 28.2

Hi,

I am trying to create wifi AP on jetson tx1 with Rel 28.2 i.e. ubuntu16.04.
I am able to see AP in SSID list but not able to connect to it.
Also command ‘hostapd -B /etc/hostapd/hostapd.conf’ show following output
Configuration file: /etc/hostapd/hostapd.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
hostapd_free_hapd_data: Interface wlan0 wasn’t started

I am following steps from the link below
https://devtalk.nvidia.com/default/topic/910608/setting-up-wifi-access-point-on-tx1/

But it seems they are not working with rel 28.2(ubuntu 16.04)

Has anybody faced similar issue? or tried steps on ubuntu 16.04?
Any help is appreciated.

Thanks,
Prathamesh

Hi,

Please try below method:

1. Turn OFF Wi-Fi (Pre-requisite)
2. Connect ethernet cable to DUT to give it internet source
3. Turn ON wireless hotspot on DUT using GUI interface
(i) To allow SSID broadcasts, the following bcmdhd module paramter should be set: op_mode=2. Set this in two ways:
a) manually via /sys/module/bcmdhd/paramters/op_mode node
->echo 2 > /sys/module/bcmdhd/parameters/op_mode
b)or to set the parameter automatically on boot, add a bcmdhd.conf (module conf fine, the name may change) file to /etc/modprobe.d with this line:
options bcmdhd op_mode=2
(ii) Create a new connection in "Network Connection" settings using GUI
a) Click Network icon on GUI -> Edit-connections -> click "Add" button
b) Choose Wi-Fi from dropdown
c) In Edit window enter custom "Connection name", SSID, select device MAC address (primarliy of wla0)
d) Under WiFi-Security select WPA and WPA2 Personal and give a passcode
e) Under IPv4 Setting select "Shared to other computers"
f) In newly created system-connection file for your hotspot, change mode=ap
For e.g. sudo vim /etc/NetworkManager/system-connections/
# and set mode=ap in the given file
(iii) Turn ON Wi-Fi, to enable hotspot
(iv) Your hotspot is ready to use now
4. Connect other (client) device to this hotspot and access network using it
5. Repeat above for 2-3 iterations and have (client) device connected to this hotspot for sometime

Hi,

Thanks for the reply.
But I am more interested in creating wifi AP from command line.
I have disabled HDMI, so can not configure wifi AP from GUI.
Also executing “echo 2 > /sys/module/bcmdhd/parameters/op_mode” give me error “No such file or directory”

Thanks,
Prathamesh

patyarahate,

Could you dump the result of

lsmod
rfkill list

Hi,

Following is the output of lsmod

nvidia@tegra-ubuntu:~$ 
nvidia@tegra-ubuntu:~$ 
nvidia@tegra-ubuntu:~$ lsmod
Module                  Size  Used by
bcmdhd               7622868  0
bluedroid_pm           13308  0
nvidia@tegra-ubuntu:~$

Following is the output of rfkill list

nvidia@tegra-ubuntu:~$ 
nvidia@tegra-ubuntu:~$ rfkill list
0: bluedroid_pm: Bluetooth
	Soft blocked: yes
	Hard blocked: no
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
	Soft blocked: no
	Hard blocked: no
nvidia@tegra-ubuntu:~$

Do you see below path?

sys/module/bcmdhd/

Hi,

I could see the path you have mentioned.
I think issue with running “echo 2 > /sys/module/bcmdhd/parameters/op_mode” from rc.local in ubuntu 16.04 is that, service rc.local is running way before path “/sys/module/bcmdhd/parameters/op_mode” could exist during boot.
I could manually run echo command once system boots up, but that does not help in creating AP.
I also tried another option of setting op_mode parameter through “/etc/modprobe.d/bcmdhd.conf” file
But that also not working.

Has anyone verified steps on Ubuntu 16.04 on tx1? they work perfectly fine with ubuntu 14.04.

Thanks,
Prathamesh

patyarahate,

You need to set op_mode to 2 first and then use NetworkManager or hostapd to setup the AP.
I wonder how this node is gone on your device.

Are you using full rootfs+ BSP from Jetpack?

Hi,

I am building the kernel and rootfs, manually. Not using Jetpack directly.
I even tried setting op_mode=2 then using hostapd to setup AP. I followed below steps but ladnaded with following error.
sudo nmcli radio wifi off
sudo su -c “echo 2 > /sys/module/bcmdhd/parameters/op_mode”
sudo nmcli radio wifi on
sudo ifconfig wlan0 192.168.1.1 up
sudo hostapd -d /etc/hostapd/hostapd.conf

Error:

nvidia@tegra-ubuntu:~$ sudo hostapd -d /etc/hostapd/hostapd.conf
[sudo] password for nvidia: 
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
rfkill: initial event: idx=0 type=2 op=0 soft=1 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=2 type=1 op=0 soft=0 hard=0
nl80211: TDLS supported
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: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4110
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=4105
nl80211: Supported vendor event: vendor_id=0x1018 subcmd=0
nl80211: Supported vendor event: vendor_id=0x1018 subcmd=1
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=2
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=3
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=4
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=5
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=6
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=7
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=8
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=9
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=10
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=11
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=12
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=13
nl80211: Supported vendor event: vendor_id=0x1a11 subcmd=14
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: Disable use_monitor with device_ap_sme since no monitor mode support detected
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 6 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x557e8941c0 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x557e8941c0 match=
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=6)
netlink: Operstate: ifindex=6 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 6 iftype 2 (STATION)
nl80211: Teardown AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0x557e8934a0)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x557e8934a0)
wlan0: interface state UNINITIALIZED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: AP-DISABLED 
hostapd_cleanup(hapd=0x557e895e40 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
hostapd_interface_free(0x557e8934a0)
hostapd_interface_free: free hapd 0x557e895e40
hostapd_cleanup_iface(0x557e8934a0)
hostapd_cleanup_iface_partial(0x557e8934a0)
hostapd_cleanup_iface: free iface=0x557e8934a0

Error:

[ 8672.942478] CFG80211-ERROR) __wl_cfg80211_scan : Invalid Scan Command at SoftAP mode
[ 8672.953578] CFG80211-ERROR) wl_cfg80211_scan : scan error (-22)
[ 8735.907364] CFG80211-ERROR) __wl_cfg80211_scan : Invalid Scan Command at SoftAP mode
[ 8735.919067] CFG80211-ERROR) wl_cfg80211_scan : scan error (-22)
[ 8798.903194] CFG80211-ERROR) __wl_cfg80211_scan : Invalid Scan Command at SoftAP mode
[ 8798.914932] CFG80211-ERROR) wl_cfg80211_scan : scan error (-22)

patyarahate,

This is a script I used long time ago to enable wifi AP using hostapd. Please try.

#!/bin/sh
#AP.sh
/bin/sleep 10
/usr/sbin/service hostapd stop
/usr/sbin/service network-manager stop
/sbin/ifdown wlan0
/sbin/iwconfig wlan0 mode Managed
/usr/sbin/rfkill unblock wlan
/usr/bin/nmcli radio wifi off
/usr/sbin/service hostapd stop
/bin/sleep 10
/usr/sbin/service isc-dhcp-server start
/bin/sleep 5
ifconfig wlan0 192.168.2.1
/usr/sbin/service hostapd start

Hi,

Your script helped me to some extent.
Now i could set mode to AP by running your script first and then running following commands
sudo nmcli radio wifi off
sudo su -c “echo 2 > /sys/module/bcmdhd/parameters/op_mode”
sudo nmcli radio wifi on
sudo ifconfig wlan0 192.168.1.1 up
sudo hostapd -d /etc/hostapd/hostapd.conf

But i could not connect to wifi AP, it shows on my mobile phone but fails to get IP.
Also wifi SSID does not show up in laptop.

nvidia@tegra-ubuntu:~$ iw wlan0 info
Interface wlan0
        ifindex 7
        wdev 0x1
        addr 00:90:4c:16:70:01
        ssid Tegra-WLAN
        type AP
        wiphy 0

patyarahate,

If some of your devices are able to see the AP while others cannot, please check if the wifi is running in a band that some devices cannot access.

As for the IP, do you install any dhcp server on your tegra? Could you try to manually set your IP on the device(phone) and see if tegra is able to ping it?

Hi,

I encountered the same problem, have you solved it?

The same configs I used on both TX1 and TX2.

TX2 works well.

TX1 can broadcast the SSID, but devices cannot connect to AP, fail to get IP.

I have tried all above method with TX2, but none of them worked.
Are there any other guideline which I can follow to turn hostpot on using tx2?