Exception: Could not determine Jetson model - Help Needed with Adafruit ServoKit on Jetson Orin Nano"

Hello,

I’m encountering an issue while trying to use the adafruit_servokit library on my Jetson Orin Nano. Below are the details:

Setup:
Jetson Device: Jetson Orin Nano
Python Version: 3.10.12
JetPack version:6

Installed Libraries:
adafruit_servokit
adafruit_pca9685
Jetson.GPIO

Problem:
When I attempt to import the Servokit module from adafruit_servokit, I receive the following traceback:

Error appeared:

Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.10/dist-packages/adafruit_servokit.py”, line 36, in
from adafruit_pca9685 import PCA9685
[Truncated for brevity…]
File “/home/kids/.local/lib/python3.10/site-packages/Jetson/GPIO/gpio_pin_data.py”, line 602, in get_model
raise Exception(‘Could not determine Jetson model’)
Exception: Could not determine Jetson model

Steps Tried:
Reinstalled adafruit_servokit, adafruit_blinka, and Jetson.GPIO.
Verified the I2C configuration is enabled on my Jetson Orin Nano.
Checked the GPIO pins’ physical connections.

I believe the issue might be related to the compatibility of Jetson.GPIO with my Jetson Orin Nano. Has anyone faced a similar issue or knows how to resolve this error?

Any help or guidance would be greatly appreciated. Thank you!

Hi,
It seems to be a custom carrier board from 3rdparty. We would suggest consult the vendor for further suggestion.

If you use Orin Nano developer kit, please share how to set it up. We will set up and check.

Sir I am using Original jetson nano developer kit not the third party one as you mentioned and these are the Steps to Set Up the PCA9685 on Jetson orin nano
Install the required modules for I2C communication and the Adafruit PCA9685 library.

Terminal commands :
sudo apt update
sudo apt install python3-pip
pip3 install adafruit-circuitpython-pca9685

To Enable I2C on Jetson Orin Nano:
Open the Jetson GPIO configuration tool.
Terminal commands:
sudo /opt/nvidia/jetson-io/jetson-io.py
Enable I2C for the pins connected to the PCA9685 module.
Save and reboot the system.

Connect the PCA9685 Module:

Connect the SDA pin to GPIO pin 3.
Connect the SCL pin to GPIO pin 5.
Provide 5V and GND connections to power the PCA9685 module.

Python Code
python3

import time
from adafruit_pca9685 import PCA9685
from board import SCL, SDA
import busio

Initialize I2C bus

i2c = busio.I2C(SCL, SDA)

Initialize PCA9685

pca = PCA9685(i2c)
pca.frequency = 50 # Typical servo frequency is 50Hz

Function to set servo position

def set_servo_angle(channel, angle):
# Convert angle to duty cycle (assuming a range of 0-180 degrees)
min_duty = 0.5 # ms
max_duty = 2.5 # ms
duty_range = max_duty - min_duty
pulse_width = min_duty + (angle / 180.0) * duty_range
duty_cycle = int((pulse_width / 20.0) * 0xFFFF) # Convert to 16-bit value
pca.channels[channel].duty_cycle = duty_cycle

Main loop to test servos

try:
while True:
# Move servo on channel 0 to 0 degrees, 90 degrees, and 180 degrees
set_servo_angle(0, 0)
time.sleep(1)
set_servo_angle(0, 90)
time.sleep(1)
set_servo_angle(0, 180)
time.sleep(1)

    # Repeat for other channels (1 and 2)
    set_servo_angle(1, 45)
    time.sleep(1)
    set_servo_angle(2, 135)
    time.sleep(1)

except KeyboardInterrupt:
# Gracefully exit on Ctrl+C
pca.deinit()
print(“Program terminated.”)

Wiring Diagram
PCA9685:
VCC: 5V from Jetson Orin Nano.
GND: Ground pin.
SDA: Connect to GPIO pin 3.
SCL: Connect to GPIO pin 5.
Servo Motors:
Connect to channels 0, 1, and 2 of the PCA9685.

I am facing the same error while even importing the gpio pins using python

That is the only i2c that is enabled on the bus in the out of the box state. The other one requires a device tree update.

Run sudo i2cdetect -y -r 7

You should see your device. If you can see it on i2c bus it is your library that is not working. We are using smbus2.

Here is an example of some python running adxl345 on the orin nano that is using smbus2.

Does you module require more than i2c from the bus, if so you might have a deeper issue.

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