Skip to content

Cart

Your cart is empty

Jetson-GPIO Library Update for Forecr Products

WHAT YOU WILL LEARN?

1- How to clone Jetson-GPIO Library?
2- How to install Jetson-GPIO Library?
3- How to test one of the output pins?
ENVIRONMENT

Hardware: DSBOX-ORNX

OS: JetPack-6.1


In this blog post, we will patch Jetson-GPIO library to activate extra pins for forecr products.

This library is compatible for JetPack-5.x and JetPack-6.x installed forecr products. With the recent updates, the following products' GPIOs included in the library:
• DSBOARD-AGXMAX (and DSBOX-AGXMAX)
• DSBOARD-AGX (and DSBOX-AGX)
• RAIBOARD-ORNX (and RAIBOX-ORNX)
• DSBOARD-ORNX (also DSBOX-ORNX and DSBOX-ORN)
• DSBOARD-ORNX_LAN (also DSBOX-ORNX-LAN and DSBOX-ORN-LAN)
• DSBOARD-NX2 (and DSBOX-NX2)

Cloning the Jetson-GPIO Library

First, download the updated version of this library from our GitHub repository. This repository contains extra GPIOs in it.


git clone https://github.com/forecr/jetson-gpio.git
cd jetson-gpio

Jetson-GPIO cloning

Installing the Jetson-GPIO Library

You can use this library directly but there could be a conflict between pre-installed library.
To solve this, you need to install this library manually.


Before installing it, you need to select the correct product from the gpio_pin_data.py file (located in lib/python/Jetson/GPIO folder from the repository). Open this file and take a look at the "FORECR_BOARD_TYPE" value. If you are using different board type than the default one, please comment the default value and uncomment the correct one.


We comment out the default one for our setup and uncomment the "DSBOARD-ORNX" one.


If you have not installed python3-pip package before, please install it first.


sudo apt install -y python3-pip


From this library's location, run the following command to install it manually:


sudo python3 setup.py install

At the end of the library installation, the forecr product is ready to test.

Testing One of the Output Pins

In this section, we will test the green LED from the DSBOX-ORNX's power LED. This GPIO has been assigned as PWR_LED_G in the gpio_pin_data.py file (located in lib/python/Jetson/GPIO folder from the repository). The pin number that we need to test is 46. We will use this number at the test file.


The test file is samples/simple_out.py file which toggles the GPIO in each second. The beginning of the file, pin number 18 used as output pin number.


For our setup, we changed this value to 46 and saved it.


Finally, we ran the following command to test:


sudo python3 samples/simple_out.py

We physically confirmed that the library is working and it toggles the green LED.



Thank you for reading our blog post.