2013-10-29

MCC DAQ miniLAB 1008 (USB) under Linux

Most of the MCC DAQ's USB and PCI devices have 3rd party Linux kernel drivers. For details, see: http://www.mccdaq.com/daq-software/Linux-Support.aspx
  1. Fetch all stuff from here: ftp://lx10.tx.ncsu.edu/pub/Linux/drivers/USB/
  2. Read the README_mcc_usb file CAREFULLY. You have two options:
    1. hiddev
      1. + Easy, works unprivileged.
      2. - May not be present in linux kernel v3.0+, and is not working in 2.4 at all.
      3. - SLOW: max 200Hz (which is not enough for a big setup)
      4. - No documentation and examples exists.
    2. libhid/libusb
      1. + Uses libusb, works under all linux kernels
      2. + No theoretical ceiling for max throughput.
      3. + libusb is portable through Linux, Windows, Mac, etc
      4. - Needs to be run as root, or set the executable to suid.
      5. - Need USB programming knowledge.
      6. - Compiling libhid manually.
  3. I assure you, option 2 (libhid+libusb) will be better.
  4. Step 0: Deploy dependencies
    1. sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
  5. Step 1: Deploy libhid
    1. Fetch libhid from http://libhid.alioth.debian.org/
    2. tar -xzf libhid*.tar.gz
    3. cd libhid*
    4. ./configure --prefix=/usr --sysconfdir=/etc --disable-werror
    5. make
    6. sudo make install
  6. Step 2: Deploy the MCC-specific libhid-based usb library
    1. wget ftp://lx10.tx.ncsu.edu/pub/Linux/drivers/USB/60-mcc.rules
    2. sudo cp 60-mcc.rules /dev/.udev/rules.d/
    3. sudo udevadm control --reload-rules
    4. tar xzf MCCLIBHID*.tgz
    5. cd libhid (this is another directory!)
    6. Edit the Makefile
      1. Add " -lm" to the end of the line (after "-o $@") in the libmcchid.so target.
      2. Replace all occurence of "/usr/local/" to "/usr/" (there will be 33)
    7. make
    8. sudo make install
    9. run your device's test as root, like "sudo ./test-minilab1008"
      1. Good: "miniLAB 1008 Device is found!" and a menu-driven test interface
      2. Bad: 
        1. "hid_force_open failed" - you're not root
        2. Any other error message: well, hack :-)

No comments :

Post a Comment