|
This post was finally edited by aksyde at 2023-11-29 06:53
Hi!
Has anyone succeed to play with this ePaper screen
https://www.waveshare.com/wiki/2.13inch_Touch_e-Paper_HAT_Manual#python
on the orange pi zero 2W ?
I have download the required files, and install all required pip package.
I have also set the proper permission to gpio/spi/i2c, following this
https://forum.up-community.org/discussion/2141/solved-tutorial-gpio-i2c-spi-access-without-root-permissions
but i still get
- [Errno22] Invalid argument
Copy code which, as far as I understand, seems to be related to this kind of error
- orangepi@orangepizero2w ~ echo 3 > /sys/class/gpio/export
- write: Invalid argument</div>
Copy code as a MWE i tried
- <div>import OPi.GPIO as GPIO
- import time
- #We need this
- from os import geteuid
- # Pin Definitions:
- ledPin = 4
- # Pin Setup:
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output
- #If we're not root, sleep 100ms in order for udev to set
- #the permissions on the exported GPIO right
- if(geteuid() > 0):
- time.sleep(0.1)
- print("Here we go! Press CTRL+C to exit")
- try:
- while 1:
- GPIO.output(ledPin, GPIO.HIGH)
- time.sleep(0.5)
- GPIO.output(ledPin, GPIO.LOW)
- time.sleep(0.5)
- except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly:
- GPIO.cleanup() # cleanup all GPIO</div>
Copy code
but i get- OSError: [Errno 22] Invalid argument
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "/tmp/test.py", line 11, in <module>
- GPIO.setup(ledPin, GPIO.OUT) # LED pin set as output
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- File "/home/orangepi/code/venv/lib/python3.11/site-packages/OPi/GPIO.py", line 480, in setup
- raise e
- File "/home/orangepi/code/venv/lib/python3.11/site-packages/OPi/GPIO.py", line 472, in setup
- sysfs.export(pin)
- File "/home/orangepi/code/venv/lib/python3.11/site-packages/OPi/sysfs.py", line 37, in export
- with open(path, "w") as fp:
- OSError: [Errno 22] Invalid argument
Copy code many thanks!
|
|