Can't get BBB to image below 4.1? Really want PWM :\

Hi There,

Im trying to get a basic servo project running on my BBB

I had installed Debian 8.3 (the image provided on the beaglebone page, running the 4.1 kernel) kernel on it and tried to get PWM working without success (apparently both the adafruit and greycat python bbio libraries only work on 3.8), interestingly enough bonescript also refuses to work.

I have tried reverting to earlier images via microsd without success:
-The Device doesnt become reachable via ping to 192.168.7.2 after several hours and attempting to power cycle
-The “External Drive” does not connect to windows upon boot
-While attempting to flash the emmc, the USRleds do not cycle in the ‘cylon’ style.

I’ve tried to make the Debian 8.3 image work, via trying to install an older kernel via apt without success (the device appears to be operating but is unreachable via USB/ping/etc):
“sudo apt-get install linux-image-3.8.13-bone70 linux-headers-3.8.13-bone70 mt7601u-modules-3.8.13-bone70”

I really DON’T know what to do – I would have hoped that PWM would work out of the box on the default Debian 8.3 image. Perhaps there’s something I need to do to make it work that isn’t apparent to a novice like me.

Unfortunately, rolling back to a 3.8 kernel via imaging or apt doesn’t seem to allow the BBB to communicate with my windows machine after attempting to do so, and only 4.1 kernel images seem to work successfully in that sense, with the caveat that PWM doesnt work.

Currently running on my emmc:
BBB-eMMC-flasher-debian-8.3-console-armhf-2016-02-11-2gb.img

Currently running on my microsd:
bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img

No clue what to do, I consider myself a novice in linux, but fairly technical. At this point I’m ready to throw this thing out the window.

Any and all help appreciated!

-Jeff

PWM, should be working on v4.1, what software stack are you using to interface to the pwm’s?

Regards,

Hi Robert,

Thank you VERY kindly for getting back to me. I am a little new to linux, but am trying to learn as I go here, so apologies if I’m not answering very well.

OS:

EMMC flash image: https://rcn-ee.com/rootfs/2016-02-11/flasher/BBB-eMMC-flasher-debian-8.3-console-armhf-2016-02-11-2gb.img.xz
SD image: https://debian.beagleboard.org/images/bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img.xz

Using the stock installed python and adafruit python bbio library included on the SD image.

First step was to see if I could make a PIN go hi/low to flash an LED using python (simple enough)

import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(“P8_10”, GPIO.OUT)
GPIO.output(“P8_10”, GPIO.HIGH)
GPIO.output(“P8_10”, GPIO.LOW)

And the LED hooked to P8_10 works and I can make it blink. Life is good. Huzzah!

Next step… was to TRY to run this in python: (from the adafruit bbb servo tutorial)

import Adafruit_BBIO.PWM as PWM
PWM.start(“P8_13”, 95.0, 60)
PWM.set_duty_cycle(“P8_13”, 97.0) #This Errors with: “IOError: [Errno 2] No such file or directory: ‘/slots’”

PWM.stop(“P8_13”)
PWM.cleanup() #This Errors with: “IOError: [Errno 2] No such file or directory: ‘/slots’”

And nothing happens.

From this point I’ve become successful at horribly confusing myself about listings in /sys/class and /lib/firmware and .dtbo files and /sys/devices/platform/bone_capemgr/slots and have NO idea where to go to get PWM to work in python, let alone how to successfully troubleshoot the issue.

Any and all input appreciated. Really humbling experience thus far.

Thanks

-Jeff

PWM, should be working on v4.1, what software stack are you using to interface to the pwm’s?

Regards,

@Robert, he said here:

I had installed Debian 8.3 (the image provided on the beaglebone page, running the 4.1 kernel) kernel on it and tried to >get PWM working without success (apparently both the adafruit and greycat python bbio libraries only work on 3.8), >interestingly enough bonescript also refuses to work.

Which is adafruits python library, and Alexander Haim’s pybbio libraries. Both are Python. Also, neither are 100% up to date with the newer kernels, but I understand Alexander is working on updating his.

Hi Robert,

Thank you VERY kindly for getting back to me. I am a little new to linux, but am trying to learn as I go here, so apologies if I’m not answering very well.

OS:
EMMC flash image: https://rcn-ee.com/rootfs/2016-02-11/flasher/BBB-eMMC-flasher-debian-8.3-console-armhf-2016-02-11-2gb.img.xz
SD image: https://debian.beagleboard.org/images/bone-debian-8.3-lxqt-4gb-armhf-2016-01-24-4gb.img.xz

Using the stock installed python and adafruit python bbio library included on the SD image.

First step was to see if I could make a PIN go hi/low to flash an LED using python (simple enough)
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(“P8_10”, GPIO.OUT)
GPIO.output(“P8_10”, GPIO.HIGH)
GPIO.output(“P8_10”, GPIO.LOW)

And the LED hooked to P8_10 works and I can make it blink. Life is good. Huzzah!

Next step… was to TRY to run this in python: (from the adafruit bbb servo tutorial)
import Adafruit_BBIO.PWM as PWM
PWM.start(“P8_13”, 95.0, 60)
PWM.set_duty_cycle(“P8_13”, 97.0) #This Errors with: “IOError: [Errno 2] No such file or directory: ‘/slots’”
PWM.stop(“P8_13”)
PWM.cleanup() #This Errors with: “IOError: [Errno 2] No such file or directory: ‘/slots’”

There’s a patch for this but it breaks, 3.8…

For now us pybbio lib.

Hello Robert,

Thank you very kindly for getting back to me.

To clarify, do you mean I should install the greycatlabs bbio package? and its compatible with 4.1? :slight_smile:

Reading:
https://github.com/graycatlabs/PyBBIO/wiki/Installing-PyBBIO

it appears that it is not compatible with anything higher than 3.8?

Tried a couple things without much success:

Wanted to see if it was installed from the getgo (as the adafruit library was) First tried:

from bbio import * #https://github.com/graycatlabs/PyBBIO/wiki/Using-PyBBIO

And got a seg fault
Then further tried to see if the module was actually installed via:

help(‘modules’)
and
pydoc modules

and both seg faulted.

I apologize for being ‘a little slow’ on this front.

Thanks kindly! :slight_smile:

Hello again,

As an addendum – I tried installing the greycat labs bbio via apt-get.
Sadly, every time that I try importing it via python, i get an immediate seg fault.

cannot for the life of me figure out how to make PWM work. It’s frustrating as someone who really wants to learn the platform but isn’t a linux ninja :\

Banging my head on the wall :frowning:

Any and all input is appreciated

Jeff, is there any reason why you need to use python ? Because this should be really easy ( under 20 lines of code ) to get the PWM set, and running in C. Through using Linux sysfs