mraa icon indicating copy to clipboard operation
mraa copied to clipboard

BeagleBone Green Wireless - PWM won't initialize

Open fzc20070415 opened this issue 5 years ago • 2 comments

When I tried to initialize Pwm, it fails:

>>> import mraa
>>> x = mraa.Pwm(62)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/mraa.py", line 580, in __init__
    this = _mraa.new_Pwm(pin, owner, chipid)
ValueError: Error initialising PWM on pin

And the system journal gives the following log:

Aug 22 13:31:54 beaglebone libmraa[1577]: pwm: pin 62 not initialized

Did I miss a step?

fzc20070415 avatar Aug 22 '19 13:08 fzc20070415

I have the same error. Did you solved the issue?

Alijafr avatar Mar 08 '20 10:03 Alijafr

I worked around it by writing to the /sys/class/pwm/pwmchip0/export to enable the pin. Then /sys/class/pwm/pwm-0:0/ area to set up the period, duty cycle and then enable it. BB overlays changed the /sys/class/pwm structure in the different releases. So I am not using MRAA for pwm at this time.

Best of luck.

Chuckduey avatar Mar 08 '20 20:03 Chuckduey