GPIO python library not working on Mistral's Neuron devkit for Jetson Xavier NX

Hi all,

We need to access GPIO using python library Jetson.GPIO .When we try to import this library into python, getting the following error.

$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Jetson.GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/_init_.py", line 1, in <module>
    from .gpio import *
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 70, in <module>
    model, JETSON_INFO, _channel_data_by_mode = gpio_pin_data.get_data()
  File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio_pin_data.py", line 438, in get_data
    raise Exception('Could not determine Jetson model')
Exception: Could not determine Jetson model

I have tried Nvidia’s GPIO documentation also. Please help us to resolve this issue.

Thanks and Regards
Vishnu Prasad

hello vishnu.prasad,

had you complete the installation?
you should use pip to install this Jetson.GPIO library, or, you may clone the git repository and perform setup.py to install it manually.

Hello Jerry,

I had completed the installation.I manually installed Jestson.GPIO from git repository, but getting similar output as:

$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Jetson.GPIO as GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.0.17-py3.6.egg/Jetson/GPIO/_init_.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.0.17-py3.6.egg/Jetson/GPIO/gpio.py", line 70, in <module>
  File "/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.0.17-py3.6.egg/Jetson/GPIO/gpio_pin_data.py", line 440, in get_data
Exception: Could not determine Jetson model
>>>

Jetson.GPIO only supports NVIDIA Jetson Xavier NX official devkit , not devkit from other third party.

We are using Neuron Turbo board from Mistral.How to access GPIO from python on this?
Please share any insights

hello vishnu.prasad,

Jetson.GPIO python library it only supports with NVIDIA Jetson Xavier NX official devkit.
please refer to Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.
thanks

Jetson.GPIO code is basically using python code to write the gpio sysfs interface. You will have to inspect the baseboard schematics to see which gpio line connect to which gpio pin.
You can see the available lines using tools like GPIO Programming: Exploring the libgpiod Library | ICS

1 Like