0

Still issue with PWM on Ubuntu 16.04.2 TLS
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Fri Jul 07, 2017 8:36 am

Hello,

I am still receiving the "Problem with the cape manager" error when using the BBIO library on the beaglebone black.

OS is ubuntu 16.04.2
Python 3.4, I run python as root in this case (next step will be to run PWM as normal user)

I followed the instructions I found on the github BBIO site, issue 136 where the issue was that the cape overlays were not loaded, specifically I ran:

git clone https://github.com/beagleboard/bb.org-overlays
cd ./bb.org-overlays
sudo ./install.sh

and then I updated am335x_evm.sh by running git pull in /opt/scripts

I also checked the forum, viewtopic.php?f=49&t=111888&p=563344&hilit=PWM#p563344

and followed the instructions:

git clone https://github.com/cdsteinkuehler/beagl ... iversal-io
cd beaglebone-universal-io
sudo make install

After rebooting (which I did during each step) I still get the "problem with cape manager" error.

Any suggestions on what more I can check?

Thanks!

Henk

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by drewfustini on Fri Jul 07, 2017 9:53 pm

Please run strace so that we can see what file i/o occurs before that error:

strace -f -o strace.log python test.py


Change test.py to the name of your program.

Then either attach strace.log to your post or upload it to GitHub Gist

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Sat Jul 08, 2017 5:00 am

Thanks for your reply,

I have created a gist at: https://gist.github.com/henkwitte/8b0f4 ... _pwm_error

The command I run is (I need to run pwm with root permissions, but root does not know where my python lives):

sudo strace -f -o strace.log /home/groenhol/miniconda3/bin/python3.4 test.py

The test program is just the adafruit example:

import Adafruit_BBIO.PWM as PWM
#PWM.start(channel, duty, freq=2000, polarity=0)
PWM.start("P9_14", 50)

(PS: GPIO runs well and I have managed to get that to run under the normal user account with assigning the group gpio and creating an udev config file, not yet succesfully for PWM).

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by drewfustini on Sat Jul 08, 2017 1:34 pm

Thanks. Please also paste the output of these commands:

cat /boot/uEnv.txt
cat /proc/cmdline
cat /sys/devices/platform/bone_capemgr/slots

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Sat Jul 08, 2017 5:05 pm

The results of cat /boot/uEnv.txt are included in the attached file

cat /proc/cmdline are:

console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet cape_universal=enable

and cat /proc/cmdline:
console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet cape_universal=enable
groenhol@arm:~$ cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
Attachments
uenv.txt
(2.19 KiB) Downloaded 181 times

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by drewfustini on Sun Jul 09, 2017 5:13 am

I can't seem to replicate this issue in the Debian Jessie image. I'll have to try with Ubuntu.

What link did you use for the Ubuntu 16.04.2 image?

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Sun Jul 09, 2017 11:30 am

Hi, I used the ubuntu-16.04.2-console-armhf-2017-06-12-2gb.img.xz image

https://rcn-ee.com/rootfs/2017-06-12/mi ... 2gb.img.xz

With debian unfortunatly I have problems with bacnet-ip which is why i switched to ubuntu. The controller we are developing needs both the hardware io and bacnet ip to function

Henk

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by drewfustini on Mon Jul 10, 2017 1:14 am

Thanks for the link.

Is bacnet ip an ubuntu package?

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Mon Jul 10, 2017 4:41 am

No, it is a python package:

https://github.com/ChristianTremblay/BAC0

based on:

http://bacpypes.sourceforge.net/

However, I could not get that package to run under debian, but I could run it on ubuntu

In the mean time I have also tested with the debian jessie image, to see if I made a mistake in the installation. But the PWM code works on debian.

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Mon Jul 10, 2017 5:00 am

So this is weird: having tried with debian I shut down the beaglebone and restarted with the SD containing the ubuntu image. Now the /sys/class/pwm directory is emtpy!

cat /sys/devices/platform/bone_capemgr/slot
cat: /sys/devices/platform/bone_capemgr/slot: No such file or directory

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Mon Jul 10, 2017 5:07 am

I found a site describing how to use pwm with ubuntu:

https://www.teachmemicro.com/beaglebone ... vice-tree/

perhaps it is worthwhile trying that however when I try to

git clone https://github.com/beagleboard/bb.org-o ... er/src/arm

i get an error: the repository cannot be found

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by drewfustini on Mon Jul 10, 2017 10:06 pm


drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Tue Jul 11, 2017 5:37 am

Thanks,

I have been following the instructions on https://www.teachmemicro.com/beaglebone ... vice-tree/ with the following results:

git clone https://github.com/beagleboard/bb.org-overlays
cd bb.org-overlays/src/arm

compile the overlay:
dtc -O dtb -o BB-PWM1-00A0.dtbo -b 0 -@ BB-PWM1-00A0.dts

I then tried to move it to the /lib/firmware folder:
sudo mv -i BB-PWM1-00A0.dtbo /lib/firmware

but the system informed me the file already existed, so I decided to keep it (not replace it).

Then
echo BB-PWM1 > /sys/devices/platform/bone_capemgr/slots

cat /sys/devices/platform/bone_capemgr/slots now shows:
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
4: P-O-L- 0 Override Board Name,00A0,Override Manuf,BB-PWM1

In the /sys/class/pwm folder I now again have a folder pwmchip0

I can go into this folder and echo 0 > export, which created a pwm0 folder.

with

root@arm:/sys/class/pwm/pwmchip0/pwm0# echo 1000000000 > period
root@arm:/sys/class/pwm/pwmchip0/pwm0# echo 800000000 > duty_cycle
root@arm:/sys/class/pwm/pwmchip0/pwm0# echo 1 > enable

I can blink a LED connected to P9_14

So essentially it is functional.

Still, if I run the adafruit example it comes up with "problem with cape manager"

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Tue Jul 11, 2017 5:52 am

On thing I found, in /lib/firmware there are only 3 PWM dtbo files, but there should be six? Could that be an issue?

root@arm:/home/groenhol# ls /lib/firmware/BB-PWM*
/lib/firmware/BB-PWM0-00A0.dtbo /lib/firmware/BB-PWM2-00A0.dtbo
/lib/firmware/BB-PWM1-00A0.dtbo

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Re: Still issue with PWM on Ubuntu 16.04.2 TLS

by henkwitte59 on Tue Jul 11, 2017 6:38 am

Now I also have issues with ADC:

>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
- A cape with a conflicting pin mapping is loaded
- A device tree object is loaded that uses the same name for a fragment: helper

henkwitte59
 
Posts: 20
Joined: Mon Sep 05, 2016 2:33 pm

Please be positive and constructive with your questions and comments.