AnsweredAssumed Answered

What permissions required for non-root access to libiio buffers?

Question asked by Jonathan_Eidsness on Nov 22, 2016
Latest reply on Nov 23, 2016 by Jonathan_Eidsness

When trying to instantiate a buffer using the python bindings for libiio. I encounter a permissions error.

I've written a udev rule to change group ownership of my iio devices like so:

KERNEL=="iio:device[0-9]*", SUBSYSTEM=="iio", GROUP="iio"

Which successfully gants rw acces to /dev/iio:deviceX entries to them to my iio group.

I still encounter a permission error when I try the following:

import iio
ctx = iio.Context()
ad7298 = ctx.find_device(b'ad7298')
weld_channel = ad7298.find_channel(b'voltage0')
weld_channel.enabled = True
buf = iio.Buffer(ad7298, 8000)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python3.4/site-packages/iio.py", line 494, in __init__
      self._buffer = _create_buffer(device._device, samples_count, cyclic)
   File "/usr/lib/python3.4/site-packages/iio.py", line 33, in _checkNull
      raise OSError(err, _strerror(err))
PermissionError: [Errno 13] Permission denied

 

How should I modify my rule to fix this?

Outcomes