Does this succeed?:
sudo modprobe dt9812
And if it succeeds, does this work?:
sudo comedi_config /dev/comedi0 dt9812
The first command should load the kernel modules if they're not already
loaded. The second command maps /dev/comedi0 to a dt9812 device if the
driver has detected one.
(There is some new auto-configuration stuff in comedi that should make
the comedi_config command unneccessary in the future, but it hasn't been
implemented yet for the dt9812 driver.)
If the modprobe never succeeded, it may be because the drivers never
built properly. Check the output of 'make' for the 'comedi' package.
It's a little confusing because the Makefile is currently set up to
ignore compilation errors!
In fact, you are unlikely to get comedi-0.7.76 to build on a recent
kernel version, so you will be better off trying the CVS version.
You should also be able to find Debian or possibly Ubuntu packages, but
I'm not sure if they work.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Comedi_lib installed fine from the repositories so I used it and did not
build it.
So yes, build from the current CVS version using the instructions found
here: http://www.comedi.org/wiki/Installation_on_Ubuntu
I had to add a UDEV rule to get a PCMCIA card to be properly loaded, but
I don't think you will need to do so for a USB device.
--
Fred Fox, Agricultural Engineer
USDA-ARS Wind Erosion Research Unit
1515 College Avenue
Manhattan, KS 66502
E-mail: fred...@ars.usda.gov
phone: (785)537-5540
fax: (785)537-5507
Web: http://www.ars.usda.gov/npa/gmprc/weru
I think this is due to the auto-configuration feature that was added to
comedi recently, but hasn't been implemented for the dt9812 driver yet.
You'll need to pass some parameters to the comedi module when it is
being loaded. The easiest way to do this is to create the file
/etc/modprobe.d/comedi and add one of the following lines:
options comedi comedi_autoconfig=0
-or-
options comedi num_legacy_minors=4
The first variant disables comedi's auto-configuration feature
completely. The second variant reserves the first 4 devices
/dev/comedi0 through /dev/comedi3 for "legacy" devices, i.e. those
devices whose drivers don't support auto-configuration. Any
auto-configured devices would start at /dev/comedi4 in this case. The
number '4' can be changed to anything from 0 to 48 to reserve that many
legacy devices.
You need to add '-lm' to link with the math library for the 'floor' and
'nearbyint' functions.
> Then when I used the "g++" compiler it seemed to compile but when I
> executed the executable file "./test1" I got this message:
> ./test1: error while loading shared libraries: libcomedi.so.0: cannot
> open shared object file: No such file or directory
>
> Am I missing something?
You need edit the /etc/ld.so.conf file, or edit a <something>.conf file
in the /etc/ld.so.conf.d/ directory. Add the following line:
/usr/local/lib
Then run /sbin/ldconfig to update the binary /etc/ld.so.cache file.
This sets the dynamic linker run-time bindings. See 'man ldconfig' for
more information.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
The comedi_test program is a good one to try. Yes, the driver doesn't
support the comedi_command interface, only the simpler 'insn' interface.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
It's compiled as 'board_info' now.
> Also there is this problem that I am not sure if it is due to me
> having not configured comedi right for the dt9812. When I run the
> simple program found in section 3.1 of the site document, which is
> suppose to give me a number between 0 and 4095, I end up always
> getting a 1 if the board is connected. I get a 0 if it is not
> connected.
You need to set 'subdev = 2' in the program to match the number of the
AI subdevice on your board.
You should find that comedi_data_read() returns -1 if the board is
disconnected, indicating an error. The error can be retrieved by
calling comedi_errno() and should be ENODEV in this case (defined in
<errno.h>).
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
You probably need to add '/usr/local/lib' to your dynamic linker search
path, assuming that's where your 'libcomedi.so.0' is installed. You can
do that by editing the '/etc/ld.so.conf' file, or by adding or editing a
file in the '/etc/ld.so.conf.d/' directory. The format is pretty simple
- just list each directory on a line by itself and use lines beginning
with '#' for comments. You need to run '/sbin/ldconfig' afterwards to
update the binary '/etc/ld.so.cache' file that the dynamic linker
actually uses at runtime.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-