Skip to content
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

PyBBIO example program error #13

Closed
SamBerry opened this issue Nov 13, 2012 · 13 comments
Closed

PyBBIO example program error #13

SamBerry opened this issue Nov 13, 2012 · 13 comments

Comments

@SamBerry
Copy link

Hi,

I am fairly new to python, and very new to using the beaglebone.

I followed through your instructions and installed the module fine with no errors. I got to the point where you tested blink.py. However when i try to run it i get the following code in the terminal.

root@beaglebone:~/PyBBIO/examples# python blink.py
Traceback (most recent call last):
File "blink.py", line 7, in
from bbio import *
File "/usr/lib/python2.7/site-packages/bbio/init.py", line 4, in
from bbio import *
File "/usr/lib/python2.7/site-packages/bbio/bbio.py", line 45, in
from config import *
File "/usr/lib/python2.7/site-packages/bbio/config.py", line 340, in
for i in PWM_PINS.keys())
File "/usr/lib/python2.7/site-packages/bbio/config.py", line 340, in

for i in PWM_PINS.keys())

IOError: [Errno 2] No such file or directory: '/sys/class/pwm/ehrpwm.2:1/request
'

It may be something very simple that im missing, but im lost to what it could be. Any help would be much appreciated.

Thanks, Sam

@SamBerry
Copy link
Author

Im also new to github, so i hope i havent put this in the wrong place! if i have is there any where you could redirect me to get an answer.

Thanks

@alexanderhiam
Copy link
Member

You're in the right place, and thanks for letting me know. It looks like you're either missing the PWM kernel module or it has changed; does the /sys/calss/pwm/ directory exist? Have you flashed a new Linux image since you bought the BeagleBone, and if so which one?

@SamBerry
Copy link
Author

Im guessing calss was a typo? And yer it says

root@beaglebone:~# /sys/class/pwm
-sh: /sys/class/pwm: Is a directory

I havent flashed a new linux image no, i was given the beaglebone for my university project and not told anything about it except the PyBBIO module is a good one to own ha. This is the first thing iv attempted to do after setting up the drivers and ethernet connection. Would i need to flash the latest linux image?

@alexanderhiam
Copy link
Member

Yes, typo, sorry.

What revision board do you have?

Could you post the output of these commands:

uname -a

ls /sys/class/pwm

ls /sys/class/pwm/any_of_the_directories_here

@SamBerry
Copy link
Author

I have the Rev A5A bone.

root@beaglebone:~# uname -a
Linux beaglebone 3.2.5+ #1 Mon Feb 13 19:22:44 CET 2012 armv7l GNU/Linux

root@beaglebone:~# ls /sys/class/pwm
ecap.0 ecap.1 ehrpwm.0:0 ehrpwm.0:1 ehrpwm.1:0 ehrpwm.1:1

root@beaglebone:~# ls /sys/class/pwm/ehrpwm.0:0
device duty_percent period_ns power run tick_hz
duty_ns period_freq polarity request subsystem uevent

Thank you for the continued help!

@alexanderhiam
Copy link
Member

Thanks for the info, just pushed a fix. It should install after a 'git pull'. The image you're running is a bit outdated, and it doesn't have the drivers for both the available PWM modules. The fix disables the PWM2 module, so PWM2A and PWM2B won't be available.

@SamBerry
Copy link
Author

Thanks for the help, however I updated to the current version and tried to run the example program but I got the exact same errors.

Warning: you seem to have an BeagleBone image which only has drivers
For the PWM1 module, PWM2A and PWM2B will not be available in PyBBIO.
You should consider updating Angstrom!
Finished installing, enjoy!
root@beaglebone:/PyBBIO# cd examples
root@beaglebone:
/PyBBIO/examples# python blink.py
Traceback (most recent call last):
File "blink.py", line 7, in
from bbio import *
File "/usr/lib/python2.7/site-packages/bbio/init.py", line 4, in
from bbio import *
File "/usr/lib/python2.7/site-packages/bbio/bbio.py", line 45, in
from config import *
File "/usr/lib/python2.7/site-packages/bbio/config.py", line 340, in
for i in PWM_PINS.keys())
File "/usr/lib/python2.7/site-packages/bbio/config.py", line 340, in

for i in PWM_PINS.keys())

IOError: [Errno 2] No such file or directory: '/sys/class/pwm/ehrpwm.2:1/request
'

@alexanderhiam
Copy link
Member

Strange, you shouldn't be getting that error now, try:

rm -rf /usr/lib/python2.7/site-packages/PyBBIO* /usr/lib/python2.7/site-packages/bbio/

which will uninstall PyBBIO, then install it again.

@SamBerry
Copy link
Author

That did the trick! Thank you for the great help!

@alexanderhiam
Copy link
Member

Glad to hear it!

@gragib
Copy link

gragib commented May 19, 2013

Hmmm... I'm using a Beaglebone Black and I'm getting the same error.

root@beaglebone:~/PyBBIO/examples# python BBIOServer_test.py
Traceback (most recent call last):
  File "BBIOServer_test.py", line 13, in <module>
    from bbio import *
  File "/usr/lib/python2.7/site-packages/bbio/__init__.py", line 4, in <module>
    from bbio import *
  File "/usr/lib/python2.7/site-packages/bbio/bbio.py", line 45, in <module>
    from config import *
  File "/usr/lib/python2.7/site-packages/bbio/config.py", line 416, in <module>
    for i in PWM_PINS.keys())
  File "/usr/lib/python2.7/site-packages/bbio/config.py", line 416, in <genexpr>
    for i in PWM_PINS.keys())
IOError: [Errno 2] No such file or directory: '/sys/class/pwm/ehrpwm.1:1/request'
root@beaglebone:~/PyBBIO/examples# uname -a
Linux beaglebone 3.8.13 #1 SMP Mon May 13 21:41:24 CEST 2013 armv7l GNU/Linux
root@beaglebone:~/PyBBIO/examples# ls /sys/class/pwm
export  unexport

I uninstalled and reinstalled PyBBIO with no luck.

@gragib
Copy link

gragib commented May 19, 2013

I guess this explains it.

@javi7
Copy link

javi7 commented Jun 13, 2013

were you able to find an image with kernel 3.2 or lower?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants