After completing the write operation to export, an immediate write to duty_cycle or enable fails with this exception. If the code sleeps after the write to export then the write operation to duty_cycle or enable operates successfully. I validated this error on Pi4 and Pi5, both have the same exception except Pi5 is thru pwmchip2.
On the Pi5 the minimum sleep time for success is 25 ms.
Is this an expected behavior ?
If yes expected, how can I program to test that the export operation has completed ?
Pi4 bullseye
uname -a
Linux raspi8Dev 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Pi4 bookworm
uname -a
Linux raspi8Dev 6.6.22-v8-16k+ #1747 SMP PREEMPT Wed Mar 27 17:06:56 GMT 2024 aarch64 GNU/Linux
Pi5 bookworm
uname -a
Linux raspberrypi 6.6.22-v8-16k+ #1747 SMP PREEMPT Wed Mar 27 17:06:56 GMT 2024 aarch64 GNU/Linux
[main] ERROR com.pi4j.plugin.linuxfs.provider.pwm.LinuxFsPwm - /sys/class/pwm/pwmchip0/pwm0/duty_cycle
java.nio.file.AccessDeniedException: /sys/class/pwm/pwmchip0/pwm0/duty_cycle
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
at java.base/java.nio.file.Files.write(Files.java:3512)
at java.base/java.nio.file.Files.writeString(Files.java:3734)
at java.base/java.nio.file.Files.writeString(Files.java:3674)
at com.pi4j.plugin.linuxfs@2.5.1-SNAPSHOT/com.pi4j.plugin.linuxfs.internal.LinuxPwm.setDutyCycle(LinuxPwm.java:327)
On the Pi5 the minimum sleep time for success is 25 ms.
Is this an expected behavior ?
If yes expected, how can I program to test that the export operation has completed ?
Pi4 bullseye
uname -a
Linux raspi8Dev 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Pi4 bookworm
uname -a
Linux raspi8Dev 6.6.22-v8-16k+ #1747 SMP PREEMPT Wed Mar 27 17:06:56 GMT 2024 aarch64 GNU/Linux
Pi5 bookworm
uname -a
Linux raspberrypi 6.6.22-v8-16k+ #1747 SMP PREEMPT Wed Mar 27 17:06:56 GMT 2024 aarch64 GNU/Linux
[main] ERROR com.pi4j.plugin.linuxfs.provider.pwm.LinuxFsPwm - /sys/class/pwm/pwmchip0/pwm0/duty_cycle
java.nio.file.AccessDeniedException: /sys/class/pwm/pwmchip0/pwm0/duty_cycle
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
at java.base/java.nio.file.Files.write(Files.java:3512)
at java.base/java.nio.file.Files.writeString(Files.java:3734)
at java.base/java.nio.file.Files.writeString(Files.java:3674)
at com.pi4j.plugin.linuxfs@2.5.1-SNAPSHOT/com.pi4j.plugin.linuxfs.internal.LinuxPwm.setDutyCycle(LinuxPwm.java:327)
Statistics: Posted by taartspi — Mon Apr 08, 2024 8:23 pm — Replies 0 — Views 6