Hello,
I'm having trouble sending values to the AD5781 using iio_writedev command.
I tried the following command:
iio_writedev -a -s 1000 ad5781 voltage0 < ./samples.dat
And got the error:
Unable to get sample size, returned 0
The device is available on my Raspberry Pi
iio_attr -o -c ad5781 voltage0
dev 'ad5781', channel 'voltage0' (output), attr 'offset', value '-131072'
dev 'ad5781', channel 'voltage0' (output), attr 'powerdown', value '0'
dev 'ad5781', channel 'voltage0' (output), attr 'powerdown_mode', value '6kohm_to_gnd'
dev 'ad5781', channel 'voltage0' (output), attr 'powerdown_mode_available', value '6kohm_to_gnd three_state'
dev 'ad5781', channel 'voltage0' (output), attr 'raw', value '0'
dev 'ad5781', channel 'voltage0' (output), attr 'scale', value '0.019073559'
The samples.dat file is saved in binary format
# hexdump -d samples.dat
0000000 12824 05427 13106 12828 07219 13106
000000c
I am able to send values via the echo command
/sys/bus/iio/devices/iio:device0# echo 131072 > out_voltage0_raw