0

Adafruit_BBIO ADC latest image
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_BBIO ADC latest image

by tomis4cd on Wed Nov 02, 2016 1:45 pm

I have been trying out the latest Jessie image from Beagleboard.org the 5/13/2016
and was expecting the fix for ADC issue with the 4.x kernel to be in there.
I found that the blink an led example worked but when I tried the ADC it crashed.

Is the ADC and maybe other things fix still in testing?
I know I read somewhere that Drew merged the ADC fix in but must be to
a different image than the latest 5/13/2016 one.

I tried doing an upgrade by sudo pip install --upgrade Adafruit_BBIO
but that failed to finish.

Here is a dump of the Terminal which includes uname, dogleg, and Debian version for reference

Code: Select all | TOGGLE FULL SIZE
Last login: Wed Nov  2 11:27:25 on console
Thomass-Mac-mini-2:~ TDLMacmini$ ssh root@192.168.0.210
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2016-05-13

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

Last login: Tue Nov  1 23:02:28 2016 from 192.168.0.15
root@beaglebone:~# date
Wed Nov  2 17:04:13 UTC 2016
root@beaglebone:~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> quit()
root@beaglebone:~# uname -a
Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 armv7l GNU/Linux
root@beaglebone:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2016-05-13
root@beaglebone:~# cat /etc/debian_version
8.6
root@beaglebone:~# sudo pip  install --upgrade Adafruit_BBIO
Collecting Adafruit_BBIO
  Downloading Adafruit_BBIO-1.0.0.tar.gz (43kB)
    100% |████████████████████████████████| 51kB 381kB/s
Building wheels for collected packages: Adafruit-BBIO
  Running setup.py bdist_wheel for Adafruit-BBIO ... done
  Stored in directory: /root/.cache/pip/wheels/4b/de/99/025af4b72c4411a4a3ceeb27eea0907959c0b516daa3617a5a
Successfully built Adafruit-BBIO
Installing collected packages: Adafruit-BBIO
  Found existing installation: Adafruit-BBIO 0.0.30
    Uninstalling Adafruit-BBIO-0.0.30:
      Successfully uninstalled Adafruit-BBIO-0.0.30
  Rolling back uninstall of Adafruit-BBIO
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/local/lib/python2.7/dist-packages/pip/locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 263, in __init__
    for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 521, in iter_entry_points
    entries = dist.get_entry_map(group)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2484, in get_entry_map
    self._get_metadata('entry_points.txt'), self
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2257, in parse_map
    for group, lines in data:
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2841, in split_sections
    for line in yield_lines(s):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2078, in yield_lines
    for ss in strs:
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2414, in _get_metadata
    if self.has_metadata(name):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1399, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1759, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1639, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1551, in build
    with ContextualZipFile(path) as zfile:
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1600, in __new__
    return zipfile.ZipFile(*args, **kwargs)
  File "/usr/lib/python2.7/zipfile.py", line 756, in __init__
    self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-0.0.30-py2.7-linux-armv7l.egg'
root@beaglebone:~#

Thank's
Tom

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by drewfustini on Wed Nov 02, 2016 1:52 pm

pip install should work to get the latest release which is 1.0.0.

however, before determining the issue with pip, could you please try installing the latest version from the Github repo?

https://github.com/adafruit/adafruit-be ... io-python/

For 4.1+ kernel, the expectation is that cape-universal will be enabled. This is the default with the Debian Jessie (8.x) images.

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

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Wed Nov 02, 2016 2:42 pm

Drew
I get the same result
Interesting it said ver 1.0.0 was installed
I did an apt-get update and apt-get upgrade last night
so I did not repeat that today
Here is the Terminal output for getting the latest version I followed the
instructions on the git hub page
Maybe that is not the way to do it?

Code: Select all | TOGGLE FULL SIZE
Last login: Wed Nov  2 13:04:03 on ttys000
Thomass-Mac-mini-2:~ TDLMacmini$ ssh root@192.168.0.210
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2016-05-13

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

Last login: Wed Nov  2 17:04:08 2016 from 192.168.0.15
root@beaglebone:~# date
Wed Nov  2 18:18:42 UTC 2016
root@beaglebone:~# sudo apt-get install build-essential python-dev python-pip -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
python-dev is already the newest version.
python-pip is already the newest version.
The following packages were automatically installed and are no longer required:
  debugss-mod-dkms libaudio2 libmng1 libqt4-network libqt4-xml libqtcore4
  libqtdbus4 libqtgui4 qtcore4-l10n temperature-mod-dkms
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
root@beaglebone:~# git clone git://github.com/adafruit/adafruit-beaglebone-io-python.git
Cloning into 'adafruit-beaglebone-io-python'...
remote: Counting objects: 1017, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1017 (delta 0), reused 0 (delta 0), pack-reused 1012
Receiving objects: 100% (1017/1017), 223.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (654/654), done.
Checking connectivity... done.
root@beaglebone:~# git clone git://github.com/adafruit/adafruit-beaglebone-io-python.git
fatal: destination path 'adafruit-beaglebone-io-python' already exists and is not an empty directory.
root@beaglebone:~# cd adafruit-beaglebone-io-python
root@beaglebone:~/adafruit-beaglebone-io-python# sudo python setup.py install
running install
running bdist_egg
running egg_info
creating Adafruit_BBIO.egg-info
writing Adafruit_BBIO.egg-info/PKG-INFO
writing top-level names to Adafruit_BBIO.egg-info/top_level.txt
writing dependency_links to Adafruit_BBIO.egg-info/dependency_links.txt
writing manifest file 'Adafruit_BBIO.egg-info/SOURCES.txt'
reading manifest file 'Adafruit_BBIO.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Adafruit_BBIO.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
copying Adafruit_I2C.py -> build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/overlays
copying overlays/__init__.py -> build/lib.linux-armv7l-2.7/overlays
copying overlays/builder.py -> build/lib.linux-armv7l-2.7/overlays
creating build/lib.linux-armv7l-2.7/Adafruit_BBIO
copying Adafruit_BBIO/__init__.py -> build/lib.linux-armv7l-2.7/Adafruit_BBIO
running build_ext
building 'Adafruit_BBIO.GPIO' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/event_gpio.c -o build/temp.linux-armv7l-2.7/source/event_gpio.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/c_pinmux.c -o build/temp.linux-armv7l-2.7/source/c_pinmux.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/source/py_gpio.o build/temp.linux-armv7l-2.7/source/event_gpio.o build/temp.linux-armv7l-2.7/source/c_pinmux.o build/temp.linux-armv7l-2.7/source/constants.o build/temp.linux-armv7l-2.7/source/common.o -o build/lib.linux-armv7l-2.7/Adafruit_BBIO/GPIO.so
building 'Adafruit_BBIO.PWM' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/py_pwm.c -o build/temp.linux-armv7l-2.7/source/py_pwm.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/c_pwm.c -o build/temp.linux-armv7l-2.7/source/c_pwm.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/c_pinmux.c -o build/temp.linux-armv7l-2.7/source/c_pinmux.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/source/py_pwm.o build/temp.linux-armv7l-2.7/source/c_pwm.o build/temp.linux-armv7l-2.7/source/c_pinmux.o build/temp.linux-armv7l-2.7/source/constants.o build/temp.linux-armv7l-2.7/source/common.o -o build/lib.linux-armv7l-2.7/Adafruit_BBIO/PWM.so
building 'Adafruit_BBIO.ADC' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/py_adc.c -o build/temp.linux-armv7l-2.7/source/py_adc.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/c_adc.c -o build/temp.linux-armv7l-2.7/source/c_adc.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/source/py_adc.o build/temp.linux-armv7l-2.7/source/c_adc.o build/temp.linux-armv7l-2.7/source/constants.o build/temp.linux-armv7l-2.7/source/common.o -o build/lib.linux-armv7l-2.7/Adafruit_BBIO/ADC.so
building 'Adafruit_BBIO.SPI' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/spimodule.c -o build/temp.linux-armv7l-2.7/source/spimodule.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/source/spimodule.o build/temp.linux-armv7l-2.7/source/constants.o build/temp.linux-armv7l-2.7/source/common.o -o build/lib.linux-armv7l-2.7/Adafruit_BBIO/SPI.so
building 'Adafruit_BBIO.UART' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/py_uart.c -o build/temp.linux-armv7l-2.7/source/py_uart.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/c_uart.c -o build/temp.linux-armv7l-2.7/source/c_uart.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/constants.c -o build/temp.linux-armv7l-2.7/source/constants.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DBBBVERSION41 -I/usr/include/python2.7 -c source/common.c -o build/temp.linux-armv7l-2.7/source/common.o -Wall -Werror -Wno-format-security
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/source/py_uart.o build/temp.linux-armv7l-2.7/source/c_uart.o build/temp.linux-armv7l-2.7/source/constants.o build/temp.linux-armv7l-2.7/source/common.o -o build/lib.linux-armv7l-2.7/Adafruit_BBIO/UART.so
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
copying build/lib.linux-armv7l-2.7/Adafruit_I2C.py -> build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/overlays
copying build/lib.linux-armv7l-2.7/overlays/__init__.py -> build/bdist.linux-armv7l/egg/overlays
copying build/lib.linux-armv7l-2.7/overlays/builder.py -> build/bdist.linux-armv7l/egg/overlays
creating build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/__init__.py -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/SPI.so -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/ADC.so -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/UART.so -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/PWM.so -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
copying build/lib.linux-armv7l-2.7/Adafruit_BBIO/GPIO.so -> build/bdist.linux-armv7l/egg/Adafruit_BBIO
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_I2C.py to Adafruit_I2C.pyc
byte-compiling build/bdist.linux-armv7l/egg/overlays/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/overlays/builder.py to builder.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/__init__.py to __init__.pyc
creating stub loader for Adafruit_BBIO/GPIO.so
creating stub loader for Adafruit_BBIO/PWM.so
creating stub loader for Adafruit_BBIO/ADC.so
creating stub loader for Adafruit_BBIO/SPI.so
creating stub loader for Adafruit_BBIO/UART.so
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/GPIO.py to GPIO.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/PWM.py to PWM.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/ADC.py to ADC.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/SPI.py to SPI.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_BBIO/UART.py to UART.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_BBIO.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_BBIO.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_BBIO.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_BBIO.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
writing build/bdist.linux-armv7l/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg
Copying Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg to /usr/local/lib/python2.7/dist-packages
Adding Adafruit-BBIO 1.0.0 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg
Processing dependencies for Adafruit-BBIO==1.0.0
Finished processing dependencies for Adafruit-BBIO==1.0.0
root@beaglebone:~/adafruit-beaglebone-io-python# cd ..
root@beaglebone:~# sudo rm -rf adafruit-beaglebone-io-python
root@beaglebone:~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> import Adafruit_BBIO as bbio
>>> bbio.version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'version'
>>> quit()
root@beaglebone:~#

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Wed Nov 02, 2016 3:09 pm

I edited my previous post as I pasted in the wrong Terminal output
HOWEVER
I got curious on what version was now on the BBB and did a pip
install without the --upgrade as I knew it would tell me the version and
it did say 1.0.0
Also the ADC worked this time.
I did nothing more than exit and close out of the first Terminal session and start with a
new Terminal session no reboot of BBB

Code: Select all | TOGGLE FULL SIZE
Last login: Wed Nov  2 14:18:30 on ttys000
Thomass-Mac-mini-2:~ TDLMacmini$ ssh root@192.168.0.210
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2016-05-13

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

Last login: Wed Nov  2 18:18:36 2016 from 192.168.0.15
root@beaglebone:~# date
Wed Nov  2 18:53:53 UTC 2016
root@beaglebone:~# pip install Adafruit_BBIO
Requirement already satisfied (use --upgrade to upgrade): Adafruit_BBIO in /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg
root@beaglebone:~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
>>> quit()
root@beaglebone:~#

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Tue Nov 22, 2016 2:53 pm

Drew
It appears you fixed the pip install of Adafruit_BBIO
At the Beaglebone Meetup Jason said there was a Nov 16 new image so
I gave it a try.
The BBIO ADC did not work on the fresh Nov 16 image but this time
sudo pip install --upgrade Adafruit_BBIO did work this time and installed
BBIO ver 1.0.0
It actually said I had ver 1.0.0 on the fresh image but the fact that the ADC failed
would indicate that was not true.
After pip install the ADC now worked, indicating it did upgrade the BBIO version

Code: Select all | TOGGLE FULL SIZE
Last login: Sat Nov 19 14:43:52 on console
Thomass-MacBook-Pro:~ tdlmacbookpro$ ssh root@192.168.0.210
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2016-11-06

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

Last login: Fri Nov 18 19:46:56 2016 from 192.168.0.16
root@beaglebone:~# date
Sat Nov 19 19:44:26 UTC 2016
root@beaglebone:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2016-11-06

root@beaglebone:~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> quit()

root@beaglebone:~# sudo pip install --upgrade Adafruit_BBIO

Requirement already up-to-date: Adafruit_BBIO in /usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.0-py2.7-linux-armv7l.egg
You are using pip version 9.0.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

root@beaglebone:~# python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
>>> ADC.read("AIN1")
0.3997558057308197
>>> ADC.read_raw("AIN1")
1637.0
>>> quit()
root@beaglebone:~#


Tom L

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by drewfustini on Wed Nov 23, 2016 5:00 am

There seems to be a bug where it fails upon the first execution but works OK after that. I'm investigating further and will update with my progress.

root@beaglebone:~# python ./adc.py
Traceback (most recent call last):
File "./adc.py", line 2, in <module>
ADC.setup()
RuntimeError: Unable to setup ADC system. Possible causes are:
- A cape with a conflicting pin mapping is loaded
- A device tree object is loaded that uses the same name for a fragment: helper
root@beaglebone:~# python ./adc.py
0.403174608946
1653.0


My test code:
Code: Select all | TOGGLE FULL SIZE
import Adafruit_BBIO.ADC as ADC
ADC.setup()
print ADC.read("AIN0")
print ADC.read_raw("AIN0")

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

Re: Adafruit_BBIO ADC latest image

by drewfustini on Wed Nov 23, 2016 7:25 am

I've installed different kernels via apt-get and determined that 4.4.30-ti-r65 works OK:

4.4.32-ti-r68: FAIL
4.4.31-ti-r67: FAIL
4.4.30-ti-r66: FAIL
4.4.30-ti-r65: OK

This bone variant also works:
4.4.33-bone14: OK

I'll post with further updates.

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

Re: Adafruit_BBIO ADC latest image

by drewfustini on Thu Nov 24, 2016 3:38 am

Robert Nelson helped determine the difference between 4.4.30-ti-r65 and 4.4.30-ti-r66:
https://groups.google.com/forum/#!categ ... TwwYU3jk3w

I'm going to build the kernel from Robert's ti-linux-kernel-dev repo and try removing those patches one by one.

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

Re: Adafruit_BBIO ADC latest image

by drewfustini on Tue Nov 29, 2016 7:42 am

This issue appears to be resolved with 4.4.34-ti-r69 kernel:
root@beaglebone:~# cat ./adc.py
import Adafruit_BBIO.ADC as ADC
ADC.setup()
print ADC.read("AIN0")
print ADC.read_raw("AIN0")
root@beaglebone:~# python ./adc.py
2.00166678429
3589.0
root@beaglebone:~# uname -a
Linux beaglebone 4.4.34-ti-r69 #1 SMP Wed Nov 23 20:01:14 UTC 2016 armv7l GNU/Linux


You can install with:
apt-get install linux-image-4.4.34-ti-r69

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

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Sun Aug 06, 2017 10:46 pm

TermAdafruitBBIOADC.txt
(20.36 KiB) Downloaded 6 times
Drew
The issue with the ADC appears to be back with the latest image 03/19/2017.
Could be related to the fact that now to SSH you have to log in as user debian instead
of root for security reasons. Interesting if I use cloud9 ide which does log in as root
the ADC code does work. So I tried a second time to use a terminal and log in as debian
user and it still failed.
I also tried as debian user to do an install of the Adafruit_BBIO from the github site.
It did do an install but still failed after. That use to always fix the issue.
At the bottom of this term dump is the info you always ask for.
Good talking to you at Maker Fair Detroit
Code: Select all | TOGGLE FULL SIZE
Last login: Sun Aug  6 20:56:28 on ttys000
Thomass-MacBook-Pro:~ tdlmacbookpro$ ssh debian@192.168.0.23
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2017-03-19

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

debian@192.168.0.23's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Aug  7 00:58:07 2017 from 192.168.0.18
debian@beaglebone:~$ ls
bin
debian@beaglebone:~$ python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> quit()
debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.54-ti-r93 #1 SMP Fri Mar 17 13:08:22 UTC 2017 armv7l GNU/Linux
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-03-19
debian@beaglebone:~$ cat /etc/debian_version
8.7
debian@beaglebone:~$


I will also attach the term dump with some other playing around bits at the beginning of the file
but also the install of Adafruit_BBIO from the git hub site for your reference
Tom

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by drewfustini on Mon Aug 07, 2017 2:07 am

Could you please try running again with sudo?

If that does work, then it should be a matter of running strace to determine which files need their ownership and/or permissions changed

Thanks

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

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Mon Aug 07, 2017 10:54 am

Drew
OK sudo has it working.
I tried both running python and having python execute a file and same result
sudo works

Here is the term dump

Code: Select all | TOGGLE FULL SIZE
Last login: Mon Aug  7 10:32:33 on console
Thomass-MacBook-Pro:~ tdlmacbookpro$ ssh debian@192.168.0.23
Debian GNU/Linux 8

BeagleBoard.org Debian Image 2017-03-19

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

debian@192.168.0.23's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Aug  7 02:10:12 2017 from 192.168.0.18
debian@beaglebone:~$ sudo python
[sudo] password for debian:
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
>>> ADC.readraw("AIN1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'readraw'
>>> ADC.read_raw("AIN1)
  File "<stdin>", line 1
    ADC.read_raw("AIN1)
                      ^
SyntaxError: EOL while scanning string literal
>>> ADC.read_raw("AIN1")
3624.0
>>> quit()
debian@beaglebone:~$ # Try again without sudo
debian@beaglebone:~$ python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
>>> quit()
debian@beaglebone:~$ sudo python
Python 2.7.9 (default, Aug 13 2016, 17:56:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.ADC as ADC
>>> ADC.setup()
>>> ADC.read_raw("AIN0")
3919.0
>>> quit()
debian@beaglebone:~$ nano ADCtest.py
debian@beaglebone:~$ python ADCtest.py
Traceback (most recent call last):
  File "ADCtest.py", line 2, in <module>
    ADC.setup()
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper
debian@beaglebone:~$ sudo python ADCtest.py
debian@beaglebone:~$ nano ADCtest.py
debian@beaglebone:~$ sudo python ADCtest.py
3695.0
debian@beaglebone:~$


Tom

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by drewfustini on Mon Aug 07, 2017 12:05 pm

Ok, thanks.

Let's try running strace to see what goes wrong when running without sudo.

If strace doesn't exist, this should install it:
sudo apt-get install strace

Then please run this command:
strace -o /tmp/strace-log.txt -f python NAME-OF-YOUR-PYTHON-FILE.py

Then attach /tmp/strace-log.txt here or upload to github gist.

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

Re: Adafruit_BBIO ADC latest image

by tomis4cd on Mon Aug 07, 2017 1:28 pm

Drew
OK
Because it is large I attached the term dump where I cat the file.
Near the bottom I see
13995 open("/sys/devices/platform/bone_capemgr/slots", O_RDWR|O_LARGEFILE) = -1 EACCES (Permission denied)

Not saying it is the only line with an error.

Tom
TermstracePython ADCtest.txt
(261.47 KiB) Downloaded 4 times

tomis4cd
 
Posts: 45
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

by drewfustini on Wed Aug 09, 2017 3:28 pm

Thanks for providing that. I'll check with Robert Nelson about the best way to handle that. He has been focusing on "de-rooting" a lot of common functionality on our debian user so that users can stop having to run Python and node.js as root.

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

Please be positive and constructive with your questions and comments.