Skip to content

Commit

Permalink
Added access point to the peripheral
Browse files Browse the repository at this point in the history
  • Loading branch information
rogergranada committed Oct 21, 2017
1 parent 65425aa commit aecebad
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 76 deletions.
74 changes: 74 additions & 0 deletions docs/source/jetson/peripheral/accesspoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
============================
Setting TK1 as Access Point
============================

This configuration allows the Jetson board to work as access point to connect to other devices. The configuration below refers specifically to TP Link (`TL-WN722N V1 <http://www.tp-link.com/us/download/TL-WN722N.html>`_) - chipset Atheros Communications, Inc. AR9271 802.11n. Other access points may have a different configuration.

.. image:: ../images/tplink.jpg
:align: center
:width: 500pt

By default, Grinch kernel has compatible drivers to the TP Link chipset and allows Wifi network connection. Thus, we have to set the device as hotspot. In order to do so, download and run the ``tk1_hotspot.sh`` file as:

.. code-block:: bash
$ wget --no-check-certificate --content-disposition https://raw.githubusercontent.com/lsa-pucrs/platypus_doc/master/docs/source/jetson/scripts/tk1_hotspot.sh
$ chmod +x tk1_hotspot.sh
$ ./tk1_hotspot.sh
This script first download the `hostapd <https://packages.ubuntu.com/trusty/hostapd>`_, `udhcpd <https://packages.ubuntu.com/trusty/udhcpd>`_ and `dnsmasq <https://packages.ubuntu.com/search?keywords=dnsmasq&searchon=names>`_ packages. Next step, the script subscribes the `/etc/udhcpd.conf` file, adding the configuration to the new network, setting the range of IPs from ``192.168.2.100`` to ``192.168.2.200``. Thus, any device connected to the Jetson will have an IP between these values. The values changed in ``udhcpd.conf`` are:

.. code-block:: bash
start 192.168.2.100
end 192.168.2.200
interface wlan0
remaining yes
opt dns 8.8.8.8 4.2.2.2
option subnet 255.255.255.0
opt router 192.168.2.1
Then, the script subscribes the `/etc/default/udhcpd`, by commenting the line:

.. code-block:: bash
# DHCPD_ENABLED="no"
The script also download and insert the file `/etc/hostapd/hostapd.conf` containing the configuration to connect the network. In order to connect in Jetson's network we configure the file as:

.. code-block:: bash
interface=wlan0
ssid=Tegra-WLAN
hw_mode=g
channel=3
wpa=2
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
Where the ``interface`` refers to the access point, ``ssid`` is the name of the network and ``wpa_passphrase`` is the password to connect in the Jetson. Next, the script downloads and updates the ``/etc/network/interfaces`` file. This file sets up the wireless interface by adding the following configuration:

.. code-block:: bash
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd/hostapd.conf
address 192.168.2.1
netmask 255.255.255.0
Next, download and update the ``/etc/dnsmasq.conf`` file, adding the following configuration:

.. code-block:: bash
interface=lo,wlan0
no-dhcp-interface=lo
dhcp-range=192.168.2.100,192.168.2.200,255.255.255.0,12h
Next, download and update the ``sysctl.conf`` file, which only uncomment the line ``net.ipv4.ip_forward=1``. A file containing the configuration of the access point to start when the Jetson is turned on is downloaded and moved to ``/home/ubuntu/.accesspoint.sh`` and the command to call this file is added to the ``/etc/rc.local`` file, thus, allowing the access point to run when the Jetson start up. If everything is OK, when rebooting the Jetson, the access point network should be available to connect.
2 changes: 1 addition & 1 deletion docs/source/jetson/peripheral/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

=============================================
Hooking Up Peripherals to the Jeatson
=============================================
Expand All @@ -9,4 +8,5 @@ This section shows how to add the following peripherals to the Jetson board.

.. toctree::

Access Point (TL-WN722N) <accesspoint>
Zed RGBD Camera <zed>
75 changes: 0 additions & 75 deletions docs/source/jetson/setup-os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,81 +72,6 @@ The script installs the following packages:
- `Terminal multiplexer with VT100/ANSI terminal emulation (Screen) <https://packages.ubuntu.com/trusty/screen>`_


Setting TK1 as Access Point
----------------------------

This configuration allows the Jetson board to work as access point to connect to other devices. The configuration below refers specifically to TP Link (`TL-WN722N V1 <http://www.tp-link.com/us/download/TL-WN722N.html>`_) - chipset Atheros Communications, Inc. AR9271 802.11n. Other access points may have a different configuration.

.. image:: images/tplink.jpg
:align: center
:width: 500pt

By default, Grinch kernel has compatible drivers to the TP Link chipset and allows Wifi network connection. Thus, we have to set the device as hotspot. In order to do so, download and run the ``tk1_hotspot.sh`` file as:

.. code-block:: bash
$ wget --no-check-certificate --content-disposition https://raw.githubusercontent.com/lsa-pucrs/platypus_doc/master/docs/source/jetson/scripts/tk1_hotspot.sh
$ chmod +x tk1_hotspot.sh
$ ./tk1_hotspot.sh
This script first download the `hostapd <https://packages.ubuntu.com/trusty/hostapd>`_, `udhcpd <https://packages.ubuntu.com/trusty/udhcpd>`_ and `dnsmasq <https://packages.ubuntu.com/search?keywords=dnsmasq&searchon=names>`_ packages. Next step, the script subscribes the `/etc/udhcpd.conf` file, adding the configuration to the new network, setting the range of IPs from ``192.168.2.100`` to ``192.168.2.200``. Thus, any device connected to the Jetson will have an IP between these values. The values changed in ``udhcpd.conf`` are:

.. code-block:: bash
start 192.168.2.100
end 192.168.2.200
interface wlan0
remaining yes
opt dns 8.8.8.8 4.2.2.2
option subnet 255.255.255.0
opt router 192.168.2.1
Then, the script subscribes the `/etc/default/udhcpd`, by commenting the line:

.. code-block:: bash
# DHCPD_ENABLED="no"
The script also download and insert the file `/etc/hostapd/hostapd.conf` containing the configuration to connect the network. In order to connect in Jetson's network we configure the file as:

.. code-block:: bash
interface=wlan0
ssid=Tegra-WLAN
hw_mode=g
channel=3
wpa=2
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
Where the ``interface`` refers to the access point, ``ssid`` is the name of the network and ``wpa_passphrase`` is the password to connect in the Jetson. Next, the script downloads and updates the ``/etc/network/interfaces`` file. This file sets up the wireless interface by adding the following configuration:

.. code-block:: bash
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
hostapd /etc/hostapd/hostapd.conf
address 192.168.2.1
netmask 255.255.255.0
Next, download and update the ``/etc/dnsmasq.conf`` file, adding the following configuration:

.. code-block:: bash
interface=lo,wlan0
no-dhcp-interface=lo
dhcp-range=192.168.2.100,192.168.2.200,255.255.255.0,12h
Next, download and update the ``sysctl.conf`` file, which only uncomment the line ``net.ipv4.ip_forward=1``. A file containing the configuration of the access point to start when the Jetson is turned on is downloaded and moved to ``/home/ubuntu/.accesspoint.sh`` and the command to call this file is added to the ``/etc/rc.local`` file, thus, allowing the access point to run when the Jetson start up. If everything is OK, when rebooting the Jetson, the access point network should be available to connect.


References
-----------

Expand Down

0 comments on commit aecebad

Please sign in to comment.