Jetson Nano Hardware Library Configuration

Jetson.GPIO - Linux for Tegra

1.Introduction

The Jetson TX1, TX2, AGX Xavier, and Nano development boards include a 40 pin GPIO connector, similar to the 40 pin connector in Raspberry Pi. You can use the Python library provided in the Jetson GPIO Library package to control the digital inputs and outputs of these GPIOs. This library shares the same API as Raspberry Pi's RPi. GPIO library to provide a convenient way to move applications running on Raspberry Pi to the Jetson board.In addition to this document, the Jetson GPIO library package also includes the following content:

  1. This lib/Python/subdirectory contains Python modules that implement all library functions. The gpio.py module is the main component of gpio that imports applications and provides the required APIs_ Event.py and gpio_ pin_ The data.py module is used for importing directly into applications through the gpio.py module.
  2. This samples/subdirectory contains sample applications to help you familiarize yourself with the library API and start using the application. These simple_ Input.py and simple_ The output.py application shows how to perform read and write operations on GPIO pins using buttons_ led.py, button_ Event.py and button_ Interrupt. py shows how to use buttons to use busy waiting, blocking waiting, and interrupt callback to make the LED blink

This document will introduce the content contained in the Jetson GPIO library package, how to configure the system, and run the provided sample applications and library APIs. Here we briefly introduce how to use this library for Jetson.GPIO, with detailed instructions:

https://pypi.org/project/Jetson.GPIO/

or

https://github.com/NVIDIA/jetson-gpio

2.Pin diagram

GPIO and BCM Comparison Table

 

3.Environmental configuration

Environmental configuration

  1. Download Jetson gpio:

git clone https://github.com/NVIDIA/jetson-gpio

  1. Move the downloaded files to the directory:/opt/nvidia

If your directory exists in this library, we need to backup the original directory as follows:

Then place the downloaded folder in the opt/nvidia/directory. Since I am placing the folder in the path~/and currently in opt/nvidia/, I can execute the following command to move the folder

sudo mv ~/jetson-gpio ./

  1. Install pip3 tool:

sudo apt-get install python3-pip

  1. Enter the Jetson gpio library folder and install the library.

cd /opt/nvidia/jetson-gpio

sudo python3 setup.py install

  1. Before using, you also need to create a GPIO group, add your current account to this group, and grant usage permissions

sudo groupadd -f -r gpio

sudo usermod -a -G gpio user_name

sudo cp /opt/nvidia/jetson-gpio/lib/python/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/

In order for the new rule to take effect, you need to reboot or reload the udev rule by running the following command

sudo udevadm control --reload-rules && sudo udevadm trigger

Attention: user_ Name is the username you use, such as Jetson