mr.Shu <[email protected]> wrote:
> [-- text/plain, encoding quoted-printable, charset: UTF-8, 114 lines --]
> 
> 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.
> 
No use at all.  I want access for a user that doesn't need root access
before to set it up.  

If I do as you suggest and open up the permissions on the /sys/devices...
files it will work until the next reboot and then I have to do it all
over again - once again using root access to do it.  OK, I *could* do
it in /etc/rc.local but it's fundamentally wrong on a Unix/Linux
system to have to do this to allow a user to access things which are
really (in the case of the BBB in particular) the thing that it's
designed to do.

There should either be mapping of the ADC, IO etc. to user space or
there should be setuid processes/drivers that allow a user to get to
this information (and output to GPIO).

I believe others are actually working on this as there seems to be
quite a lot of 'noise' about it if you Google the subject.  Thus I
will be patient and see if future software releases sort it out.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to