Skip to content

Setting edge on cdevV2 GPIO raises an OSError 22 of "Invalid Argument" #70

Description

@RobertDeRose
>>>input=pp.GPIO("/dev/gpiochip3", 10, "in", inverted=True, drive="default")
>>>input.edge="falling"Traceback (mostrecentcalllast):
File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line269, in_reopenfcntl.ioctl(self._chip_fd, Cdev2GPIO._GPIO_V2_GET_LINE_IOCTL, line_request)
OSError: [Errno22] InvalidargumentDuringhandlingoftheaboveexception, anotherexceptionoccurred:
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line525, in_set_edgeself._reopen(self._direction, edge, self._bias, self._drive, self._inverted)
File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line271, in_reopenraiseGPIOError(e.errno, "Opening input line handle: "+e.strerror)
periphery.gpio.GPIOError: [Errno22] Openinginputlinehandle: Invalidargument>>>input.edge="rising"Traceback (mostrecentcalllast):
File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line269, in_reopenfcntl.ioctl(self._chip_fd, Cdev2GPIO._GPIO_V2_GET_LINE_IOCTL, line_request)
OSError: [Errno22] InvalidargumentDuringhandlingoftheaboveexception, anotherexceptionoccurred:
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line525, in_set_edgeself._reopen(self._direction, edge, self._bias, self._drive, self._inverted)
File"/root/gpio_controller/.venv/lib/python3.10/site-packages/periphery/gpio_cdev2.py", line271, in_reopenraiseGPIOError(e.errno, "Opening input line handle: "+e.strerror)
periphery.gpio.GPIOError: [Errno22] Openinginputlinehandle: Invalidargument>>>input.__class__.__name__'Cdev2GPIO'

OS: Linux rock-3b 5.10.160-legacy-rock-3b #1 SMP Thu Feb 29 08:50:21 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
Installed version: python-periphery 2.4.1

Because of this issue, poll and read_event do not work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions