-
Notifications
You must be signed in to change notification settings - Fork 32
/
INSTALL.Linux
239 lines (163 loc) · 7.84 KB
/
INSTALL.Linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Exodriver (liblabjackusb) Library Installation Instructions
============================================================
Table of Contents
-----------------
Linux Requirements
About These Instructions
liblabjackusb Library Script Installation
Install Without Root
Compiling and Running the Example Programs
Machines Using VirtualBox
liblabjackusb Library Manual Installation
LabJackPython and the Exodriver on Ubuntu 10.04
Uninstalling the Old U3 and UE9 Driver
Linux Requirements
------------------
1. GNU C compiler (gcc).
For example in Ubuntu, run the following shell command to get it if needed:
$ sudo apt-get install build-essential
2. The libusb-1.0 library and development files. Download the source here:
http://libusb.info
3. Linux kernel 2.6.28 or higher. To use older 2.6.x kernels, you must upgrade
your firmware. These are the required firmware versions when using older
2.6 kernels:
* U3 with hardware version 1.30 or higher - Firmware 1.18 and higher
* U3 with hardware version less than 1.30 - Only kernel 2.6.28 and higher
supported. Unsupported on older kernels.
* U6 - Firmware 0.81 and greater
* UE9 - Comm Firmware 1.49 and greater
4. Uninstall any old U3 and UE9 kernel-module based drivers. The old driver
and custom kernel modules conflict with the current liblabjackusb library.
See the "Uninstalling the Old U3 and UE9 Driver" section for more
information.
About These Instructions
------------------------
All lines that start with a dollar sign ($) are commands and need to be run
from a terminal. For example, the Terminal application in Ubuntu version 10.04
is usually accessed through Applications -> Accessories -> Terminal.
liblabjackusb Library Script Installation
-----------------------------------------
In the exodriver/ directory, run the following command:
$ sudo ./install.sh
This script will attempt to build, install, and make any necessary system
configurations so that the user that runs it will be able to use LabJack
devices.
For information on allowing multiple users to use LabJack devices, see the
"Permissions" section under "liblabjackusb Library Manual Installation".
For more information, read the section titled liblabjackusb Library Manual
Installation later in this file.
Install Without Root
--------------------
To install without root / sudo access, invoke `make install` with:
- PREFIX set to the desired installation directory
- LINK_SO set to true
- RUN_LDCONFIG set to false
For example:
$ cd libjabjack/
$ make
$ make install PREFIX=myprefix LINK_SO=1 RUN_LDCONFIG=0
Note: when installing without root and setting up LabJackPython, the
LabJackPython.py source file will need to be modified to properly load the
liblabjackusb library. Change the line in the _loadLinuxSo() function
From:
l = ctypes.CDLL("liblabjackusb.so", use_errno=True)
To:
l = ctypes.CDLL("new absolute path for liblabjackusb.so", use_errno=True)
Compiling and Running the Example Programs
------------------------------------------
The example code/programs use the liblabjackusb library and the labjackusb.h
header files in the liblabjackusb/ directory.
The examples are located in the U3, U6, and UE9 subdirectories in the examples/
directory. To compile the programs go to your device's directory and run
$ cd examples/U6/
$ make
Run one of example programs like this:
$ ./u6BasicConfigU6
Machines Using VirtualBox
-------------------------
Customers using Oracle's VirtualBox software should add themselves to the
vboxusers group, either through their distribution's GUI interface or through
the command: sudo usermod -a -G vboxusers USERNAME
liblabjackusb Library Manual Installation
-----------------------------------------
For Ubuntu 10.04, see the section titled "Up and running with LabJackPython
and the Exodriver on Ubuntu 10.04" later in this document.
In the liblabjackusb/ directory, run the following commands to compile and
install the library.
$ cd liblabjackusb/
$ make
$ sudo make install
Programs that use liblabjackusb will need to access the USB device bus at
/dev/bus/usb/, without root permission. On Debian-based distributions, we
provide udev rules that allow all users to access LabJack devices.
To Install The udev Rules:
To install the udev rules, run the following command from the root
directory of this package:
$ sudo cp 90-labjack.rules /lib/udev/rules.d
Next, reload the udev rules. For instructions, see the section "To Reload the
udev Rules" below.
To Set Restrictive Permissions:
The current udev rules in 90-labjack.rules give LabJack device access to all
users. If you need to restrict permissions, alter 90-labjack.rules or install
custom rules to /etc/udev/rules.d/, which takes priority over
/lib/udev/rules.d/. For example, to restrict usage to members of the adm group:
$ sudo cat > /etc/udev/rules.d/90-labjack.rules << EOF
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="labjack_rules_end"
# LabJack Vendor ID
ATTRS{idVendor}=="0cd5", MODE="0664", GROUP="adm"
LABEL="labjack_rules_end"
Next, reload the udev rules. For instructions, see the section "To Reload the
udev Rules" below. Also, notice that the MODE is 0664, which is the only
difference between what's installed as /lib/udev/rules.d/90-labjack.rules by
default. For more information about writing udev rules, see "man udev".
To Reload the udev Rules:
To reload the udev rules, the following command works on most systems:
$ sudo udevadm control --reload-rules
Older vesions of udevadm (e.g., the version included in Ubuntu 8.04) use an
underscore instead of a dash: "--reload_rules" instead of "--reload-rules":
$ sudo udevadm control --reload_rules
On Debian-based distributions, the above two commands are sufficient. If
your distribution does not have udevadm, restart udev or restart your
computer. On a Fedora machine run:
$ sudo /etc/init.d/udev-post reload
LabJackPython and the Exodriver on Ubuntu 10.04
-----------------------------------------------
As we detailed in May 2010 (updated with the "liblabjackusb Library Manual
Installation" section's steps):
http://labjack.com/blog/running-labjackpython-and-exodriver-ubuntu-1004
Ubuntu 10.04 comes with a binary release of libusb-1.0, so building the
Exodriver is easier than ever. Install the dependencies with apt-get,
checkout the Exodriver source code, and build it. Here are the complete
steps, along with a handful of steps at the end that build LabJackPython
(http://labjack.com/support/labjackpython) which is our Python module
that works well with the Exodriver:
$ sudo apt-get install build-essential
$ sudo apt-get install libusb-1.0-0-dev
$ sudo apt-get install git-core
$ git clone git://github.com/labjack/exodriver.git
$ cd exodriver/
$ sudo ./install.sh
$ cd ..
$ git clone git://github.com/labjack/LabJackPython.git
$ cd LabJackPython/
$ sudo python setup.py install
$ python
>>> import u3
>>> d = u3.U3()
>>> d.configU3()
Uninstalling the Old U3 and UE9 Driver
--------------------------------------
The old U3 and UE9 driver used custom kernel modules, and will conflict with
with the current liblabjackusb library. To uninstall the old driver please
unload and delete the U3 and/or UE9 kernel modules, delete the liblabjackusb.so
library and remove any scripts or udev rules you may have been using to load
the kernel module's device nodes. The following commands, or similar depending
on the directories you copied files to, should help prepare your system for the
new liblabjackusb 2.0 library:
$ rmmod labjacku3
$ rm labjacku3.ko /lib/modules/`uname -r`/kernel/drivers/usb/misc/labjacku3.ko
$ depmod -a
$ rm /usr/lib/liblabjackusb.so
These commands remove the udev rules we provided on the forums:
$ rm /etc/udev/rules.d/10-labjack.rules
$ sudo udevadm control --reload-rules