Table of Contents
- Toolbox download
- System Requirements
- What's new & release notes
- Software requirements, utilities, and drivers
- Browse this release
- Frequently answered questions
- Video guide
- Alternative installation guide
- Full Installation Guide
- The First Bluetooth Connection
Download Version 4.07
Download the full toolbox below, including all functions with sourcecodes, documentation, examples and demos. For installation see the included README.txt file or the installation guide below on this site.RWTHMindstormsNXTv4.07.zip (0.92 MB)
- Operating system: Windows, Linux, or Mac OS
- MATLAB Version 7.7 (R2008b) or higher
- LEGO® Mindstorms NXT building kit (e.g. Education Kit)
- LEGO® Mindstorms NXT firmware v1.26 or compatible (minimum)
LEGO® Mindstorms NXT firmware v1.28 or better (recommended)
- Bluetooth 2.0 adapter recommended model by LEGO® (e.g. AVM BlueFRITZ! USB) supporting the serial port profile (SPP)
- Windows: Device driver & Bluetooth stack which creates a COM-Port
- Windows 64 Bit: New MATLAB Bluetooth object, need Matlab 2011b and the Instrument Control Toolbox V3.0 or higher
- Linux: Bluetooth-packages, especially bluez, as well as rfcomm
- Mac OS: Working Bluetooth configuration
- Windows 32Bit: libusb-win32 or Official MINDSTORMS NXT Driver "Fantom", v1.02 or better
- Windows 64Bit: libusb-win32
- Mac OS: Official MINDSTORMS NXT Driver "Fantom", v1.02 or better
- Recommended: Official MINDSTORMS NXT Driver "Fantom", v1.1.3 or better
- Linux: libusb 0.1 or compatible
What's new & release notes
Browse the complete Release History (also available in section "Release Notes" inside MATLAB on the Toolbox help page).
The correct changelog for just this version 4.07 is availabe here (text format).
Software requirements, utilities, and drivers
|NXT Firmware||You can use any of the following Mindstorms NXT firmware versions:
|USB Driver||Mac OS:
|Bluetooth||For Windows 32 Bit:
|NXC Motor Control||In order to transfer the NXC program MotorControl to the NXT, you need:
Browse this release
Frequently answered questions
If you have problems the documentation and readme-file cannot solve, you might want to consider our FAQ-Page.
The RWTH - Mindstorms NXT Toolbox is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The RWTH - Mindstorms NXT Toolbox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Here you can find a nice video installation guide of the RWTH - Mindstorms NXT Toolbox, the MotorControl Software, and the LEGO NXT Driver provided by Clemson University. Videos for Windows and Mac support are provided. Nice work!
- Extract the archive anywhere you want, KEEPING DIRECTORY STRUCTURE
- The destination folder should contain a directory called RWTHMindstormsNXT
Set MATLAB path
- In MATLAB, go to "File", "Set Path…", "Add Folder…"
- Browse to the location you extracted to, and add the folder RWTHMindstormsNXT
- Also add the folder tools (it is a sub-directory of RWTHMindstormsNXT) to the MATLAB path
- Press Save to remember settings for future MATLAB sessions
Check NXT Firmware
- Make sure you are using a LEGO NXT firmware version 1.26 or higher (1.29 recommended!), otherwise you have to upgrade.
- Link to download 1.29: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Firmware
- You can use the script FlashNXTWithFirmware1.29.bat from /tools/MotorControl to update your firmware, or any other tool of your choice.
Transfer MotorControl to NXT
- Get NeXTTool.exe from http://bricxcc.sourceforge.net/utilities.html and save it to /tools/MotorControl (subfolder of the toolbox)
- Use NeXTool to download MotorControl*.rxe (there should only be one) to your NXT. On Windows, call TransferMotorControlBinaryToNXT.bat
- Follow the on-screen instructions
- If this doesn't work, you can try a different method / batch file. You need the NBC compiler for this step, get it here: http://bricxcc.sourceforge.net/nbc/, or try the latest version from test_release.zip from http://bricxcc.sourceforge.net/
Check other software requirements
- Windows 32 Bit
- USB: Libusb_win32 or NXT Fantom driver installed?
Get libusb_win32 here: http://www.libusb.org/wiki/libusb-win32 or Fantom here: http://mindstorms.lego.com/en-us/support/files/Driver.aspx
- Bluetooth: Drivers installed, NXT visible etc., COM-Port available?
- USB: Libusb_win32 or NXT Fantom driver installed?
- Windows 64 Bit
- USB: Libusb_win32 installed?
Get libusb_win32 here: http://www.libusb.org/wiki/libusb-win32
- Bluetooth: Drivers installed, NXT visible etc., Matlab 2011b and Instrument Control Toolbox Version 3.0 or better installed?
- USB: Libusb_win32 installed?
- USB: Install libusb
- See LinuxReadme.txt in /tools/LinuxConnection
- Mac OS
- USB: NXT Fantom driver installed? Get it here: http://mindstorms.lego.com/en-us/support/files/Driver.aspx#Driver
- Bluetooth: See below for Mac OS details, or follow LinuxReadme.txt in /tools/LinuxConnection
First USB connection
- Inside MATLAB, execute COM_OpenNXT
The command should complete without an error!
First Bluetooth connection
- Inside MATLAB, execute COM_MakeBTConfigFile
Enter the serial COM-Port of your Bluetooth driver, the rfcomm device you're using
- Or edit a bluetooth-example ini-file from the toolbox folder to suit your configuration. The most important thing is the correct serial port.
- If you use Windows 64 Bit you just have to enter the Remote-Name or the MAC-Address and the Channel (you don´t have to care about serial ports!)
- Establish a Bluetooth connection to your NXT using your adapter's driver software, or using the script btconnect we provide in /tools/LinuxConnection
- Authenticate with the NXT (a passkey request should appear)
- The BT-icon on the top left of the NXT screen should turn from B< to B< >, otherwise it won't work! (Under Windows 64 Bit the Icon changes AFTER you used "COM_OpenNXT"!)
- If this doesn't work, use the NXT menu to navigate to Bluetooth, Search, select your computer, connect. Again, you need the symbol B< > on your NXT screen.
- If this still doesn't work, your Bluetooth hardware might be incompatible, or maybe you need a different driver! Check http://www.mindstorms.rwth-aachen.de/trac/wiki/BluetoothAdapter
- Disconnect the USB cable from the NXT.
- You can now type the following commands in MATLAB, given that you created a file called bluetooth.ini:
The commands should complete without an error!
- Only necessary for MATLAB versions prior to Release 2010a (i.e. older versions than 7.10)
- Inside MATLAB, type OptimizeToolboxPerformance
- Confirm the dialog with yes, the script should complete without an error!
Try the examples
- Look inside the folder demos of your toolbox directory
- Enjoy the examples
Alternative installation guide
Full Installation Guide
The RWTH - Mindstorms NXT Toolbox is a collection of MATLAB-functions (so called m-files)
and documentation / help files (mostly HTML). You have received these files in a
compressed archive, that just needs to be extracted to a directory of your choice. This
folder can even be on an external hard disk, USB stick or network drive. However it is
recommended to use a folder on a normal hard disk drive for performance reasons.
So just uncompress the archive and remember the folder you extracted it to.
Make sure that the internal sub-directory structure is kept! Also it is important that all
files are located in a sub-folder called RWTHMindstormsNXT for identification purposes.
Now inside MATLAB, go to the menu "File" and choose "Set Path…". Inside the new window, press "Add Folder…", and browse to the location where you extracted the files from the archive to in the previous step. Now select the folder RWTHMindstormsNXT and confirm. Repeat this step, and add the folder called demos, which is a sub-folder of the previously added RWTHMindstormsNXT-directory. When done, press "Save" to remember these settings for future MATLAB sessions.
|Open the "Set Path" window||Add the RWTHMindstormsNXT folder and its subfolder demos|
After adding these 2 folders to the MATLAB search path, the installation is complete. To
verify the installation, you can type the following line
info = ver('RWTHMindstormsNXT')
inside the MATLAB command window. Also the command COM_CloseNXT('all') should work and complete without an error.
The First Bluetooth Connection
(if you use Windows 64 Bit read the Note at the end of this paragraph)
Before you can begin working with Bluetooth connections, you have to create a settings
file that contains information about your Bluetooth adapter and serial port.
Either you can use the toolbox-command COM_MakeBTConfigFile inside the command window. A
dialog window lets you enter the required parameters. The other way is to edit the
example-files called bluetooth-example-windows.ini or bluetooth-example-linux.ini,
that are provided in the toolbox root folder.
You can leave the default values for the beginning, the only thing you will have to enter is the COM-Port or the Remote-Name/MAC-Address and Channel (depends on your OS). The Bluetooth SPP (serial port profile) maps a virtual COM-Port to your adapter. Find out which port this is (under Windows you can use the Device Manager) and enter it in the dialog window (example: COM4). The other parameters are explained in the documentation. Advanced users should refer to the first chapter Bluetooth connections and serial handles of the section Functions - Overview.
If there is more than one additional Bluetooth COM-Port, this is most likely caused by the adapter's driver software. Most of the time it is the lowest available COM-Port (above the classic "real ports"). The only way to be sure is to try which ports are working. (Sometimes there are certain ports that only work for sending OR receiving. The toolbox however needs a bidirectional port.)
|Device manager with correct Bluetooth serial port||Dialog window of COM_MakeBTConfigFile command|
Linux users should use the bluez Bluetooth stack. The serial port will then be called /dev/rfcomm0 or similar.
This is the parameter that has to be added instead of COM3 for example. The sample ini-file for Linux does not contain all
settings as they are not needed here.
Once the correct ini-file is created, it can be put inside the toolbox root path or anywhere inside the MATLAB search path for better convenience.
You can now try the demos (which require a correct configuration file called bluetooth.ini) or start opening connections using the toolbox command COM_OpenNXT. Note that before this works, you have to establish a physical connection to your NXT. Depending on your Bluetooth adapter's driver software, this can be different. Once successful, the NXT and driver software will prompt you for a passkey. The authentification is then complete, and the toolbox should work properly.
Note for Windows 64 Bit:
To use the Toolbox you don´t have to care about serial ports anymore. You just have to enter the NXTs Remote-Name or MAC-Address and the Channel that you want to use for the connection in the COM_MakeBTConfigFile dialog window.
|Bluetooth manager with paired NXTs||Dialog window of COM_MakeBTConfigFile command for Windows 64 Bit|
If you enter the Remote-Name and the MAC-Address the Toolbox first tries to connect to a Bluetooth device with the given MAC-Address. If this succeeds it will check it the name in the ini-File and the Remote-Name of the device Match. If the Toolbox can´t find an NXT matching to the MAC-Address it will try to find an NXT with the given Remote-Name.
For further details see the included readme.txt file located in the toolbox directory.