This person noticed that Adafruit_BBIO doesn't work when not root:
https://forums.adafruit.com/viewtopic.php?f=49&t=105847#p606973
Issue seems to be:
open("/sys/devices/platform/bone_capemgr/slots", O_RDWR|O_LARGEFILE) = -1
EACCES (Permission denied)
Do we want to let normal users write to
/sys/devices/platform/bone_capemgr/slots ?
Thanks,
Drew
$groupadd --system slots
$usermod --append --groups slots debian
then
$chmod 664 /sys/devices/platform/bone_capemgr/slots
$chgrp slots /sys/devices/platform/bone_capemgr/slots
(though to be honest I have no idea if this would be permanent etc. and probably not, it would be ‘nice’)
we could just add a udev rule too. 
Regards,
You kids these days… 
It would be a pretty big security hole, but we have plenty of those. It would at least take a targeted attack. I’m in favor.
Thanks, Peter. After running those commands, I was able to write to
slots file as user debian.
Did not work for me.
I attached the terminal dumps.
ssh into BBBW apply commands try python and sudo python failed both times is first file.
Power down reboot and try again is second file.
Tom
TermiADCScratchfix_2.txt (2.2 KB)
TermiADCScratchfix_1.txt (2.04 KB)
{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 is already loaded..
This would show that:
sudo /opt/scripts/tools/version.sh
http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Disable_on-board_devices
see the adc disable..
Regards,
Robert
I do not know what you mean by adc is already loaded as it is part of a python module but let’s just assume I am the unknowing one.
I ran your version.sh and here is the results
Last login: Fri Sep 1 18:02:47 2017 from 192.168.0.15
debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[8e0b1e6f135ff3c30468f49a7a952c98be97219a]
eeprom:[A335BNLTBWA51646BBWG2052]
dogtag:[BeagleBoard.org Debian Image 2017-08-24]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2017.09-rc2-00002-g84a7f2]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.03-rc1-00003-ga09f2d]
kernel:[4.4.83-ti-r119]
nodejs:[v6.11.2]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20170728.0-0rcnee1~stretch+20170728]
pkg:[bb-wl18xx-firmware]:[1.20170821-0rcnee1~stretch+20170821]
pkg:[firmware-ti-connectivity]:[20161130-3]
debian@beaglebone:~$
Tom
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot
2017.09-rc2-00002-g84a7f2]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot
2017.03-rc1-00003-ga09f2d]
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
Interesting as all I did was download the latest image you posted on Beagleboard.org and burn an sd card with it.
I expanded the file system and tried it out.
Seems to me if booting from an sd card the eMMC boot loader should neve be run.
I will give a try to killing the MLO file and I will see what image is actually in flash on this BBBW.
Tom
Robert
Interesting as all I did was download the latest image you posted on
Beagleboard.org and burn an sd card with it.
I expanded the file system and tried it out.
Seems to me if booting from an sd card the eMMC boot loader should neve be
run.
The am335x's bootrom defaults to eMMC first...
I will give a try to killing the MLO file and I will see what image is
actually in flash on this BBBW.
Regards,
Robert
OK deleted the file using your command and after a reboot it worked running python without sudo.
So whats in flash is upsetting the system, I will see what is in flash after dinner.
Last login: Fri Sep 1 19:16:09 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:~$ 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()
ADC.readraw(“AIN1”)
Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘module’ object has no attribute ‘readraw’
ADC.read_raw(“AIN1”)
3648.0
quit()
debian@beaglebone:~$
Tom
Robert
Turns out what was in flash was dead, would not even boot.
I may have booted from flash on this board once when I first purchased the board last fall.
So I have no idea what happened to flash or when.
So I downloaded the latest 08/31/2017 IOT image and converted it to a flasher image and
flashed the eMMC with it.
It flashed fine and booted, which said at least the eMMC was not defective
I took a look at what was there using a cloud9 terminal as I have not run connman yet
and tried python Adafruit_BBIO ADC and it worked.
I did not execute any of the commands to create a new group and change file permissions.
It just worked out of the box.
Did you make any changes to the 08/31 image from this discussion that would have fixed the issue?
Tomorrow I can try an sd card with a fresh image without the fixed discussed earlier today and see what
happens with flash having a good image.
Here is what I did
debian@beaglebone:/var/lib/cloud9$ uname -a
Linux beaglebone 4.4.84-ti-r120 #1 SMP Sun Aug 27 03:11:07 UTC 2017 armv7l GNU/Linux
debian@beaglebone:/var/lib/cloud9$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-08-31
debian@beaglebone:/var/lib/cloud9$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 217M 0 217M 0% /dev
tmpfs 49M 4.9M 44M 10% /run
/dev/mmcblk1p1 3.5G 1.6G 1.7G 48% /
tmpfs 244M 0 244M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 244M 0 244M 0% /sys/fs/cgroup
debian@beaglebone:/var/lib/cloud9$ 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()
ADC.read_raw(“AIN0”)
3950.0
quit()
debian@beaglebone:/var/lib/cloud9$
Tom
Robert
Testing update
I made a clean 08-31-2917 sd card image and bootsd it to see if that
worked as well and it worked running python and the ADC test.
I did the test both in cloud9 and ssh into as debian user.
I made none of the fixes from this thread to the image just booted and
tried the ADC test
So 08-31-2017 image works in flash as stated in my previous post and
from an sd card with a working 0831-2017 image in eMMC.
So I ask did you apply a fix to the 08-31-2017 image such as the udder rule
mentioned here.
Tom