Looks like there are some GPIO-related changes in L4T r35.4.1 and I’m curious what the recommended way to deal with them is.
Under r32.7.3, we can use Jetson.GPIO to read the same GPIO pin from multiple processes, while in r35.4.1, once our main process (running under docker) opens a GPIO, I can never read from it elsewhere (even after exiting Docker)
Suggestions for how to get this functionality back? Or do I need to write a kernel driver :(
Here’s an example script:
import Jetson.GPIO as gp
gp.setmode(gp.TEGRA_SOC)
XIN1='SPI3_CS1_N'
# set pin as input
gp.setup(XIN1, gp.IN)
print(gp.input(XIN1))
…under L4T r32.7.3, I get a warning, but it reads:
/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py:386: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings
RuntimeWarning)
0
…while under L4T r35.4.1, I get an error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio_cdev.py", line 167, in open_line
fcntl.ioctl(ch_info.chip_fd, GPIO_GET_LINEHANDLE_IOCTL, request)
OSError: [Errno 16] Device or resource busy
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./test2.py", line 6, in <module>
gp.setup(XIN1, gp.IN)
File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 344, in setup
_do_one_channel(ch_info, direction, initial, consumer)
File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 155, in _do_one_channel
gpio_cdev.open_line(ch_info, request)
File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio_cdev.py", line 169, in open_line
raise GPIOError(e.errno, "Opening output line handle: " + e.strerror)
Jetson.GPIO.gpio_cdev.GPIOError: [Errno 16] Opening output line handle: Device or resource busy