GPIO Jetson Nano

I use this docker image:

# Base l4t container with Jetpack 5.0

WORKDIR /usr/src/car/utils

ADD . /usr/src/car/utils

RUN apt-get update

RUN apt-get install -y python3-opencv && apt-get install -y python3-pip
RUN apt-get install -y python3-pip && pip3 install --upgrade pip

# Setting up Servo and DC Motor control
RUN pip3 install adafruit-circuitpython-servokit==1.3.8 Jetson.GPIO

And after running this code:

import Jetson.GPIO as GPIO

class DCMotor:

    Control DC Motor Jetson Nano

    def __init__(self):
        self.dc = 0

        self._ENA = "GPIO_PE6"
        self._IN1 = "DAP4_FS"
        self._IN2 = "SPI2_MOSI"

        GPIO.setup(self._ENA, GPIO.OUT, initial=GPIO.LOW)
        self.pwm = GPIO.PWM(self._ENA, 120)

        GPIO.setup(self._IN1, GPIO.OUT, initial=GPIO.LOW)
        GPIO.setup(self._IN2, GPIO.OUT, initial=GPIO.LOW)

    def stop(self):
        GPIO.output(self._IN1, GPIO.LOW)
        GPIO.output(self._IN2, GPIO.LOW)

    def forward(self, speed):
        GPIO.output(self._IN1, GPIO.HIGH)
        GPIO.output(self._IN2, GPIO.LOW)

    def backward(self, speed):
        GPIO.output(self._IN1, GPIO.LOW)
        GPIO.output(self._IN2, GPIO.HIGH)

    def _change_duty_cycle(self, dc):
        if dc > 100:
            dc = 100
        elif dc < 60:
            dc = 60
        self.dc = dc

I have this error: 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
And after running this code:

import time
from adafruit_servokit import ServoKit
from adafruit_pca9685 import PCA9685
import board
import busio

class ServoMotor:

    Control ServoMotor Jetson Nano

    def __init__(self, channel):
        self.angle = 0

        i2c = busio.I2C(board.SCL, board.SDA) = channel
        self._pca = PCA9685(i2c)
        self.motor = ServoKit(channels=16)

    def set_rotation_angle(self, angle):
        self.motor.servo[].angle = angle
        self.angle = angle

    def _set_pca_frequency(self, freq):
        self._pca.frequency = freq

    def _set_pca_duty_cycle(self, dc):
        ch = self._pca.channels[]
        ch.duty_cycle = dc

    def _set_actuation_range(self, act_range):
        self.motor.actuation_range = act_range

I have this error: RecursionError: maximum recursion depth exceeded while calling a Python object
Maybe u know how to fix this?

hello vovinsa,

l4t-r34.1.1 is a developer preview release, which had GPIO control bugs.
could you please moving to JetPack 5.0.2 production release, it also contain the fixes for GPIO controls.

I have the same Errors. maybe I should to setup permissions in the docker container. But how can I do this?


Are you using the Nano platform?

If yes, please noted that JetPak 5 (r34 or r35) doesn’t support Nano device.
Please use JetPack 4.6.2 instead.

For GPIO, you can check if the following command can meet your requirement:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.