Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Adafruit_BBIO problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Adafruit_BBIO problems

by denys on Tue Aug 21, 2018 7:18 am

Thanks for your efforts Seth.
If I manage to get it working I'll post here.

denys
 
Posts: 50
Joined: Fri Aug 10, 2018 1:08 am

Re: Adafruit_BBIO problems

by drewfustini on Fri Aug 24, 2018 2:31 am

Here is how I wired MCP23017 to BeagleBone Black:
https://photos.app.goo.gl/3Y5byeYeAjqkHbKG8

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

Re: Adafruit_BBIO problems

by drewfustini on Fri Aug 24, 2018 3:41 am

MCP23017 appears on I2C1:

P9.17 = I2C1_SCL
P9.18 = I2C1_SDA

Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~/Adafruit_Python_CharLCD/examples$ i2cdetect -r -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                     


I am able to use this Python program to toggle an LED connected to the MCP23017 and read an input:
Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~/Adafruit_Python_CharLCD/examples$ cat mcp-test.py
#!/usr/bin/python
import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP

# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or bus.
mcp = MCP.MCP23017(0x20, busnum=1)

mcp.setup(8, GPIO.OUT)
mcp.output(8, GPIO.HIGH)
time.sleep(0.5)
mcp.output(8, GPIO.LOW)
time.sleep(0.5)
mcp.output(8, GPIO.HIGH)

mcp.setup(9, GPIO.IN)
mcp.pullup(9, True)
print (mcp.input(9))

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

Re: Adafruit_BBIO problems

by denys on Fri Aug 24, 2018 4:32 am

Hi again drewrustini. Thanks for the help.

Obviously have something wrong as I get...

debian@beaglebone:~$ python -u testRW.py
Traceback (most recent call last):
File "testRW.py", line 5, in <module>
import Adafruit_GPIO as GPIO
ImportError: No module named Adafruit_GPIO

What did you do to set up the libraries?
Do you have a link to a step by step instruction?
I tried https://learn.adafruit.com/character-lc ... lack/usage but it did not work.

Also tried https://github.com/adafruit/Adafruit_Python_GPIO unsucessfully)
Denys.

denys
 
Posts: 50
Joined: Fri Aug 10, 2018 1:08 am

Re: Adafruit_BBIO problems

by drewfustini on Fri Aug 24, 2018 12:12 pm

Please copy and paste this program from my previous post and try to run it on your BeagleBone.

Code: Select all | TOGGLE FULL SIZE
#!/usr/bin/python
import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP

# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or bus.
mcp = MCP.MCP23017(0x20, busnum=1)

mcp.setup(8, GPIO.OUT)
mcp.output(8, GPIO.HIGH)
time.sleep(0.5)
mcp.output(8, GPIO.LOW)
time.sleep(0.5)
mcp.output(8, GPIO.HIGH)

mcp.setup(9, GPIO.IN)
mcp.pullup(9, True)
print (mcp.input(9))



If you get error that Adafruit GPIO module is not found, then try installing Adafruit_Python_GPIO with the step-by-step instructions:

https://github.com/adafruit/Adafruit_Py ... /README.md

Code: Select all | TOGGLE FULL SIZE
sudo apt-get update

sudo apt-get install build-essential python-pip python-dev python-smbus git

git clone https://github.com/adafruit/Adafruit_Python_GPIO.git

cd Adafruit_Python_GPIO

sudo python setup.py install


And please paste and errors you get into your reply.

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

Re: Adafruit_BBIO problems

by denys on Sat Aug 25, 2018 4:51 am

Hi again Drew.
Ihis mornig I tried with no sucess so this evening I started with a new SD image.


My file name is "testRW.py"

Code: Select all | TOGGLE FULL SIZE
# https://forums.adafruit.com/viewtopic.php?f=49&t=139446&p=693005#p693005
# debian@beaglebone:~/Adafruit_Python_CharLCD/examples$ cat mcp-test.py
# !/usr/bin/python
import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP

# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or bus.
mcp = MCP.MCP23017(0x27, busnum=1)

mcp.setup(8, GPIO.OUT)
mcp.output(8, GPIO.HIGH)
time.sleep(0.5)
mcp.output(8, GPIO.LOW)
time.sleep(0.5)
mcp.output(8, GPIO.HIGH)

mcp.setup(9, GPIO.IN)
mcp.pullup(9, True)
print (mcp.input(9))




Here is the complete output, colplete with errors.

Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~$ sudo apt-get update

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for debian:
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:3 http://repos.rcn-ee.com/debian stretch InRelease [3,058 B]             
Get:4 http://deb.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch Release.gpg [2,434 B]
Get:7 http://deb.debian.org/debian stretch-updates/main armhf Packages [5,112 B]
Get:8 http://repos.rcn-ee.com/debian stretch/main armhf Packages [655 kB]
Get:9 http://deb.debian.org/debian-security stretch/updates/contrib armhf Packages [1,764 B]
Get:10 http://deb.debian.org/debian-security stretch/updates/non-free armhf Packages [1,268 B]
Get:11 http://deb.debian.org/debian-security stretch/updates/main armhf Packages [377 kB]
Get:12 http://deb.debian.org/debian stretch/non-free armhf Packages [60.0 kB]                                               
Get:13 http://deb.debian.org/debian stretch/main armhf Packages [6,927 kB]                                                 
Get:14 http://deb.debian.org/debian stretch/contrib armhf Packages [42.1 kB]                                               
Fetched 8,379 kB in 24s (340 kB/s)                                                                                         
Reading package lists... Done
debian@beaglebone:~$ sudo apt-get install build-essential python-pip python-dev python-smbus git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.3).
git is already the newest version (1:2.11.0-3+deb9u3).
python-dev is already the newest version (2.7.13-2).
The following additional packages will be installed:
  gir1.2-glib-2.0 libdbus-glib-1-2 libgirepository-1.0-1 libpython-all-dev python-all python-all-dev
  python-cffi-backend python-crypto python-cryptography python-dbus python-enum34 python-gi python-idna
  python-ipaddress python-keyring python-keyrings.alt python-pkg-resources python-pyasn1 python-secretstorage
  python-setuptools python-six python-wheel python-xdg
Suggested packages:
  python-crypto-dbg python-crypto-doc python-cryptography-doc python-cryptography-vectors python-dbus-dbg
  python-dbus-doc python-enum34-doc python-gi-cairo gnome-keyring libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-fs
  python-gdata python-kde4 python-keyczar doc-base python-secretstorage-doc python-setuptools-doc
The following NEW packages will be installed:
  gir1.2-glib-2.0 libdbus-glib-1-2 libgirepository-1.0-1 libpython-all-dev python-all python-all-dev
  python-cffi-backend python-crypto python-cryptography python-dbus python-enum34 python-gi python-idna
  python-ipaddress python-keyring python-keyrings.alt python-pip python-pkg-resources python-pyasn1
  python-secretstorage python-setuptools python-six python-smbus python-wheel python-xdg
0 upgraded, 25 newly installed, 0 to remove and 43 not upgraded.
Need to get 2,554 kB of archives.
After this operation, 8,991 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian stretch/main armhf libgirepository-1.0-1 armhf 1.50.0-1+b1 [77.7 kB]
Get:2 http://deb.debian.org/debian stretch/main armhf gir1.2-glib-2.0 armhf 1.50.0-1+b1 [139 kB]
Get:3 http://deb.debian.org/debian stretch/main armhf libdbus-glib-1-2 armhf 0.108-2 [197 kB]
Get:4 http://deb.debian.org/debian stretch/main armhf libpython-all-dev armhf 2.7.13-2 [958 B]
Get:5 http://deb.debian.org/debian stretch/main armhf python-all armhf 2.7.13-2 [940 B]
Get:6 http://deb.debian.org/debian stretch/main armhf python-all-dev armhf 2.7.13-2 [962 B]
Get:7 http://deb.debian.org/debian stretch/main armhf python-cffi-backend armhf 1.9.1-2 [60.8 kB]
Get:8 http://deb.debian.org/debian stretch/main armhf python-crypto armhf 2.6.1-7 [255 kB]
Get:9 http://deb.debian.org/debian stretch/main armhf python-enum34 all 1.1.6-1 [35.0 kB]
Get:10 http://deb.debian.org/debian stretch/main armhf python-idna all 2.2-1 [32.6 kB]
Get:11 http://deb.debian.org/debian stretch/main armhf python-ipaddress all 1.0.17-1 [18.1 kB]
Get:12 http://deb.debian.org/debian stretch/main armhf python-pyasn1 all 0.1.9-2 [51.8 kB]
Get:13 http://deb.debian.org/debian stretch/main armhf python-pkg-resources all 33.1.1-1 [166 kB]
Get:14 http://deb.debian.org/debian stretch/main armhf python-setuptools all 33.1.1-1 [297 kB]
Get:15 http://deb.debian.org/debian stretch/main armhf python-six all 1.10.0-3 [14.4 kB]
Get:16 http://deb.debian.org/debian stretch/main armhf python-cryptography armhf 1.7.1-3 [179 kB]
Get:17 http://deb.debian.org/debian stretch/main armhf python-dbus armhf 1.2.4-1+b1 [178 kB]
Get:18 http://deb.debian.org/debian stretch/main armhf python-gi armhf 3.22.0-2 [502 kB]
Get:19 http://deb.debian.org/debian stretch/main armhf python-secretstorage all 2.3.1-2 [13.8 kB]
Get:20 http://deb.debian.org/debian stretch/main armhf python-keyring all 10.1-1 [40.7 kB]
Get:21 http://deb.debian.org/debian stretch/main armhf python-keyrings.alt all 1.3-1 [16.4 kB]
Get:22 http://deb.debian.org/debian stretch/main armhf python-pip all 9.0.1-2 [179 kB]
Get:23 http://deb.debian.org/debian stretch/main armhf python-wheel all 0.29.0-2 [51.7 kB]
Get:24 http://deb.debian.org/debian stretch/main armhf python-xdg all 0.25-4 [35.8 kB]
Get:25 http://deb.debian.org/debian stretch/main armhf python-smbus armhf 3.1.2-3 [9,698 B]
Fetched 2,554 kB in 3s (725 kB/s)   
Selecting previously unselected package libgirepository-1.0-1:armhf.
(Reading database ... 34916 files and directories currently installed.)
Preparing to unpack .../00-libgirepository-1.0-1_1.50.0-1+b1_armhf.deb ...
Unpacking libgirepository-1.0-1:armhf (1.50.0-1+b1) ...
Selecting previously unselected package gir1.2-glib-2.0:armhf.
Preparing to unpack .../01-gir1.2-glib-2.0_1.50.0-1+b1_armhf.deb ...
Unpacking gir1.2-glib-2.0:armhf (1.50.0-1+b1) ...
Selecting previously unselected package libdbus-glib-1-2:armhf.
Preparing to unpack .../02-libdbus-glib-1-2_0.108-2_armhf.deb ...
Unpacking libdbus-glib-1-2:armhf (0.108-2) ...
Selecting previously unselected package libpython-all-dev:armhf.
Preparing to unpack .../03-libpython-all-dev_2.7.13-2_armhf.deb ...
Unpacking libpython-all-dev:armhf (2.7.13-2) ...
Selecting previously unselected package python-all.
Preparing to unpack .../04-python-all_2.7.13-2_armhf.deb ...
Unpacking python-all (2.7.13-2) ...
Selecting previously unselected package python-all-dev.
Preparing to unpack .../05-python-all-dev_2.7.13-2_armhf.deb ...
Unpacking python-all-dev (2.7.13-2) ...
Selecting previously unselected package python-cffi-backend.
Preparing to unpack .../06-python-cffi-backend_1.9.1-2_armhf.deb ...
Unpacking python-cffi-backend (1.9.1-2) ...
Selecting previously unselected package python-crypto.
Preparing to unpack .../07-python-crypto_2.6.1-7_armhf.deb ...
Unpacking python-crypto (2.6.1-7) ...
Selecting previously unselected package python-enum34.
Preparing to unpack .../08-python-enum34_1.1.6-1_all.deb ...
Unpacking python-enum34 (1.1.6-1) ...
Selecting previously unselected package python-idna.
Preparing to unpack .../09-python-idna_2.2-1_all.deb ...
Unpacking python-idna (2.2-1) ...
Selecting previously unselected package python-ipaddress.
Preparing to unpack .../10-python-ipaddress_1.0.17-1_all.deb ...
Unpacking python-ipaddress (1.0.17-1) ...
Selecting previously unselected package python-pyasn1.
Preparing to unpack .../11-python-pyasn1_0.1.9-2_all.deb ...
Unpacking python-pyasn1 (0.1.9-2) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../12-python-pkg-resources_33.1.1-1_all.deb ...
Unpacking python-pkg-resources (33.1.1-1) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../13-python-setuptools_33.1.1-1_all.deb ...
Unpacking python-setuptools (33.1.1-1) ...
Selecting previously unselected package python-six.
Preparing to unpack .../14-python-six_1.10.0-3_all.deb ...
Unpacking python-six (1.10.0-3) ...
Selecting previously unselected package python-cryptography.
Preparing to unpack .../15-python-cryptography_1.7.1-3_armhf.deb ...
Unpacking python-cryptography (1.7.1-3) ...
Selecting previously unselected package python-dbus.
Preparing to unpack .../16-python-dbus_1.2.4-1+b1_armhf.deb ...
Unpacking python-dbus (1.2.4-1+b1) ...
Selecting previously unselected package python-gi.
Preparing to unpack .../17-python-gi_3.22.0-2_armhf.deb ...
Unpacking python-gi (3.22.0-2) ...
Selecting previously unselected package python-secretstorage.
Preparing to unpack .../18-python-secretstorage_2.3.1-2_all.deb ...
Unpacking python-secretstorage (2.3.1-2) ...
Selecting previously unselected package python-keyring.
Preparing to unpack .../19-python-keyring_10.1-1_all.deb ...
Unpacking python-keyring (10.1-1) ...
Selecting previously unselected package python-keyrings.alt.
Preparing to unpack .../20-python-keyrings.alt_1.3-1_all.deb ...
Unpacking python-keyrings.alt (1.3-1) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../21-python-pip_9.0.1-2_all.deb ...
Unpacking python-pip (9.0.1-2) ...
Selecting previously unselected package python-wheel.
Preparing to unpack .../22-python-wheel_0.29.0-2_all.deb ...
Unpacking python-wheel (0.29.0-2) ...
Selecting previously unselected package python-xdg.
Preparing to unpack .../23-python-xdg_0.25-4_all.deb ...
Unpacking python-xdg (0.25-4) ...
Selecting previously unselected package python-smbus:armhf.
Preparing to unpack .../24-python-smbus_3.1.2-3_armhf.deb ...
Unpacking python-smbus:armhf (3.1.2-3) ...
Setting up python-idna (2.2-1) ...
Setting up python-crypto (2.6.1-7) ...
Setting up python-smbus:armhf (3.1.2-3) ...
Setting up libdbus-glib-1-2:armhf (0.108-2) ...
Setting up python-pyasn1 (0.1.9-2) ...
Setting up python-wheel (0.29.0-2) ...
Setting up libpython-all-dev:armhf (2.7.13-2) ...
Setting up python-pkg-resources (33.1.1-1) ...
Setting up libgirepository-1.0-1:armhf (1.50.0-1+b1) ...
Setting up python-keyrings.alt (1.3-1) ...
Setting up python-cffi-backend (1.9.1-2) ...
Setting up python-six (1.10.0-3) ...
Setting up gir1.2-glib-2.0:armhf (1.50.0-1+b1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up python-enum34 (1.1.6-1) ...
Setting up python-dbus (1.2.4-1+b1) ...
Remove stale byte-compiled files...
Setting up python-ipaddress (1.0.17-1) ...
Setting up python-pip (9.0.1-2) ...
Setting up python-all (2.7.13-2) ...
Setting up python-xdg (0.25-4) ...
Setting up python-setuptools (33.1.1-1) ...
Setting up python-gi (3.22.0-2) ...
Setting up python-all-dev (2.7.13-2) ...
Setting up python-cryptography (1.7.1-3) ...
Setting up python-secretstorage (2.3.1-2) ...
Setting up python-keyring (10.1-1) ...
debian@beaglebone:~$ git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
Cloning into 'Adafruit_Python_GPIO'...
remote: Counting objects: 419, done.
remote: Total 419 (delta 0), reused 0 (delta 0), pack-reused 419
Receiving objects: 100% (419/419), 162.83 KiB | 270.00 KiB/s, done.
Resolving deltas: 100% (258/258), done.
debian@beaglebone:~$ cd Adafruit_Python_GPIO
debian@beaglebone:~/Adafruit_Python_GPIO$ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating Adafruit_GPIO.egg-info
writing requirements to Adafruit_GPIO.egg-info/requires.txt
writing Adafruit_GPIO.egg-info/PKG-INFO
writing top-level names to Adafruit_GPIO.egg-info/top_level.txt
writing dependency_links to Adafruit_GPIO.egg-info/dependency_links.txt
writing requirements to Adafruit_GPIO.egg-info/requires.txt
writing Adafruit_GPIO.egg-info/PKG-INFO
writing top-level names to Adafruit_GPIO.egg-info/top_level.txt
writing dependency_links to Adafruit_GPIO.egg-info/dependency_links.txt
writing manifest file 'Adafruit_GPIO.egg-info/SOURCES.txt'
reading manifest file 'Adafruit_GPIO.egg-info/SOURCES.txt'
writing manifest file 'Adafruit_GPIO.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/PCA95xx.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/SPI.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/PWM.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/__init__.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/Platform.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/PCF8574.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/GPIO.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/MCP230xx.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/FT232H.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
copying Adafruit_GPIO/I2C.py -> build/lib.linux-armv7l-2.7/Adafruit_GPIO
creating build/lib.linux-armv7l-2.7/tests
copying tests/MockGPIO.py -> build/lib.linux-armv7l-2.7/tests
copying tests/test_GPIO.py -> build/lib.linux-armv7l-2.7/tests
copying tests/__init__.py -> build/lib.linux-armv7l-2.7/tests
copying tests/test_Platform.py -> build/lib.linux-armv7l-2.7/tests
copying tests/test_PWM.py -> build/lib.linux-armv7l-2.7/tests
copying tests/test_SPI.py -> build/lib.linux-armv7l-2.7/tests
copying tests/test_I2C.py -> build/lib.linux-armv7l-2.7/tests
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/PCA95xx.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/SPI.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/PWM.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/__init__.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/Platform.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/PCF8574.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/GPIO.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/MCP230xx.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/FT232H.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
copying build/lib.linux-armv7l-2.7/Adafruit_GPIO/I2C.py -> build/bdist.linux-armv7l/egg/Adafruit_GPIO
creating build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/MockGPIO.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/test_GPIO.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/__init__.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/test_Platform.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/test_PWM.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/test_SPI.py -> build/bdist.linux-armv7l/egg/tests
copying build/lib.linux-armv7l-2.7/tests/test_I2C.py -> build/bdist.linux-armv7l/egg/tests
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/PCA95xx.py to PCA95xx.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/SPI.py to SPI.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/PWM.py to PWM.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/Platform.py to Platform.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/PCF8574.py to PCF8574.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/GPIO.py to GPIO.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/MCP230xx.py to MCP230xx.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/FT232H.py to FT232H.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py to I2C.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/MockGPIO.py to MockGPIO.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_GPIO.py to test_GPIO.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_Platform.py to test_Platform.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_PWM.py to test_PWM.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_SPI.py to test_SPI.pyc
byte-compiling build/bdist.linux-armv7l/egg/tests/test_I2C.py to test_I2C.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_GPIO.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_GPIO.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_GPIO.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_GPIO.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_GPIO.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/Adafruit_GPIO-1.0.3-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_GPIO-1.0.3-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg
Extracting Adafruit_GPIO-1.0.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding Adafruit-GPIO 1.0.3 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg
Processing dependencies for Adafruit-GPIO==1.0.3
Searching for spidev
Reading http://pypi.python.org/simple/spidev/
Couldn't find index page for 'spidev' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for spidev
error: Could not find suitable distribution for Requirement.parse('spidev')
debian@beaglebone:~/Adafruit_Python_GPIO$ nano testRW.py
debian@beaglebone:~/Adafruit_Python_GPIO$ python testRW.py
Traceback (most recent call last):
  File "testRW.py", line 11, in <module>
    mcp = MCP.MCP23017(0x3f, busnum=1)
  File "/home/debian/Adafruit_Python_GPIO/Adafruit_GPIO/MCP230xx.py", line 153, in __init__
    super(MCP23017, self).__init__(address, **kwargs)
  File "/home/debian/Adafruit_Python_GPIO/Adafruit_GPIO/MCP230xx.py", line 41, in __init__
    self._device = i2c.get_i2c_device(address, **kwargs)
  File "/home/debian/Adafruit_Python_GPIO/Adafruit_GPIO/I2C.py", line 66, in get_i2c_device
    return Device(address, busnum, i2c_interface, **kwargs)
  File "/home/debian/Adafruit_Python_GPIO/Adafruit_GPIO/I2C.py", line 98, in __init__
    import Adafruit_PureIO.smbus
ImportError: No module named Adafruit_PureIO.smbus
debian@beaglebone:~/Adafruit_Python_GPIO$


Also, this does not work, although the bashtest runs ok.

Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~/Adafruit_Python_GPIO$ i2cdetect -r -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
debian@beaglebone:~/Adafruit_Python_GPIO$



I am really confused! It all seems to be going backwards :(
Denys.

denys
 
Posts: 50
Joined: Fri Aug 10, 2018 1:08 am

Re: Adafruit_BBIO problems

by drewfustini on Mon Aug 27, 2018 1:09 am

It looks like you are missing some dependencies.
Couldn't find index page for 'spidev' (maybe misspelled?)
No local packages or download links found for spidev
error: Could not find suitable distribution for Requirement.parse('spidev')

import Adafruit_PureIO.smbus
ImportError: No module named Adafruit_PureIO.smbus


Run this command to install spidev:
Code: Select all | TOGGLE FULL SIZE
sudo pip install spidev


Run this command to install Adafruit-PureIO:
Code: Select all | TOGGLE FULL SIZE
sudo pip install Adafruit-PureIO


Then try to install Adafruit_Python_GPIO again:
Code: Select all | TOGGLE FULL SIZE
debian@beaglebone:~/Adafruit_Python_GPIO$ sudo apt-get install

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

Re: Adafruit_BBIO problems

by silver2row on Tue Aug 28, 2018 12:39 pm

Hello,

I am liar for coming back into this idea once I said I would not reply any longer. It seems you two are making some progress. I failed at: sudo pip install Adafruit-PureIO. Now I know.

Seth

P.S. I have been paying attention but not typing anything until now (again). I hope you guys can figure it out. I gave up b/c I am a quitter and not b/c the issue is not worth time and effort. I will keep paying attention and see if you guys get it straight. Good luck and Godspeed.

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Re: Adafruit_BBIO problems

by drewfustini on Tue Aug 28, 2018 2:13 pm

silver2row wrote:I failed at: sudo pip install Adafruit-PureIO. Now I know.


Did this command not work for you?
Code: Select all | TOGGLE FULL SIZE
sudo pip install Adafruit-PureIO

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

Re: Adafruit_BBIO problems

by silver2row on Thu Aug 30, 2018 12:22 am

Hello,

Mr. Drew...Seth here. I am about to test that cmd:

Code: Select all | TOGGLE FULL SIZE
sudo pip install Adafruit-PureIO


Yes sir...that cmd worked for me. I actually have it on my BBBW already. But...this is what transpired when I had run your software from this forum posting.

Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "tacoII.py", line 11, in <module>
    mcp = MCP.MCP23017(0x27, busnum=1)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/MCP230xx.py", line 153, in __init__
    super(MCP23017, self).__init__(address, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/MCP230xx.py", line 50, in __init__
    self.write_iodir()
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/MCP230xx.py", line 133, in write_iodir
    self._device.writeList(self.IODIR, self.iodir)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.3-py2.7.egg/Adafruit_GPIO/I2C.py", line 129, in writeList
    self._bus.write_i2c_block_data(self._address, register, data)
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO-0.2.3-py2.7.egg/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data
    self._device.write(data)
IOError: [Errno 16] Device or resource busy


I listened to the ideas about installing Adafruit_Python_GPIO again after installing Adafruit-PureIO.

That is what printed out in error format.

Seth

P.S. IOError:[Errno 16] Device or resource busy <<<<< this error happens w/ your software and denys' software also. I thought the software would just run, e.g. even w/out the proper hardware.

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Re: Adafruit_BBIO problems

by drewfustini on Thu Aug 30, 2018 3:16 am

silver2row wrote:
Code: Select all | TOGGLE FULL SIZE
IOError: [Errno 16] Device or resource busy



I believe this is because you do not have device connected to the I2C bus.

But I will test what happens when I disconnect the chip.

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

Re: Adafruit_BBIO problems

by silver2row on Sat Sep 01, 2018 8:46 pm

Yes Sir,

I will wait until you have enough time to check. Just for the record, I am not using this chip as of now. I just wanted to find out more about accessible chips for my BBB.

Seth

P.S. I wanted to help denys and see if I could figure out the issue. Anyway...when you have time, please let me know your findings.

silver2row
 
Posts: 177
Joined: Sat Jan 30, 2016 3:42 pm

Re: Adafruit_BBIO problems

by drewfustini on Thu Sep 06, 2018 7:37 pm

@denys: have you been able to try my instructions yet?
posting.php?mode=reply&f=49&t=139446#pr693535

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

Re: Adafruit_BBIO problems

by denys on Thu Sep 06, 2018 9:27 pm

Hi Drew.
I have to start again, again!

Something is way wrong!

debian@beaglebone:~$ i2cdetect -r -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

I think I will give up as I've tried his for months now.
The code had been ported to an Arduino and compiles. So far, I have not had time to actually try it, but I think that will be the way to go.
I do appreciate your help but obviously I am missing something as following the instructions even from a new install does not work.
Thanks again to you both.

If I do get it working on the BBB, I will post back here.
Denys.

denys
 
Posts: 50
Joined: Fri Aug 10, 2018 1:08 am

Re: Adafruit_BBIO problems

by drewfustini on Thu Sep 06, 2018 9:46 pm

Thanks for the update.

If you do want to try further, then it would be interesting to see i2cdetect on the other buses:
Code: Select all | TOGGLE FULL SIZE
 i2cdetect -r -y 0
 i2cdetect -r -y 1
 i2cdetect -r -y 2

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

Please be positive and constructive with your questions and comments.