Sharing internet through a Wifi AP Hotspot on a Jetson board

Dear all,

I’ve recently purchased a Jetson Nano board and purchased an Edimax EW-7811Un (Realtek RTL8188CUS chipset) to connect to WiFi. However, I run into some problems when trying to set up wifi AP connection on the board. I’ve posted a similar question in the Nano forum but thought that perhaps more people would be able to see it here - especially since this is probably more of a software question on general Jetson boards with Linux for Tegra system. And our lab is also planning on purchasing a TX2 system, so probably we’d run into similar problems when setting this up on TX2 too.

Similar to my previous projects with Raspberry Pi, I’m trying to set it up such that it (1) connects to the current Wifi network (2) establishes an AP hotspot such that e.g. PC and phones can connect and ssh into it with a static ip address, and optionally (3) share the network through the AP (similar to a wireless repeater) to the devices connected. Such a setup allows one to use a PC/phone to control the board conveniently without needing an external monitor or keyboard/mouse.

I’ve tried the library create_ap made by the user OBLiQUE at https://github.com/oblique/create_ap. However, when I tried setting up

sudo create_ap wlan0 wlan0 Nano

the terminal shows the error

ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time

which probably means that the adapter doesn’t support working as an AP and a WiFi client at the same time. Therefore, I’ve bought another identical Edimax adapter (on a TX2 it would probably be the built-in wifi + one external dongle), and used the command

sudo create_ap wlan1 wlan0 Nano

the terminal seems to attempt at creating a network, but returns the following message

WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
WARN: If AP doesn't work, please read: howto/realtek.md
Config dir: /tmp/create_ap.wlan1.conf.TuzyWi4G
PID: 11749
Network Manager found, set wlan1 as unmanaged device... DONE
Sharing Internet using method: nat
iptables: No chain/target/match by that name.

Doing cleanup.. done

and the hotspot does not show up. I’ve also tried to use the idle adapter (wlan1) to simply create an AP without network connection with

sudo create_ap -n wlan1 Nano

but it shows the same error of “iptables: No chain/target/match by that name.”

I’ve installed the library dependencies including hostapd, iproute2, iw, dnsmasq, iptables, but still create_ap does not work properly. (On the other hand, I tried to use the system GUI to create a hotspot in the system settings, and the adapter is indeed able to work in AP mode - but in this case the system GUI doesn’t provide any option for sharing network from one adapter to the other, neither does it set a static ip address for the Nano to be sshed into).

May I ask if anyone has tried create_ap on a Jetson system before (or is familiar with the library and might know what causes the “iptables” error)?

Alternatively, I’ve also tried to do it the manual way, and followed some previous tutorials I used for Raspberry Pi such as https://learn.sparkfun.com/tutorials/setting-up-a-raspberry-pi-3-as-an-access-point/all, (i.e. setting /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf to connect to wifi, using /etc/dhcp.conf, /etc/dnsmasq.conf, /etc/hostapd/hostapd.conf to set up DHCP for the AP hotspot, and using NAT with iptables to redirect traffic from wlan0 to wlan1), but it seems that the files layout is very different on the Linux for Tegra system, and for instance modifying /etc/network/interfaces causes the system to not be able to recognize the adapter correctly. (It seems the system is using a “Network Manager” package to manage wifi).

May I ask if it’s possible to manually setup wifi, hostapd, iptables to share internet over a hotspot on Jetson? (For people with experiences with Raspberry Pi too) what would be the differences between setting it up on Raspbian versus Linux for Tegra? Also, if possible, may I ask if there might be any tutorials on Wifi setup for Jetson systems online?

Thank you very much for the help!

Yours Sincerely,
Mike

I did not try with that particular device, but from common sense there shouldn’t be issues if using M.2 intel 8265 as it seems to belong to the Jetson ecosystem. However, some custom wifi adapters may require custom support, probably.

Thanks for the reply. Yes, in fact intel 8265 and Edimax EW-7811Un seem to be listed as the two recommended WiFi adapters (M.2 and USB respectively) on the official BOM for the JetBot based on Jetson Nano, or the “supported components list”:

https://github.com/NVIDIA-AI-IOT/jetbot/wiki/bill-of-materials
https://developer.nvidia.com/embedded/dlc/jetson-nano-supported-components-list

I’ve picked the Edimax one since it seems that USB interface is easier to install and that the intel one requires antennae which are rather hard to get my hands on here in Canada. Although, now that I’ve run into some problems with the Edimax adapters, I’ve just ordered a set of intel 8265 + antennae from Arrow.com to try it out too.

For the Edimax adapters though (RTL8188CU), they indeed work out of the box on my Jetson Nano for WiFi connection. The problem though, is that RTL8188CU/RTL8192U doesn’t support the vanilla hostapd (it requires the rtl871xdrv driver rather than traditional nl80211), and the custom-compiled one somehow doesn’t work on Linux for Tegra system here. Overall as it’s the recommended USB WiFi adapter, and setting up AP is perhaps not uncommon for “screenless” setups, I wonder if there might be anyone who has run into similar problems as I did here.

Also, may I ask if you might have tried an intel 8265 card before? If so, does it support AP mode on Linux for Tegra? Additionally, does it support AP+station (i.e. as a device and a hotspot simultaneously) mode? Thanks!

I already replied your topic on nano board forum. Please just use that topic for tracking. Thanks.

Follow the link for creating Jetson TX2 as Wireless Access Point or Wireless Hotspot.

Thanks for sharing, even not tried that, but good to see other suggestions from developers.

You are welcome, It’s worked, I have been using it from past 8 months.