-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dtoverlay=pwm-2chan has no effect on RPi 5 #10
Comments
Hi @schech1, are you using the latest version (0.2.1, check with |
Yes, I'm using 0.2.1 and i also used |
Testing on my Rpi5, no, I don't see |
I'm trying to figure out what I do wrong.
Using |
hm, try the following in
then try the same code, but targeting pin 12. Maybe something is different with the other pins? |
Yeah, that works. |
Okay, interesting, something must be different with RPi5 for the original pins. I'll have to investigate later though. |
This solution works for me as well. Thank you for this library!! |
I still got problems on Pi5. config.txt: python: I get no PWM output on Pin 13. What am i missing? Thanks in advance. |
@wayneOS1337 not sure - did you do a reboot? Can you paste here your entire config.txt file? |
Yes, i did a reboot. My config.txt is:
So basically i just added the But my guess is that the
i also tried to just use |
There is an errant ` at the end of the last line of your config.txt: is that a type in github or your config? |
Yes, sorry that was a typo in my comment. i edited my comment. The file is without it. |
Not sure! How are you measuring PWM on a pin? |
I tested it with a Servo (same settings as on the Pi4) and also with a LED. Did you use Bookworm as OS? or is there any additional Software i need to install? |
I have the same issue with Rpi 5. Even with I see this error on startup: |
Problem is the pwmchip index. I wanted to use GPIO18 pwm ( Works as it should. I haven't tested any other channels or GPIO:s. |
I've released a 0.2.2 version that allows for more chips, thanks to @colinpate for the PR |
Hi there, I`m having a simliar issue. the command
See attachement for /boot/firmware/config.txt file Thanks a lot for helping! |
Hi, |
Hi, thanks for the fast replay. that leads to the same error: my full code is:
|
@bbfjumper perhaps is a kernel issue: https://forums.raspberrypi.com/viewtopic.php?t=367294 (a new kernel was released in the 24-03-12 image) I'll be watching that thread for more |
okay that could be the solution, i assume downgrading would solve the problem, what kernel version are you using? |
I'm using the 6.1.63, from the 2023-12-11 release. |
I'm having the same invalid argument issue with my Raspberry Pi 5 kernel 6.6. Could you instruct me on how to downgrade the kernel to 6.1.63? When I use the legacy version of the 6.1 kernel from Raspberry Pi Imager v1.8.5 for RPi 5, I just can't finish the boot... |
Try downloading an older image from here: https://www.raspberrypi.com/software/operating-systems/ |
with downgrading my kernel to 6.1.63 it works, thanks everbody for helping me. I downgraded with |
The Kernel issue seems to be fixed in 6.6.22 version. I had the same error with 6.6.20, but not with 6.6.22. |
Yes, after updating the kernel from |
Encountered same Invalid Argument issue with my Raspberry Pi5 on Ubuntu 24.04 Kernel 6.8.0.
My code is as followed from rpi_hardware_pwm import HardwarePWM
from time import sleep
pwm=HardwarePWM(0,60,chip=2)#channel 0 1 2 3 for GPIO12 13 18 19 respectively
pwm.start(100)
pwm.change_duty_cycle(0.5/10)
# pwm.change_frequency(25_000)
sleep(2)
pwm.stop() added When I execute the code without sudo, I got error log as followed
When I execute the code with sudo, I got error log showing Invalid Argument
|
For anyone experiencing this issue, following the instructions on this Gist worked for me! |
For anyone else who gets stuck on this on a Pi5:
Then rebooting will enable PWM (chip 2 channel 2) on GPIO 18. it will show GPIO 18 and the fan as being active. Only certain pins can be configured for hardware PWM. see: https://community.element14.com/products/raspberry-pi/m/files/148385 To enable an additional PWM channel you could change the line to
and reboot, which will also enable GPIO 19 (chip 2, channel 3). If you want to use the other channels/pins you need to follow the other instructions in the readme.md of this repo. Also info can be found by running
Other useful commands: |
I added
dtoverlay=pwm-2chan
to/boot/config.txt
on a Raspberry Pi 5, butlsmod | grep pwm
does not show any output.Also there is no pwm-signal generated either on GPIO19 or 18.
The text was updated successfully, but these errors were encountered: