Well, by having a quick look at the Adafruit_BBIO.ADC package you mentioned
we can see that it is indeed reading the value from a file.

https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/c_adc.c#L46

We can see there that there are some AIN files located in the /sys/devices/
directory. The following command will tell you more about them:

 find /sys/devices/ -name '*AIN*'

You should see something like

/sys/devices/ocp.2/helper.14/AIN0

/sys/devices/ocp.2/helper.14/AIN1

/sys/devices/ocp.2/helper.14/AIN2

/sys/devices/ocp.2/helper.14/AIN3

/sys/devices/ocp.2/helper.14/AIN4

/sys/devices/ocp.2/helper.14/AIN5

/sys/devices/ocp.2/helper.14/AIN6

/sys/devices/ocp.2/helper.14/AIN7


What you can do next is doing something like

ls -alh /sys/devices/ocp.2/helper.14/AIN0

which will tell you more about the access rights to that file. Once you
have this kind if knowledge it should be pretty straightforward to set the
rights in such a way that a non-root user should be able to read from ADC.

Hope this helps.


On 17 August 2014 20:52, John Syn <john3...@gmail.com> wrote:

>
>
> On 8/17/14, 3:22 AM, "c...@isbd.net" <c...@isbd.net> wrote:
>
> >John Syn <john3...@gmail.com> wrote:
> >>
> >> On 8/16/14, 9:20 AM, "c...@isbd.net" <c...@isbd.net> wrote:
> >>
> >> >I want to read the ADC inputs on my Beaglebone Black without root
> >> >privilege.  Using the Adafruit_BBIO.ADC package in Python requires
> >> >root privilege, are there any ways of doing it without?
> >> Use group permissions. If you are part of a group and ADC is part of the
> >> same group, you can access ADC without being root.
> >>
> >Er, ADC can't really be "part of a group" as it's not a user.
> In Unix, everything is a file so you can assign groups to almost anything.
> >
> >If there *is* a group whose membership allows access to the ADC inputs
> >then I'd like to know what it is.  I've looked through /etc/group and
> >there's nothing obviously associated with IO.
> These are standard Unix/Linux concepts. I don¹t know how you are accessing
> the ADC device (device, IIO, sys, etc), but the same principles apply. If
> you are accessing a device for example (/dev/adc?) then you assign a group
> to that device either in an init script or udev. If your userid is part of
> the same group, then you don¹t need root permission to access that device.
> Reading a good Linux book will explain this concept.
>
> Regards,
> John
> >
> >--
> >Chris Green
> >·
> >
> >--
> >For more options, visit http://beagleboard.org/discuss
> >---
> >You received this message because you are subscribed to the Google Groups
> >"BeagleBoard" group.
> >To unsubscribe from this group and stop receiving emails from it, send an
> >email to beagleboard+unsubscr...@googlegroups.com.
> >For more options, visit https://groups.google.com/d/optout.
>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to