BBAI64: GPIO numbers

Hello @lorforlinux ,

I know it is late for now. I was up late tonight testing some Capes for the BBAI-64. I found this a while back and remembered it.

First off, how are you doing? Secondly, is there a way figure out the GPIO that works w/ the enable part of the source in this file?

set_pin = Path("/sys/class/gpio/gpiochip496/direction") # Here

Or…would I just search things in the TRM to look for GPIO registers to offset?


P.S. No rush if you are busy. If you have time, this would be neat to make work.

@lorforlinux ,

Seth here again…

  1. Is there a way to configure the GPIO on the BBAI-64 to have an enable pin GPIO for starting and stopping the PCA9685 onboard the Servo Cape?
  2. If not, and if I have to export the GPIO from some directory/file, what exact GPIO should I use and in which file is this GPIO located.

I will keep searching.



I need my enable pin. What I did was use the older source to find the GPIO_68 or P8_10 on the am335x/BBB board(s). Then, I acted like using the same thought process would work. I went to P8_10 on the BBAI-64 and looked up the correct GPIO location.

How would I export pins on the BBAI-64 board for GPIO use?

Would I just say 1 * 32 + 14 = GPIO_46 or would I use another formula to handle this instance of muxing?


Hey @silver2row, for exact GPIO numbers checkout the documentation below,

It also contains a little guide section to control the GPIO pins, pasting it below for reference but you should read it on docs and try it out for some pins to understand better.

# to set the GPIO pin state to HIGH
debian@BeagleBone:~$ gpioset X Y=1

# to set the GPIO pin state to LOW
debian@BeagleBone:~$ gpioset X Y=0

For Example:

| Pin     | P8.03    |
| GPIO    | 1 20     |

Use the commands below for controlling this pin (P8.03) where X = 1 and Y = 20

# to set the GPIO pin state to HIGH
debian@BeagleBone:~$ gpioset 1 20=1

# to set the GPIO pin state to LOW
debian@BeagleBone:~$ gpioset 1 20=0

If you want a simple enable disable function via sysfs I would recommend you to go with BONE_LED bus and use the overlay below.

If you are new to overlays on AI-64 you can checkout the link below,

Let me know if that resolves your queries.

1 Like

Hello @lorforlinux ,

Seth here. I think this is the issue. I use the gpiod (Python) or libgpiod-dev (C), either/or really, and the source in Python puts me on an error on output as:

Device or resource busy

Now, I will look at the overlays. Thank you. I will try to update the machine too. Thank you.


P.S. I am using Python mostly handling import gpiod and this error of sorts keeps popping up.

I thought it was due to the gpiochip or gpio not being listed or available for use to on/off the PCA9685 onboard the Servo Cape. I still think it is b/c of me not being able to establish a connection to the gpiochip via gpiod in Python. I will keep trying. Thank you again for supporting this instance.

I will try that overlay and sysfs and see how far I get!

@lorforlinux ,

Okay. Back to reality. Sorry.

  • I have /sys/class/leds/BONE-LEDS_P8_03.dts now!
  • I built it …
  • I changed it …
  • I am still changing things …

I am installing it and adding it in.


P.S. I put in a bunch of ideas already. I think permissions are the main issue w/ my system right now. I think, and I know it is probably too late to get into it tonight, something is wrong w/ the Python on the install. I have Python3 in its respectful place, i.e. /usr/bin/. The issue is when I use chmod a+x . Even just +x comes back w/ output stating that:

-bash: ./ /usr/bin/python3^M: bad interpreter: No such file or directory

I will look this error up tomorrow. Sorry for all the trouble.

I got it…the overlay BBORG_SERVO-00A2.dtbo works and w/out the enable/disable pin.

I have not quite figured out how to manage the servo(s) well enough yet but one works until it dies (cheap servo).

Probably too much current or power or just a cheap servo motor. Thank you…


The overlay fooled me along w/ the GPIO in question. I thought it was P8_16 but it is not.

Oh and chmod +x and running ./ creates the above issue in case anyone knows what is going on w/ that idea.

@lorforlinux ,

Sir, check this out…

I have a video of the AI-64 w/ the Servo Cape and it is going from degree 0, to degree 90, and then to the maximum. Which in my case w/ this servo is about 180 degrees. The flask app is running and the source, this html page that is rendered, allows for communication back to the servo via the Servo Cape and source running on the BBAI-64.

Also…changing some permissions proved valuable (I think). A lot of the files so far are only accessed via root. So, instead of running sudo python3, I just used chown to alter the groups and permissions.

Also, the chmod command does nothing so far, i.e. chmod +x does not allow for my usage of ./ for whatever reason. I get that error code from above: The Video!


P.S. Enjoy and thank you.

Hey Seth,

Your setup looks great, are you using the overlay for the servo cape?
Please let me know if the instructions in the post below works well for you.

Deepak Khatri

Hello @lorforlinux ,

Seth here. Yes sir. I am using the overlay under v5.10.x-ti-unified after making the install_arm64.

I will test the post soon. The only issue I found so far is that the GPIO which enables the PCA9685 onboard the Servo Cape stay high no matter if I try to turn it off or on.

I will figure out what I did and reply then…


P.S. I can show you the files if necessary. So, this way people can find the info easily. I will retire for tonight. I will reread the post.

@silver2row, Congrats on getting this working.

Do you know if there was a regression in the i2c driver? Is your version still working? Did you do anything special to get it to work?

Some months ago, I purchased a ServoCape to learn about devicetree overlays and i2c. Just this morning I tried to fire it up but, ran into the same issue that @eileen ran into here.

Thanks for any tips.


1 Like


@FredEckert , for smbus2 (pure python3), there are some guidance instructions here: GitHub - silver2row/ServoCape: Servo Cape for the BeagleBone Black .

I fellow named Ben helped me a lot on this project.

So far, I can control servos…

I also made a small write up on BeagleBone AI-64, Servo Cape, and Making Motors Move! -

The second link, the one to the page online, has a small back and forth on the bottom of the instructional.

It may give some extra clues.


P.S. If it does not work, just go ahead and give some commands on:

cat /etc/dogtag


uname -a

I will post some more in time.

Seth, Thanks for this info. I will check it all out. I just saw that @lorforlinux is going to test everything on the latest linux image. I will standby for his update.


1 Like

No issue Fred,

Seth here once more…

@lorforlinux may be in some upper management of handling DTS and kernel DTS configs w/ u-boot. @lorforlinux , are you? Anyway, I hope things go well.

That was a small write up on what I have found so far. W/ the .dts for the automatically found or not found dtbo, it works out of the box.