-
Notifications
You must be signed in to change notification settings - Fork 218
PWM Fails on PocketBeagle - "RuntimeError: Problem with the cape manager" #286
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
Comments
@ansarid Please run: |
|
@ansarid It looks like you are a running an update to image. The next step is for me to try to reproduce this issue. I will attempt to reproduce and followup here. |
Thank you for your help! As far as I remember all I have done is flashed Debian 9.5 to a microSD card and followed Adafruit's Adafruit_BBIO install guide for Debian. |
Ok thanks. I just tried running this on a BeagleBone Black and got no exception. I should have access to a PocketBeagle later today to try running on that. |
Yes, the code works fine on the BeagleBone Black, but does not work on the PocketBeagle. |
I have been able to replicate the issue on PocketBeagle:
The print statement shows that it is skipping loading device tree overlays (e.g. "virtual capes") which is correct as the PocketBeagle has a complete device tree binding (DTB) at boot. |
Related code in err = pwm_start(key, duty_cycle, frequency, polarity);
switch (err) {
case BBIO_OK:
break;
case BBIO_ACCESS:
PyErr_SetString(PyExc_IOError, "could not access a necessary file");
return NULL;
case BBIO_SYSFS:
PyErr_SetString(PyExc_RuntimeError, "Problem with a sysfs file");
return NULL;
case BBIO_CAPE:
PyErr_SetString(PyExc_RuntimeError, "Problem with the cape manager");
return NULL; |
This might do the trick: diff --git a/source/c_pwm.c b/source/c_pwm.c
index f983592..ec4183a 100644
--- a/source/c_pwm.c
+++ b/source/c_pwm.c
@@ -339,6 +339,10 @@ BBIO_err pwm_setup(const char *key, __attribute__ ((unused)) float duty, __attri
// Make sure that one of the universal capes is loaded
if( !uboot_overlay_enabled() // only check kernel overlays if u-boot overlays are not being used
&&
+ !beaglebone_blue() // beaglebone blue has complete dtb file and does not need overlays
+ &&
+ !pocketbeagle() // pocketbeagle has complete dtb file and does not need overlays
+ &&
!( device_tree_loaded("cape-univ-audio") // from cdsteinkuehler/beaglebone-universal-io
|| device_tree_loaded("cape-univ-emmc") // ""
|| device_tree_loaded("cape-univ-hdmi") // "" Testing it out |
looks that did resolve the issue:
I'll push a commit. |
pocketbeagle and beaglebone blue have complete dtb file and do not need overlays
I've created a new release: |
I'll test that out today to make sure the pip package works now.
Thank you for your help!
…On Thu, Oct 18, 2018, 2:55 AM Drew Fustini ***@***.***> wrote:
I've created a new release:
Release 1.1.0
<https://github.com./adafruit/adafruit-beaglebone-io-python/releases/tag/1.1.0>
I published it to PyPI and is available to install via pip.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or mute the thread
<https://github.com./notifications/unsubscribe-auth/AEI9TaPOqYGD8W6__GzOUvW5OU3sfJfeks5umDPugaJpZM4XYsUX>
.
|
I just ran into the same problem and verified that @pdp7's fix works. Thanks! |
I have been trying to get PWM working on pins P2_01 and P2_03 on the PocketBeagle but have been unsuccessful. I am using Debian 9.5 and have installed the Adafruit-BBIO library. I do have digital outputs working but no PWM. I wrote a short program to test PWM as seen here:
When I run this program I get the below error:
As you can see, the program fails when starting PWM on the first pin and I have been unable to solve this issue. Also, this code does work perfectly fine on the BeagleBone Black after changing the code to use its PWM pins.
The text was updated successfully, but these errors were encountered: