2

I have wracked my brain and the web attempting teach myself PWM on BBB. I am new to Python and the beagle bone black. All I would like to do is check the PWM with my voltmeter to see that it is changing but the code keeps crashing using:

beaglebone black (Rev. C) which has Debian GNU/Linux 8.4 Jessie pre-installed. I just purchased it very recently.

Debian, a Linux OS, also has Python 2.7.9 installed on it so it can be run from the shell. I am attempting to follow along with this very nice online tutorial by TopTechBoy on Youtube (https://www.youtube.com/watch?v=vAR8v96J3FQ). This video was done in 2015 so I think perhaps a lot may have changed in the world of python and beaglebones to the point where if you run code on current boards, it wont work. All lessons up too now have worked. Here is the code I am attempting to run:

import Adafruit_BBIO.PWM as PWM

for i in range(0,5):
        DC = int(raw_input("What Duty Cycle Would You Like? "))
        PWM.start("P8_13", 0)
        PWM.set_duty_cycle("P8_13", DC)

PWM.stop("P8_13")
PWM.cleanup()

This results in error:

Traceback (most recent call last):
     File "PWM1.py", line 6, in <module>
        PWM.set_duty_cyle("P8_13", DC)
IOError: [Errno 2] No such file or directory: '/slots'

Can anybody help me how to fix this?

rkta
  • 3,959
  • 7
  • 25
  • 37
iawia
  • 21
  • 3

1 Answers1

1

Looks like you are running a deprecated version of that python library. When the function is searching for "slots" I assume, that it is searching for the Capemgr Slots. Those were recently removed from the current debian image for BBB.

Stage 1: Disable Kernel Overlays (bone_capemgr.uboot_capemgr_enabled=1 is passed thru /proc/cmdline)

Stage 2: Disable the slots file (/sys/devices/platform/bone_capemgr/slots) (v4.4.x -> 4.14.x)

Stage 3: Disable bone_capemgr dir (/sys/devices/platform/bone_capemgr/) (v4.15.x+)

You can read this here

Community
  • 1
  • 1
bjoekeldude
  • 338
  • 3
  • 11