source: trunk/tools/LinuxConnection/LinuxReadme.txt @ 1062

Revision 816, 4.5 KB checked in by atorf, 5 years ago (diff)

Updated LinuxReadme? (we need libusb-0.1)

Line 
1This archive contains some useful scripts to get the
2RWTH - Mindstorms NXT Toolbox for MATLAB running under Linux.
3
4
5Scripts in this archive:
6
7* btconnect
8Syntax of this script is: btconnect <NXTsMACorName>
9The expression <NXTsMACorName> can either be the MAC address (i.e. 00:16:.....)
10or the Name (i.e.: "My NXT") of the NXT brick that you want to connect to.
11After a successful connection, the terminal will be blocked until hung up. The
12toolbox is now ready to use! For further information see the online help (call
13"btconnect --help").
14
15* 41-legonxt.rules
16This udev rule file is used to make sure that an NXT device
17is ready to be used with USB and Bluetooth. See below in the USB section for
18further explanations.
19
20
21
22*** BLUETOOTH ***
23
24To get Bluetooth up and running with the NXT and our toolbox, the bluez
25bluetooth stack must be installed. In order to do so, you should use your
26packet manager (e.g. Debian's apt-get) to retrieve the following packets (or
27similar, depending on your distribution):
28 - bluetooth
29 - bluez-utils  (should be included in bluetooth anyway)
30 - dbns
31 - dbns-x11     (includes the bluetooth-applet)
32
33Once properly installed, you should execute the following command in a terminal
34window (assuming you use the Gnome Desktop environment):
35
36 bluetooth-applet --singleton
37
38Once the applet is running, a Bluetooth icon should appear in your system tray.
39This is important: You are ready to use the script btconnect now, but when
40using it the first time, the Bluetooth icon in the systray will flash and wait
41for user input. Enter the authorization key that was set on the NXT before
42(usually 1234). Now the script btconnect should create a device called
43/dev/rfcomm0, which is the virtual serial port the MATLAB toolbox uses. It
44might be a good idea to add the bluetooth-applet to your autostart. If the
45bluetooth-applet can't be found on your machine, try installing desktop-
46specific packets (i.e. gnome-bluetooth).
47
48If you use KDE, you may need similar steps to get a Bluetooth icon in the
49system tray. Refer to the KDE documentation for details.
50
51If your user account doesn't have permissions to read and write the device
52files /dev/rfcommX, the connection may fail. You can use the provided
5341-legonxt.rules file to assign read and write permission to the system group
54"legonxt". You then need to make sure that the group "legonxt" exists and make
55your user account a member of the group. See the USB paragraphs below for more
56information.
57
58
59*** USB ***
60
61First you have to make sure that the open-source library libusb is properly
62installed. You can either retrieve it from the project's homepage
63http://libusb.wiki.sourceforge.net/ or download it using your packet manager
64(e.g. Debian's apt-get). If the package "libusb" does not work, please try
65installing "libusb0", the latest version "libusb-0.xx", or "libusb-0.1",
66or "libusb-dev". You definitely need version 0.1, version 1.0 will not work
67(but there is a compatibility layer for 0.1 which we have never tested).
68
69This was just one step. The second thing to do is making connected NXT devices
70appear inside the /dev/ folder with the right read/write permissions. That is
71what the udev rule file is needed for (root rights are required):
72
731. Copy the file 41-legonxt.rules to /etc/udev/rules.d,
74   e.g., by executing the following:
75
76cp 41-legonxt.rules /etc/udev/rules.d
77
782. Once successful, you might need to restart the udev-service. If unsure,
79   reboot your system. When connecting an NXT device to a USB port, a new
80   device /dev/legonxt-x-y should appear (with x and y depending on your
81   kernel and USB bus and port).
82
833. The /dev/legonxt file should be read-/writeable by all users belonging
84   to the group "legonxt". Thus, you need to make sure that this group exists
85   and your user account is a member of it. Alternatively, you can edit the
86   rules file and change the GROUP="legonxt" entries (one per line) to
87   GROUP="plugdev", for example. On Debian-like distributions, users are
88   member of the "plugdev" group by default. Then you don't need to create
89   the group and fiddle with membership.
90
91
92This manual and the USB scripts are partly taken from:
93http://forums.nxtasy.org/index.php?showtopic=2143&view=findpost&p=16723
94
95If you need more resources, these links are recommended for further reading:
96
97http://jan.kollhof.net/wiki/projects/Lego/linux
98http://www.lysator.liu.se/~nisse/lego-nxt-dev/
99http://nxt.ivorycity.com/index.php?/categories/3-Linux-USB
Note: See TracBrowser for help on using the repository browser.