Closed BrianHenryIE closed 1 year ago
@BrianHenryIE,
Jetson.GPIO
normally comes already installed on JP so this error that you experienced is very interesting.
I just checked the tf_2_9
branch installation on my Nano 4GB running JP4.6.1/2 and conda list shows jetson-gpio
to be version 2.0.20.
TCIII
I see v2.1.1 was released March 8 with the comment:
Fix Jetson Nano ... implementation
I'll try install that when I get my car driving.
@BrianHenryIE - here is a solution from @Heavy02011: sudo chmod 666 /dev/gpiochip*
who encountered the same issue - I'll add this to the docs after I figured out when exactly we have to run this.
I did a fresh install of the tf29 branch yesterday and just calibrated now. I can confirm sudo chmod 666 /dev/gpiochip*
worked to fix the error from this thread.
This time conda list
had jetson-gpio 2.1.1 pypi_0 pypi
(i.e. using 2.1.1 wasn't the solution as hoped).
@BrianHenryIE,
I don't encounter the permissions error when running jetson-gpio
version 2.0.20, therefore getson-gpio version 2.1.1 is causing the error.
TCIII
@DocGarbanzo,
NVIDIA solution for jetson-gpio permissions issue:
If you installed Jetson.GPIO from a package, e.g. using pip into a virtual environment:
sudo cp venv/lib/pythonNN/site-packages/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/
For the new rule to take place, you either need to reboot or reload the udev rules by running:
sudo udevadm control --reload-rules && sudo udevadm trigger
TCIII
Our data from this thread is:
After sudo chmod 666 /dev/gpiochip*
:
I'm under the impression, from https://github.com/NVIDIA/jetson-gpio/issues/79 and https://github.com/NVIDIA/jetson-gpio/releases/tag/v2.1.1, that this will be fixed by Nvidia in a later update.
I'm pretty sure I tried sudo udevadm control --reload-rules && sudo udevadm trigger
earlier without effect but forgot to copy that into my original post. As I said, I did run the cp ... 99-gpio.rules
line.
@BrianHenryIE,
Did you run sudo cp venv/lib/pythonNN/site-packages/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/
before running sudo udevadm control --reload-rules && sudo udevadm trigger
per the NVIDIA solution above?
TCIII
Yes. And rebooted. I tested that just now on a fresh install to be sure:
(donkey) brian@brian-desktop:~$ donkey calibrate --pwm-pin=PCA9685.1:40.1
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.0.dev1 ...
Traceback (most recent call last):
File "/home/brian/mambaforge/envs/donkey/bin/donkey", line 33, in <module>
sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 626, in execute_from_command_line
c.run(args[2:])
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 219, in run
from donkeycar.parts.actuator import PulseController
File "/home/brian/projects/donkeycar/donkeycar/parts/actuator.py", line 19, in <module>
import RPi.GPIO as GPIO
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 1, in <module>
from Jetson.GPIO import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/Jetson/GPIO/__init__.py", line 1, in <module>
from .gpio import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-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.
(donkey) brian@brian-desktop:~$ sudo groupadd -f -r gpio
[sudo] password for brian:
(donkey) brian@brian-desktop:~$ sudo usermod -a -G gpio brian
(donkey) brian@brian-desktop:~$ sudo cp ~/mambaforge/envs/donkey/lib/python3.9/site-packages/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/
(donkey) brian@brian-desktop:~$ sudo udevadm control --reload-rules && sudo udevadm trigger
(donkey) brian@brian-desktop:~$ donkey calibrate --pwm-pin=PCA9685.1:40.1
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.0.dev1 ...
Traceback (most recent call last):
File "/home/brian/mambaforge/envs/donkey/bin/donkey", line 33, in <module>
sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 626, in execute_from_command_line
c.run(args[2:])
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 219, in run
from donkeycar.parts.actuator import PulseController
File "/home/brian/projects/donkeycar/donkeycar/parts/actuator.py", line 19, in <module>
import RPi.GPIO as GPIO
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 1, in <module>
from Jetson.GPIO import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/Jetson/GPIO/__init__.py", line 1, in <module>
from .gpio import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-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.
(donkey) brian@brian-desktop:~$ sudo reboot now
Connection to 192.168.0.139 closed by remote host.
Connection to 192.168.0.139 closed.
(base) brianhenry@Brians-MacBook-Air-2 donkeycar % ssh brian@192.168.0.139
brian@192.168.0.139's password:
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.9.299-tegra aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
47 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
Last login: Sat Apr 22 10:51:31 2023 from 192.168.0.193
(donkey) brian@brian-desktop:~$ donkey calibrate --pwm-pin=PCA9685.1:40.1
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.0.dev1 ...
Traceback (most recent call last):
File "/home/brian/mambaforge/envs/donkey/bin/donkey", line 33, in <module>
sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 626, in execute_from_command_line
c.run(args[2:])
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 219, in run
from donkeycar.parts.actuator import PulseController
File "/home/brian/projects/donkeycar/donkeycar/parts/actuator.py", line 19, in <module>
import RPi.GPIO as GPIO
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 1, in <module>
from Jetson.GPIO import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/Jetson/GPIO/__init__.py", line 1, in <module>
from .gpio import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-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.
(donkey) brian@brian-desktop:~$ cd ~/mycar/
(donkey) brian@brian-desktop:~/mycar$ donkey calibrate --pwm-pin=PCA9685.1:40.1
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.0.dev1 ...
Traceback (most recent call last):
File "/home/brian/mambaforge/envs/donkey/bin/donkey", line 33, in <module>
sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 626, in execute_from_command_line
c.run(args[2:])
File "/home/brian/projects/donkeycar/donkeycar/management/base.py", line 219, in run
from donkeycar.parts.actuator import PulseController
File "/home/brian/projects/donkeycar/donkeycar/parts/actuator.py", line 19, in <module>
import RPi.GPIO as GPIO
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/RPi/GPIO/__init__.py", line 1, in <module>
from Jetson.GPIO import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-packages/Jetson/GPIO/__init__.py", line 1, in <module>
from .gpio import *
File "/home/brian/mambaforge/envs/donkey/lib/python3.9/site-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.
(donkey) brian@brian-desktop:~/mycar$ sudo chmod 666 /dev/gpiochip*
[sudo] password for brian:
(donkey) brian@brian-desktop:~/mycar$ donkey calibrate --pwm-pin=PCA9685.1:40.1
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.0.dev1 ...
WARNING:donkeycar.parts.pins:pigpio was not imported.
init pin PCA9685.1:40.1
Using PWM freq: 60
Enter a PWM setting to test ('q' for quit) (0-1500):
sudo chmod 666 /dev/gpiochip*
does not persist across all reboots.
Marked as solved. Discussion can continue if needed.
When I tried to calibrate my car, I got the error
The current user does not have permissions...
$ donkey calibrate --pwm-pin=PCA9685.1:40.1
I tried a few fixes, the Jetson GPIO docs for setting user permissions:
Which did not work.
Then tried
sudo chmod a+rw /dev/gpiochip0
(as suggested) which changed the error toTypeError: can only concatenate str (not "int") to str
$ donkey calibrate --pwm-pin=PCA9685.1:40.1
I found the issue https://github.com/NVIDIA/jetson-gpio/issues/79 where the official response was:
The TF29 branch installs v2.1:
$ conda list
I installed v2.0.21 using:
pip install --force-reinstall -v "Jetson.GPIO==2.0.21"
And the error went away.