RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello,

I have tried to figure out which Adafruit_BBIO I am running on my BBB but to no avail. Do you know? How can I find out this info?

Seth

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

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by drewfustini »

Try running this command:
python -c "import Adafruit_BBIO; print Adafruit_BBIO"

For example, this is the output on my beaglebone:

Code: Select all

debian@beaglebone:~$ python -c "import Adafruit_BBIO; print Adafruit_BBIO"
<module 'Adafruit_BBIO' from '/usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.10-py2.7-linux-armv7l.egg/Adafruit_BBIO/__init__.pyc'>

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello Sir,

I downgraded to 1.0.5 when that fellow Yoder was writing the I2C driver as Adafruit_I2C. I then upgraded to 1.0.10 again. I downgraded from kernel 4.14.x to 4.9.x again.

uname -a:

Code: Select all

Linux beaglebone 4.9.82-ti-r102 #1 SMP PREEMPT Thu Feb 22 01:16:12 UTC 2018 armv7l GNU/Linux
cat /etc/dogtag:

Code: Select all

BeagleBoard.org Debian Image 2018-02-18
uEnv.txt:

Code: Select all

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.9.82-ti-r102
#uuid=
#dtb=


###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_uio (4.4.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###
If you notice anything that is different on my system compared to your system, please let me know. I got 1.0.5 to work partially but not the 1.0.10 yet.

Seth

P.S. Thank you for the cmd to find out which Adafruit_BBIO is running on my system. Oh and sir, do I need Adafruit_Python_GPIO library to run specific software on my system? I do not have Adafruit_BBIO in that specific PATH. I tested your cmd and it stated:

Code: Select all

debian@beaglebone:~$ python -c "import Adafruit_BBIO; print Adafruit_BBIO"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named Adafruit_BBIO

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello Sir,

I checked the PATH and Adafruit_BBIO is located where it should be, i.e. in usr/local/lib/python2.7/dist-packages.

Seth

P.S. There is nothing to see in my 1.0.10 Adafruit_BBIO software. I checked the file. It is empty.

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

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by drewfustini »

Please try running python as root with sudo.

This will make sure Adafruit_BBIO is up-to-date.
sudo pip install --upgrade Adafruit_BBIO

This will print out which version is installed:
sudo python -c "import Adafruit_BBIO; print Adafruit_BBIO"

This will list the Adafruit libraries installed:
ls -ltar /usr/local/lib/python2.7/dist-packages/|grep -i adafruit

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello Sir,

Seth here agan and again. I am receiving

Code: Select all

no module named Adafruit_BBIO
when I type in the cmd you gave me. I upgraded like you said w/ sudo and used sudo when applying the cmd.

Seth

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

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by drewfustini »

You could also install from source using these commands:

Code: Select all

sudo apt-get update
sudo apt-get install build-essential python-dev python-pip -y
git clone git://github.com/adafruit/adafruit-beaglebone-io-python.git
cd adafruit-beaglebone-io-python
sudo python setup.py install

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello...

I got it now. The Adafruit_BBIO is now installed and working...sort of. Now, as you know, I use the Motor Bridge Cape from Seeed Studio on a BBB/BBG/BBGW/BBBW. In my experience, the I2C driver has worked for me just by changing some software b/c Seeed Studio must have not known what the BBB.io people were doing at the time they produced the Motor Bridge Cape.

Anyway, no matter how trivial that is now, I have concerns w/ the software for the i2c driver in Adafruit_BBIO. Do I need Adafruit_Python_GPIO to work w/ adafruit-beaglebone-io-python?

Seth

P.S. I get errors. Please see below...

Code: Select all

Traceback (most recent call last):
  File "mbcUse.py", line 1, in <module>
    import MotorBridge
  File "/home/debian/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape/MotorBridge.py", line 33
    from Adafruit_GPIO.I2C import GPIO.I2C
                                                                   ^
SyntaxError: invalid syntax

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

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by drewfustini »

silver2row wrote: Anyway, no matter how trivial that is now, I have concerns w/ the software for the i2c driver in Adafruit_BBIO. Do I need Adafruit_Python_GPIO to work w/ adafruit-beaglebone-io-python?
Adafruit_BBIO implements its own GPIO and does not use Adafruit_Python_GPIO.
silver2row wrote: P.S. I get errors. Please see below...

Code: Select all

Traceback (most recent call last):
  File "mbcUse.py", line 1, in <module>
    import MotorBridge
  File "/home/debian/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape/MotorBridge.py", line 33
    from Adafruit_GPIO.I2C import GPIO.I2C
                                                                   ^
SyntaxError: invalid syntax
I believe the syntax should be:

Code: Select all

import Adafruit_GPIO.I2C as I2C
Take a look at the I2C test in the Adafruit_Python_GPIO module:
tests/test_I2C.py Line 82

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Oops!
Last edited by silver2row on Mon Feb 26, 2018 10:34 pm, edited 1 time in total.

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello,

How can I define Adafruit_GPIO?

Seth

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello,

Here is my output from my software being run as sudo python mbcUse.py from the MotorBridge.py library. First, the output:

Code: Select all

Traceback (most recent call last):
  File "mbcUse.py", line 1, in <module>
    import MotorBridge
  File "/home/debian/MotorBridgeCapeforBBG_BBB/BBG_MotorBridgeCape/MotorBridge.py", line 40, in <module>
    MotorBridge = Adafruit_GPIO.I2C(0x49)
NameError: name 'Adafruit_GPIO' is not defined
Second...the MotorBridge.py file as it has changed to suit the needs of the Adafruit_BBIO setup:

Code: Select all

# FileName : MotorBridge.py
# by Jiankai.li

from Adafruit_GPIO import (I2C, GPIO)
import Adafruit_GPIO.I2C as I2C
import Adafruit_BBIO.GPIO as GPIO
import time
Reset = "P9_23"
MotorBridge = Adafruit_GPIO.I2C(0x49)
GPIO.setup(Reset, GPIO.OUT)

ReadMode  = 0
WriteMode = 1
DeAddr    = 0X4B
ConfigValid =  0x3a6fb67c
DelayTime = 0.005

Seth

P.S. If this gives any insight into what I have constructed, please let me know your thoughts.

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello Sir,

I found config-pin at https://github.com/adafruit/adafruit-be ... -io-python. Do I need to situate config-pin, e.g. config-pin P9.21 i2c and config-pin P9.22 i2c?

I am asking b/c I found one of your posts on this message board and you stated your "current configuration" and I copied that configuration on my BBG in the uEnv.txt file but I still could not get the Motor Bridge Cape to recognize my software, Adafruit_BBIO, and the MotorBridge.py file (all jumbled together).

Seth

P.S. Here is some extra info:

Code: Select all

[    1.692282] pinctrl-single 44e10800.pinmux: pin PIN94 already requested by ocp:P9_20_pinmux; cannot claim for 4819c000.i2c
[    1.703471] pinctrl-single 44e10800.pinmux: pin-94 (4819c000.i2c) status -22
[    1.710594] pinctrl-single 44e10800.pinmux: could not request pin 94 (PIN94) from group pinmux_bb_i2c2_pins  on device pinctrl-single


I got this from dmesg.

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

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by drewfustini »

NameError: name 'Adafruit_GPIO' is not defined
You will need to import Adafruit_GPIO before using it. For example:

Code: Select all

import Adafruit_GPIO as GPIO
This test program demonstrates the usage:
https://github.com/adafruit/Adafruit_Py ... PIO.py#L26

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: RE: Which Adafruit_BBIO Library AM I Running on My BBB?

Post by silver2row »

Hello,

I got GitHub.com Desktop to do stuff. I cannot get anything updated on my side of things. Besides that being my issue, you are correct. I saw the link you posted. Thank you, sir. I was doing this instead of what you instructed:

Code: Select all

import Adafruit_BBIO.GPIO as GPIO
while I should have been doing this:

Code: Select all

import Adafruit_GPIO as GPIO
You saved my skin again sir. Thank you.

Seth

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”