Personal tools
You are here: Home Members gillesgigan Sensor Gateway LabJack support
Document Actions

LabJack support

by Gilles Gigan last modified 2007-09-27 10:30

Guide to add labjack support to the sensor gateway

LabJack & HID


If HID is compiled in the kernel, make sure it doesnt get in the way of the labjack driver by blacklisting the LabJack device and recompiling the kernel as described here.
If HID is compiled as a module, it must be unloaded before loading the labjack module. After that, HID can then be reloaded.


LabJack driver


Get the source and unpack:

wget "http://www.labjack.com/files/linux-labjack.tar.gz" && tar -zxvf linux-labjack.tar.gz && cd linux-labjack/driver/linux-2.6

Comment out the "#include <linux/config.h>" in labjack.c (line 43) and compile with make. Try loading the module with

insmod ./labjack.ko

If something like "LabJack USB #0 now attached to major 180 minor 240" appears in the log file (/var/log/message or /var/log/syslog) then all is good. Remove the module with

rmmod labjack

Copy the module in the module directory and update module dependency info. Create a "labjack" group and setup udev to create the device file with mode 660 and group ownership to the labjack group. Restart udev if the kernel is not compiled with inotify, otherwise udev will pick up changes as soon as they are saved.

cp labjack.ko  /lib/modules/`uname -r`
depmod -ae
groupadd labjack
echo "ATTRS{idProduct}=="0001", ATTRS{idVendor}=="0cd5", GROUP="labjack", MODE="0660", NAME="usb/%k""  > /etc/udev/rules.d/10.labjack.rules
usermod -aG labjack sensor_user
killall udevd
udevd --daemon

LabJack library


Compile and install the labjack library with

cd ../../liblabjack
make
cp liblabjack.so /usr/lib

Try compiling the test apps and see if the labjack is detected with

cd ../test
make
./list-all

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: