Section 1.
Shown below are the displayed errors trying to turn an led on a circuit board using rj_Led.py. Note this file worked as programmed prior to me executing the commands listed in Section 3.
The errors displayed after running python3 rj_Led.py are shown in Section 2.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)
GPIO.output(7,True) # GPIO.output(7,1)
time.sleep (20)
GPIO.output(7,0)
GPIO.cleanup()
Section 2.
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio_cdev.py”, line 147, in chip_open
PermissionError: [Errno 13] Permission denied: ‘/dev/gpiochip1’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “rj_Led.py”, line 5, in
GPIO.setup(7,GPIO.OUT)
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio.py”, line 360, in setup
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio.py”, line 155, in _do_one_channel
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio_cdev.py”, line 184, in chip_open_by_label
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio_cdev.py”, line 158, in chip_check_info
File “/usr/local/lib/python3.6/dist-packages/Jetson.GPIO-2.1.6-py3.6.egg/Jetson/GPIO/gpio_cdev.py”, line 149, in chip_open
Jetson.GPIO.gpio_cdev.GPIOError: [Errno 13] Opening GPIO chip: Permission denied
bob@bob-desktop:~/jetson-gpio$
Section 3
The term command line commands that caused the errors are shown below:
cd
git clone -b v2.0.21 GitHub - forecr/jetson-gpio
You can use this library directly but there could be a conflict between pre-installed library.
To solve this, copy “jetson-gpio/lib/python/Jetson/GPIO/gpio_pin_data.py” file over the pre-installed library.
cd jetson-gpio
-
sudo mv /usr/lib/python2.7/dist-packages/Jetson/GPIO/gpio_pin_data.py /usr/lib/python2.7/dist-packages/Jetson/GPIO/gpio_pin_data_backup.py
-
sudo mv /usr/lib/python3/dist-packages/Jetson/GPIO/gpio_pin_data.py /usr/lib/python3/dist-packages/Jetson/GPIO/gpio_pin_data_backup.py
-
sudo cp lib/python/Jetson/GPIO/gpio_pin_data.py /usr/lib/python2.7/dist-packages/Jetson/GPIO/gpio_pin_data.py
-
sudo cp lib/python/Jetson/GPIO/gpio_pin_data.py /usr/lib/python3/dist-packages/Jetson/GPIO/gpio_pin_data.py
Warmly, Bob