No such file or directory: '/dev/gpiochip0'
I installed the module python-periphery to use the GPIO, but there is a problem when calling.
>>> from periphery import GPIO >>> GPIO("/dev/gpiochip0", 11, "out") Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/periphery/gpio.py", line 355, in _open self._chip_fd = os.open(path, 0) FileNotFoundError: [Errno 2] No such file or directory: '/dev/gpiochip0' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.6/site-packages/periphery/gpio.py", line 338, in __init__ self._open(path, line, direction) File "/usr/lib/python3.6/site-packages/periphery/gpio.py", line 357, in _open raise GPIOError(e.errno, "Opening GPIO chip: " + e.strerror) periphery.gpio.GPIOError: [Errno 2] Opening GPIO chip: No such file or directory
@CAP-33 Why would you not use onion-gpio-sysfs, I'm not sure periphery is supported on OpenWrt, but I may be wrong. But it's python so ....
@CAP-33 Maybe Lazar has some advice then.
My advice is to use a real programing language
@CAP-33 what firmware are you running? Here's what I see on a device on v0.3.2 b232:
# ls /dev/gpio* /dev/gpiochip0 /dev/gpiochip1 /dev/gpiochip2
We've generally used the sysfs gpio interface: https://www.kernel.org/doc/html/latest/admin-guide/gpio/sysfs.html
But I've just learned that sysfs has been deprecated since linux 4.8 and that descriptor-based access (through /dev/gpiochipN) is the new way to go (see article here) ...
ls /dev/gpio* ls: /dev/gpio*: No such file or directory
@CAP-33 wouldn't the logical conclusion be that your first step would be to upgrade to the latest firmware?