OctoPrint-Enclosure icon indicating copy to clipboard operation
OctoPrint-Enclosure copied to clipboard

PWM Duty cycle not correct

Open Zounich opened this issue 2 years ago • 1 comments

Hi vitormhenrique,

I am using octoprint on a Raspberry PI 2B. With GPIO 23 I control a lamp via pwm.

image

After I have saved the configuration, I can dim the lamp. However, I have 2 problems:

1: If I set 10% in the enclosure plugin, I get 16% on the GPIO.

2: The PWM signal is interrupted and for a few ms. the GPO spent 100%.

Here is the log:

2022-01-19 23:36:18,994 - octoprint.plugins.enclosure - INFO - Setting GPIO mode to BCM 2022-01-19 23:36:18,996 - octoprint.plugins.enclosure - INFO - Setting GPIO pin 13 as PWM 2022-01-19 23:36:18,998 - octoprint.plugins.enclosure - INFO - starting PWM on pin 13

When I check the GPIO configuration, GPIO 23 shows as OUT and not ALT0.

image

If I configure PWM via the terminal and control it there, it works without errors.

Do you have an idea where the cause for this could be?

Best Regards Zounich

Zounich avatar Jan 19 '22 22:01 Zounich

I have no clue what is going on. I use python libraries, so if you create scripts on python with the same libraries do the error still happens? I'm guessing those are erros on the libraries.

vitormhenrique avatar Feb 28 '22 17:02 vitormhenrique