Configuration of NVidia Jetson TK1

[Last update: 2015, 3rd April]

This is the guide to configurate NVidia Jetson TK1 to properly run all the software needed to control MyzharBot… and other robots, why not? 🙂

“The Grinch” custom kernel to enable WiFi and other features

The Jetson TK1 comes from NVidia Labs with  a version of Ubuntu Linux operating system customized for Tegra processor: Linux for Tegra (L4T).
The current version of L4T is the v21.2.1. The system includes drivers for Tegra TK1, but the kernel does not support WiFi.
Since Jetson TK1 can mount Mini PCIe boards, MyzharBot will be able to perform WiFi and Bluetooth communications thanks to an Intel Dual Band Wireless-AC 7260 PCIe Half Mini Card, Dual Band 2.4GHz (Link).
As told before the “original” kernel that comes with L4T v21.2.1 has not support for WiFi, hence we need to install a custom kernel named “The Grinch” provided by Santyago Jarzebski to enable Wifi.

The instructions to install the custom kernel are available on the NVidia Developer Forum. Since they are updated very often and they are written very well, I chose to not replicate them on this page, but I suggest to you to follow the steps directly by the developer forum page.
Please note that installing “The Grinch” you will lose the full content of the flash of your Jetson TK1, hence please move on an Usb Key, or somewhere else, everything you want to save before proceding.


Before starting

Just to remember this: if you did not changed it, the default user of Nvidia Jetson TK1 is “ubuntu” and the default password is “ubuntu“. So when running “sudo” for the first time rembember that you must enter “ubuntu” as password… unless you changed it.

CUDA Toolkit and OpenCV installation

After the installation of the custom kernel you must install the latest CUDA Toolkit and OpenCV Library:

CUDA Toolkit installation

  1. Download the toolikit Debian package for L4T (i.e. CUDA 6.5 Toolkit for L4T Rel 21.2) from the official site
  2. Install the package:
  3. Update the repository:
  4. Install the toolkit:
  5. Add the user to the video group:
  6. Add the CUDA paths to your .bashrc:

  7. Verify the installation:

You can compile the examples to test the CUDA capabilities… please consider that the compilation of the samples will take a lot of time and it is useful only to satisfy your curiosity:

  1. Go to the samples folder:
  2. Compile:
  3. After the compilation you will find the examples in the folder: /usr/local/cuda/samples/bin/armv7l/linux/release/gnueabihf

Default OpenCV4Tegra installation

  1. Download the OpenCV4Tegra Debian package (i.e. OpenCV4Tegra for L4T 21.x) from the official site
  2. Install the package:
  3. Update the repository:
  4. Install the library:

Please consider that the default OpenCV4Tegra will be automatically removed when you will install the ROS packages that depends on OpenCV. ROS is designed such to depends on the release of OpenCV available in Ubuntu repository and it will not recognize OpenCV4Tegra as a good version, so it will replace the library. We are trying to understand how to overcome this problem… the solution is near, but not yet complete.
OpenCV in the official Ubuntu repository is not optimized for Tegra TK1 processor (2-3 FPS of performance difference on standard CPU code for a vehicle tracking application) and it has not CUDA GPU support… and we pretend to use OpenCV with CUDA ^_^


Tweaks

A few tweaks to make the Jetson TK1 more usable. The majority part of there Tweaks can be automatically applied using the scripts by Kangalow on Jetsonhack blog.

Add Universe and Multiverse packages repository

Open a new terminal (Ctrl+Alt+t) and enter the following commands:

Change system hostname

The default hostname for “Linux for Tegra” system is “tegra-ubuntu”. We want to call our robot with its name also over the network.

  1. Change hostname
  2. Replace “tegra-ubuntu” with “myzharbot
  3. Save and exit
  4. Modify hosts:
  5. Replace each “tegra-ubuntu” with “myzharbot
  6. Save and exit

Activate Bash completition

Open a new terminal (Ctrl+Alt+t) and enter the following commands:

Now logout and login again

Install Git and Aptitude

Shutdown to power button

To shutdown the board directly pressing the “Power” button, without confirmation:

  1. Install dconf-tools:
  2. Run dconf editor:
  3. Navigate to org.gnome.settings-daemon.plugins.power and set default button-power action to shutdown
Power Button option in dconf-tools

Power Button option in dconf-tools

Disable Lock by timeout

Disable the “Lock” functionalities:

  1. Click on “System Settings” in the Unity sidebar
  2. Select “Brightness & Lock”
  3. Put “Lock” to OFF
  4. Uncheck “Require my password when waking from suspend”

Internet browser

I like “Chrome”, but I faced continuous blocks using “Chromium”, so I suggest to use “Firefox” internet browser that comes with Jetson TK1 by default.

CPU performances

MyzharBot needs elaboration power… so we set CPU to “performance” automatically al boot.

  1. Open a new terminal (Ctrl+Alt+t)
  2. Create maxPerformance.sh:
  3. Add the following code in it:
  4. Save and exit
  5. Modify /etc/rc.local adding the following lines just before exit o:
  6. Save and exit
  7. Reboot to apply

Remote Desktop

It may be useful to connect to MyzharBot remotely using a graphical interface. Ubuntu 14.04 provides a default Desktop sharing tools named “vino“.  We must activate it:

  1. Open Unity’s finder (Alt+F2)
  2. Enter: Desktop sharing
  3. Select the “Desktop Sharing” icon
  4. Check “Allow other users to view your desktop
  5. Check “Allow other users to control your desktop
  6. Uncheck “You must confirm each access to this machine
  7. [optional] Check “Require the user to enter this password:
  8. Check “Automatically configure UPnP router to open and forward ports

You can now connect from a remote computer using: vncviewer <jetson’s IP or hostname>

Running scripts on boot

The easiest way to run scripts as root on every boot, is to add your commands to /etc/rc.local editing it with gedit or nano or vi.

Enable Serial Port access

In Ubuntu “normal” users have not the right to access serial port unless you change access right ( e.g. sudo chmod 666 /dev/ttyUSB0).

To automatically access a serial port is enough to add the user to the group “dialup“:

Remember to replace “ubuntu” with the correct username if you do not use the default user provided by Jetson Linux 4 Tegra.

Disable USB Autosuspend and Enable USB 3.0

By default USB3.0 port is not enabled and it is detected as a “simple” USB2.0 port.
You can enable it with the folowing command

Default Linux for Tegra is configured to save energy, so the USB ports are turned off when not used. This can bring problems with USB periferals. To disable USB autosuspend we can use this command:

To avoid to enter manually this command every time we boot the robot we can execute it automatically at every boot:

 

  • Open a new terminal (Ctrl+Alt+t)
  • Create maxPerformance.sh:
  • Add the following code in it:
  • Save and exit
  • Modify /etc/rc.local adding the following lines just before exit o:
  • Save and exit
  • Reboot to apply

 


Jetson TK1 as WiFi access point

To connect to the robot it is very useful that it can act as a WiFi access point, so you do not need to know its IP address, only turn on the controller PC and connect to the “MyzharBot-WiFi” SSID.

There is a simple way to enable Wifi access point on Ubuntu using Unity default Network Manager:

  1. Disable WIFI and plug in an internet cable to your laptop so that your Ubuntu is connect to a wired internet and wireless is disabled.
  2. Go to Network Icon on top panel -> Edit Connections …, then click the Add button in the pop-up window.
  3. Choose Wi-Fi from the drop-down menu when you’re asked to choose a connection type
    1. In next window, do:
    2. Type in a connection name (i.e. MyzharBot-WiFi). The name will be used later.
    3. Type in a SSID (i.e. MyzharBot-WiFi)
    4. Select mode: Infrastructure
    5. Device MAC address: select your wireless card from drop-down menu.
  4. Go to Wi-Fi Security tab, select security type WPA & WPA2 Personal and set a password. You can also leave the connection Open… it’s your oen choise.
  5. Go to IPv4 Settings tab, from Method drop-down box select Shared to other computers.
  6. Click Save

After above steps, a configuration file created under “/etc/NetworkManager/system-connections“directory. File name is the same to the connection name you typed in step 3-B.

  1. Now press Ctrl+Alt+T on keyboard to open terminal. When it opens, paste the commands below and hit enter to edit the configuration file:
  2. Replace wifi-hotspot with the connection name you typed in step 3-B.
  3. When the file opens, find out the line mode=infrastructure and change it to mode=ap.
  4. Finally save the file.

When everything’s done, enable WIFI from Network Manager icon on the panel. It should automatically connect to the hotspot you created. If not, select “Connect to Hidden Wi-Fi Network …” and select it from the drop-down box.

The robot will now get automatically the IP 10.42.0.1 and a DHCP server is enabled, so every device that connects to “MyzharBot-WiFi” will get an IP in the class 10.42.0.*

When you will boot the Jetson TK1 after this configuration the MyzharBot-WiFi willl be automaticaclly active, so if you want to connect to a different wifi network you must disconnect it and select one of the available connection using Network Manager.

You can find the original full guide and other interesting stuffs on UbuntuHandbook Blog


ROS – Robot Operating System installation

Since September 2014 MyzharBot is driven by ROS, the Robot Operating System provided by Willow Garage. ROS is free and is supported by a huge worldwide community.

The installation of ROS on Jetson TK1 is really simple, the guide to install the base package is available on the ROS wiki site. Please follow the guide step by step, remembering at step 2.5 to install only “ros-indigo-ros-base” package, other package will be needed for MyzharBot, but they will be installed in the next future.

To install the software to control MyzharBot you can follow the guide on the page “RoboController-ROS“.

The software to control MyzharBot is getting available on the official repository of “Officine Robotiche” on Github platform.

The full documentation is available in the section of the site dedicated to ROS


 

OpenNI2 installation for Asus Xtion Pro Live outside ROS framework

Even if MyzharBot will use ROS framework to work, a guide about the installation of OpenNI2 for Asus Xtion Pro Live outside ROS is available here

4 Comments:

  1. Pingback: The guide to configure NVidia Jetson TK1 is updated - MyzharBot v3.1.1

  2. Pingback: The guide to configure Nvidia Jetson TK1 has been update - MyzharBot v3.1.1

  3. Hi-

    When I run, “sudo echo -1 > /sys/module/usbcore/parameters/autosuspend”

    I get

    “-bash: /sys/module/usbcore/parameters/autosuspend: Permission denied”

    The permissions are

    -rw-r–r– 1 root root 4096 Nov 12 16:27 /sys/module/usbcore/parameters/autosuspend

    Any help?

Leave a Comment