Post Go back to editing

Null Pointer When Instantiating ad7298 Buffer Using libiio Python Bindings

I'm trying to instantiate a buffer for an ad7298 using the libiio python bindings.

ctx = iio.Context()
ad7298 = ctx.find_device(b'ad7298')

buf = iio.Buffer(ad7298, 8000)
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.4/site-packages/", line 457, in __init__
        self._buffer = _create_buffer(device._device, samples_count, cyclic)
    File "/usr/lib/python3.4/site-packages/", line 27, in _checkNull
        raise Exception("Null pointer")
Exception: Null pointer

The problem seems to be that ad7298.sample_size returns 0.

How can I correct this?