Adafruit_BBIO ADC latest image

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
tomis4cd
 
Posts: 68
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

Post by tomis4cd »

Issue is still there in latest image Stretch 08-24-2017

Code: Select all

Last login: Wed Aug 30 13:58:19 on ttys000
Thomass-Mac-mini-2:~ TDLMacmini$ ssh [email protected]
[email protected]'s password: 
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l

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: Wed Aug 30 00:11:29 2017 from 192.168.0.18
debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l GNU/Linux
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-08-24
debian@beaglebone:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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
>>> print ADC
<module 'Adafruit_BBIO.ADC' from '/home/debian/.cache/Python-Eggs/Adafruit_BBIO-1.0.4-py2.7-linux-armv7l.egg-tmp/Adafruit_BBIO/ADC.so'>
>>> quit()
debian@beaglebone:~$ sudo python
[sudo] password for debian: 
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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
>>> print ADC
<module 'Adafruit_BBIO.ADC' from '/root/.cache/Python-Eggs/Adafruit_BBIO-1.0.4-py2.7-linux-armv7l.egg-tmp/Adafruit_BBIO/ADC.so'>
>>> quit()
debian@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.4-py2.7-linux-armv7l.egg
debian@beaglebone:~$ 
Tom

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

Re: Adafruit_BBIO ADC latest image

Post by drewfustini »

Does it work when running as root?

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

Re: Adafruit_BBIO ADC latest image

Post by drewfustini »

I just posted on beagleboard mailing list to get Robert Nelson's opinion:
[beagleboard] write to slots file as normal user?

User avatar
tomis4cd
 
Posts: 68
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

Post by tomis4cd »

Thank's Drew
There is no way to become root user with the latest image.
For increased security the default user is debian, much like pi is the default user in raspberry pi
Even the cloud9 ide user is debian.
The root password is a secret, as it should be.

Tom

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

Re: Adafruit_BBIO ADC latest image

Post by drewfustini »

Sorry, I meant to say running as root with sudo from user debian.

From the mailing list, Peter Lawler suggested:

Code: Select all

sudo groupadd --system slots
sudo usermod --append --groups slots debian
sudo chmod 664 /sys/devices/platform/bone_capemgr/slots
sudo chgrp slots /sys/devices/platform/bone_capemgr/slots
I just tried this and I was then able to write to slots file as debian user without sudo.

User avatar
tomis4cd
 
Posts: 68
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

Post by tomis4cd »

Drew
I did try sudo, I posted the terminal output that shows both ways.

I tried adding the fix commands and tried it running python with and without sudo and it failed both ways.

Following is the terminal dump of applying the fixes and trying it out

Code: Select all

Last login: Fri Sep  1 11:19:53 on console
Thomass-Mac-mini-2:~ TDLMacmini$ ssh [email protected]
[email protected]'s password: 
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l

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: Wed Aug 30 18:00:10 2017 from 192.168.0.15
debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l GNU/Linux
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-08-24
debian@beaglebone:~$ sudo groupadd --system slots
[sudo] password for debian: 
debian@beaglebone:~$ sudo usermod --append --groups slots debian
debian@beaglebone:~$ sudo chmod 664 /sys/devices/platform/bone_capemgr/slots
debian@beaglebone:~$ sudo chgrp slots /sys/devices/platform/bone_capemgr/slots
debian@beaglebone:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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:~$ 
Following is the terminal dump of trying it after powering down and rebooting

Code: Select all

Last login: Fri Sep  1 13:52:01 on ttys000
Thomass-Mac-mini-2:~ TDLMacmini$ ssh [email protected]
[email protected]'s password: 
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l

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: Fri Sep  1 17:52:17 2017 from 192.168.0.15
debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.83-ti-r119 #1 SMP Thu Aug 17 06:39:24 UTC 2017 armv7l GNU/Linux
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-08-24
debian@beaglebone:~$ # Reboot after applying the following file write fix
debian@beaglebone:~$ # sudo groupadd --system slots
debian@beaglebone:~$ # sudo usermod --append --groups slots debian
debian@beaglebone:~$ # sudo chmod 664 /sys/devices/platform/bone_capemgr/slots
debian@beaglebone:~$ # sudo chgrp slots /sys/devices/platform/bone_capemgr/slotsdebian@beaglebone:~$ 
debian@beaglebone:~$ python 
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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:~$ # Try sudo
debian@beaglebone:~$ 
debian@beaglebone:~$ sudo python
[sudo] password for debian: 
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] 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:~$ 
Tom

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

Re: Adafruit_BBIO ADC latest image

Post by drewfustini »

Thanks, it looks like Robert Nelson's instructions resolved the issue?
So, your eMMC's bootloader is getting in the way, hence your not
booting what you expect:

so kill the MLO file via:

sudo dd if=/dev/zero of=/dev/mmcblk1 count=1 seek=1 bs=128k

and it'll default to the correct bootloader found on the microSD.

Regards,

--
Robert Nelson
https://rcn-ee.com/

User avatar
tomis4cd
 
Posts: 68
Joined: Wed Mar 14, 2012 1:02 pm

Re: Adafruit_BBIO ADC latest image

Post by tomis4cd »

Update on further testing.

Since Robert indicated the issue involved the fact that the eMMC flash always boots first I
decided to see what was in the flash on the BBBW I was using to test the ADC issue.
I discovered it was totally corrupt as it would not boot at all.
So I made a flasher version of the 08-31-2017 image which is now the latest posted
image on beagle board.org. I flashed the eMMC on my BBBW and all went fine indicating
the eMMC was not bad.
When I tried the ADC test it worked. I did not apply any of the fixes mentioned in this thread
ie create groups change file permissions delete a file.

So wondering if booting from an sd card would have issues as it would now have something
good in flash but will boot the flash first to some extent then the sd card image.
I applied none of the fixes again just a fresh 08-31-2017 image and it worked.
First in cloud9 ide, as I needed to be there to run connmanctl to set up wifi, and then it
also worked when I ssh into the BBBW over wifi as debian user.

Just for grinn's I booted an sd card image from 03-19-2017 and ssh to it as debian user.
It failed giving the same error shown in this thread.
That image had none of the fixes from yesterday.

When I posted to Robert on beagle board.org yesterday about the corrupt flash I asked him
if he had applied a fix to the 08-31-2017 image for this issue.

Tom

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

Re: Adafruit_BBIO ADC latest image

Post by drewfustini »

Thanks for following up.

FYI - the latest Debian 9.x (Stretch) testing image is now from September 3rd:
https://rcn-ee.com/rootfs/bb.org/testing/2017-09-03/stretch-iot/

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

Return to “Beagle Bone & Adafruit Beagle Bone products”