Closed peterjeschke closed 4 years ago
I would try upgrading to mraa 2.1 as it includes, https://github.com/eclipse/mraa/commit/63de2c4c3afd1e291f5cbc00d2f840214a0f3e87 Which addresses some PWM issues with the Rock PI
Updating to 2.1 does not fix the error.
Hi @peterjeschke, pwm pins are set to 0 when closed, you can see this in the pwm.c file here, so this is really expected behavior. Individual MRAA platforms have the option to override this behavior though, where needed. It was implemented as such for the generic case because Buzzers and LEDs would stay on otherwise. If your fan works as 0 - ON, my suggestion would be to reinitialize the same pin as a GPIO at the end of your script and write a 1 before exit.
Thank you, @Propanu ! I understand, why this is the logical behaviour. I'll close the ticket.
I have a RockPi 4 with a simple fan connected via PWM1. When the rockpi is booted, the fan is off.
Then I run the following python script:
While the script is running, the fan stays off, as expected (writing 0 would enable it). However, when the script finishes, the fan suddenly turns on! I don't know why the pwm would suddenly activate. I expect the fan to stay off.
jounalctl gives nothing interesting here:
The printError statements all print a success message:
Why does this happen?