Setting up wifi Access Point on TX1

Has anyone been able to set up a TX1 board as a wifi access point? I’ve tried using the same NetworkManager method that worked on the TK1, but couldn’t get it to work. I’ve also tried using hostapd without much luck. Both methods seem to work, but I cannot see the SSID from a connecting device. The chipset appears to support this function, so maybe I’m just missing something.

I also spent a lot of time trying both these methods and got nowhere.

NetworkManager at least advertised the SSID and another laptop seemed to connect, but I couldn’t get routing info initialized.

Enabling bridge mode in the kernel results in a kernel panic.

Wifi works correctly on these boards otherwise, correct? There have been Wifi CRC issues with some of the early TX1 boards which would prevent this from working.

UPDATE: I’ve received a bit more information about what might potentially be the issue:

To enable SSID broadcast, the driver’s op_mode parameter has to be set to 2.

This can be set in two ways:

  1. Manually via /sys/module/bcmdhd/paramters/op_mode node.
  2. Add the following line to /etc/modprobe.d/bcmdhd.conf: options bcmdhd op_mode=2

Thanks - with the above op_mode setting, Ethernet bridging fixed in kernel R23.2, and following these instructions for hostapd, I was able to get a TX1 access point working in bridge mode.

I’m afraid I had no luck create an access point using the instructions linked above (even after changing the /etc/modprobe.d/bcmdhd.conf file). I’m using a freshly purchased TX1 which has just been flashed with the regular OS. I’m not a Linux expert but I’m reasonably experienced with computers and have set up an RPi before.

Does anyone have TX1 specific instructions?

In particular, after completing the setup if I type “iw wlan0 info” I should see the “type” as “AP” but instead it’s still “managed”.
Interface wlan0
ifindex 7
type managed
wiphy 0

While running through the instructions I had various questions:
i) should /etc/network/interfaces have the include at the top? i left it in
ii) in /etc/rc.local I was unsure whether “rfkill unblock 0” was required and whether it’s order (before or after iptables) was important
iii) aren’t there additional steps to start hostapd daemon on every reboot? i.e. “sudo service hostapd start”
iv) don’t we need to edit /etc/default/hostapd to set DAEMON_CONF=“/etc/hostapd/hostapd.conf”?

By the way, after the above failed I also tried using System Settings, Network and selected “Create a Hotspot” and “tegra-ubuntu” appeared as an available wifi network (according to my Windows machine) but I was unable to connect to it (even though I’ve connected with this windows machine to other APs without any problems). Using “iw wlan0 info” at this point reported a type of “IBSS” which is apparently a “Independent Basic Service Set”).

In a more general sense I’m quite disappointed how difficult the TX1 is to get working.

I have used these instructions on TX1 and successfully created a WiFi access point.
From a Vanilla build and without modifying any of the system files:

  1. echo 2 > /sys/module/bcmdhd/parameters/op_mode
  2. 3 Ways to Create Wifi Hotspot in Ubuntu 14.04 (Android Support) | UbuntuHandbook

Just follow the steps in the (2) link and you should have a Wifi hotspot.
Hope this helps.

I also was able to get it working after a lot of experimenting in hostapd.conf.

Some key steps -

  • in /etc/network/interfaces, set wlan0 to “manual”
  • you do need to start hostapd at boot somehow - I do this in rc.local
  • the op_mode setting mentioned above is crucial
  • some relevant hostapd.conf settings:

interface=wlan0
ssid=…
wpa=2
wpa_psk=…
driver=nl80211
country_code=US # nothing worked until I set country_code to US
ieee80211d=1
hw_mode=a
channel=48 # select a suitable 2.4GHz or 5GHz channel from “iw list” (in the 5ghz band I could only make channels 36, 40, 44, 48 work even though more are listed)
wmm_enabled=1
ieee80211n=1
ieee80211ac=1

One more thing - I downloaded and compiled hostapd 2.5 from hostapd: IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator as the apt hostapd package is pretty old. I went through the build options to enable various things like debug output, 802.11ac, etc.

1-sudo apt-get install hostapd dnsmasq
2- create file /etc/hostapd/hostapd.conf and put following text in it. You can change the SSID and wpa_passphrase

interface=wlan0
ssid=Tegra-WLAN
hw_mode=g
channel=3
wpa=2
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK

3-Edit /etc/network/interfaces with following text

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd/hostapd.conf
address 192.168.8.1
netmask 255.255.255.0

4- Edit /etc/dnsmasq.conf with following

interface=lo,wlan0
no-dhcp-interface=lo
dhcp-range=192.168.8.20,192.168.8.254,255.255.255.0,12h

5- Add following line in /etc/sysctl.conf file. If this line already exits and is commented out, uncomment it

net.ipv4.ip_forward=1

6- Edit /etc/NetworkManager/NetworkManager.conf with following

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false

7- Add this line to /etc/rc.local
echo 2 > /sys/module/bcmdhd/paramters/op_mode node

8-Restart your system and check if hostapd is already running on your system.If it is kill it and run the following command.

9-sudo hostapd -B /etc/hostapd/hostapd.conf

10-Instead of step 8 and 9 you can also create a script and exectue it at boot. Simply create a file with .sh extension and place following text in it.
[b]#!/bin/bash
pid=$(pgrep -x wpa_supplicant) #kill wpa_supplicant if it is already running
if [ ! -z “$pid” ]; then
kill -sigterm $pid
fi
pid=$(pgrep -x dhclient) #kill dhclient if it is already running
if [ ! -z “$pid” ]; then
kill -sigterm $pid
fi

pid=$(pgrep -x hostapd) #kill Hostapd
if [ ! -z “$pid” ]; then
kill -sigterm $pid
fi
sleep 1
hostapd -B /etc/hostapd/hostapd.conf
rv=$(echo $?) # checking return status hostapd
if [ $rv -ne 0 ]; then
echo “could not start hostapd”
exit 1
else
echo “AP mode started”
fi
exit 0[/b]
For example your file name is TurnOnAP.sh and is located at path /home/ubuntu/TurnOnAP.sh. Add the following 2 lines after echo 2 > /sys/module/bcmdhd/parameters/op_mode in /etc/rc.local file
sleep 1
/home/ubuntu/TurnOnAp.sh

These steps should configure your Tegra TX1 in AP mode and Tegra-WLAN or whatever SSID you entered in hostapd.conf file should be avaliable for connection in your nearby wifi devices.

Ref: Turn any computer into a wireless access point with Hostapd - Linux-natives

Did anybody experienced high ping time using the TX1 as an access point?
Pinging the AP from a connected laptop gives me a time of about 12ms.

Latency is probably improved by going into performance mode. See:
https://devtalk.nvidia.com/default/topic/894945/jetson-tx1/jetson-tx1/post/4734485/#4734485

If you want to prevent “ondemand” from throttling back and to just use manual control (and don’t care about power saving) you can do this in conjunction with the above:

sudo update-rc.d -f ondemand remove

Unfortunately this did not improve the access point performances. Thanks for your comment though, it made me discover a very interesting topic!

Dear, Sir

I use wifi ap mode
I want use channel 149
but TX1 only support 36 to 48
I try to change hostapd.conf about country code, but it’s not work
Should I change wifi firmware?
please help me.

Dear, Sir

I use TX1 become ap mode,
I want query connect client information
I use iw dev wlan0 station dump, but noting happened
I try to use iwconfig, but some information, I can not get it

iwconfig will to use Wext/nl80211 driver to communicate with DHD driver, so the DHD must include Wext/nl80211 while compiling, so nvidia can help me solve it?

Hi Nancy, you cannot change the firmware or country code as these are certified for your particular region. Depending on your region, the Wireless Compliance Guide may have the certification identifiers available for you to reference.

Can you perform sudo iw dev wlan0 scan?

Hi
I set the TX1 AP mode as above steps, but my phone and notebook cannot connect to the AP, can anybody help?

Hi bangbang_meg,

What kind of situation do you meet? Do your phone and notebook see the wifi ssid but cannot connect to?

Howdy folks,

I had my wifi accesspoint on the JTX1 working just fine since last summer (followed instructions from Turn any computer into a wireless access point with Hostapd - Linux-natives), but now not anymore.

I can see the SSID being broadcasted. When I attempt to connect from my laptop it seems to get pass the WPA2 authentication, but then my laptop just waits for the connection to establish, but eventually fails and falls back to my home wifi.

The only thing that has changed since I last had this working is that I upgraded my laptop from Ubuntu 14.04 LTS to Ubuntu 16.04 LTS.

I was wondering if somebody else ran into this a similar issue. I have already spent hours twiddling with hostapd.conf, but I am not getting anywhere.

Cheers

Galto

Hi Galto2000,

Have you tried other devices to connect to your AP? Do they have the same problem?