I installed the JetPack 4.6.1 in an SD. After I installed the container for dusty-nv`s jetson inference R32.7.1.
The GPIO pins are not working inside the container.
Outside the container the pins are working properly, for example, I can run this code and the led is working according to the code:
import Jetson.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)
while True:
GPIO.output(7,True)
print("True")
time.sleep(5)
GPIO.output(7,False)
print("False")
time.sleep(5)
But inside the container the GPIO is not working. I tried:
Install GPIO inside the container, using this code:
sudo apt-get install python3-pip
sudo pip3 install Jetson.GPIO
sudo groupadd -f -r gpio
sudo usermod -a -G gpio your_user_name
According to the configuration that can be checked at the OS it seems that the GPIO0 and GPIO1 are mapped properly and it is possible (it has the permissions) for the container to access the GPIO pins. But when I run the code it shows this messages:
#root@jetson-desktop:/my-detection# python3 my-detection-gpio-only.py
#Traceback (most recent call last):
# File "my-detection-gpio-only.py", line 1, in <module>
# import Jetson.GPIO as GPIO
# File "/usr/local/lib/python3.6/dist-packages/Jetson/GPIO/__init__.py", line 1, in <module>
# from .gpio import *
# File "/usr/local/lib/python3.6/dist-packages/Jetson/GPIO/gpio.py", line 33, in <module>
# raise RuntimeError("The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this. It is also possible that {} does not exist. Please check if that file is present.".format(_GPIOCHIP_ROOT))
#RuntimeError: The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this. It is also possible that /dev/gpiochip0 does not exist. Please check if that file is present.
The issue does not make sense for me:
- When I am inside the container I am root.
- The permissions are configured
- /dev/gpiochip0 does exist