The projects on this page are designed for the LEGO MINDSTORMS NXT 2.0 (8547) kit and software. No extra parts are required. These projects cannot be used with the NXT 1.X kits (see instead the Projects for NXT 1.0). Users of the NXT 2.0 kit may also be able to build some of the Projects for NXT 1.X, click here for more information. This package contains the files needed for installing the LEGO Mindstorms NXT Firmware. If it has been installed, updating (overwrite-installing) may fix problems, add new functions, or expand existing ones. Even though other OSes might be compatible as well, we do not recommend applying this release on platforms other than the ones specified.
Latest versionReleased:
LEGO Mindstorms NXT Control Package
Project description
Python programming language. It can communicate using either USB or
Bluetooth. It is available under the Gnu GPL v3 license. It is based on
NXT_Python, where releases halted in May 2007.
Requirements:
* Python 2.6 or greater, but not 3.x (http://www.python.org)
And at least one comm library:
* Bluetooth communications:
Linux/Windows: PyBluez (http://code.google.com/p/pybluez/)
(package python-bluez in deb-based linuxes)
Mac: LightBlue (http://lightblue.sourceforge.net/)
* USB communications:
PyUSB (http://sourceforge.net/projects/pyusb/)
* Fantom communications (tested on Mac OSX):
Pyfantom (http://pyfantom.ni.fr.eu.org/)
Installation (see http://code.google.com/p/nxt-python/wiki/Installation):
* Untar/unzip source package.
* In package directory, run 'python setup.py install' (as root), or if
under windows, double-click install.bat.
* To use USB on Linux as non-superuser, at a root terminal type:
groupadd lego
usermod -a -G lego [username]
echo 'SUBSYSTEM'usb', ATTRS{idVendor}'0694', GROUP='lego', MODE='0660' > /etc/udev/rules.d/70-lego.rules
Getting Started:
Take a look at the examples directory. Feel free to copy that code
into your scripts and don't be afraid to experiment! If you are having
trouble with something, you may find the solution in the docstrings (for
example, help('nxt.sensor.Ultrasonic')) or even in the source code
(especially for digital sensors).
Notes/FAQ:
(I have tried to put the most important stuff first, but it would be a good
idea to read the whole section. In any case, read it all the way through
before asking for help. Thanks!)
-=-=-About v2-=-=-
This version is part of the 2.x series of releases. Programs
designed for NXT_Python or for the 1.x series of nxt-python will not
work with this version. If you are trying to get an old program to work,
it most likely needs a 1.x series release, which can be downloaded from
the nxt-python downloads page at googlecode. New projects should use a
2.x series release (hint: this is one!) due to the new features and API
improvements. Converting old projects is somewhat difficult and not
officially supported, though as always you're welcome to ask for help.
-=-=-Problems and Their Solutions-=-=-
Support for a number of sensors has not been tested at all, due to
lack of hardware. I have started a project to test this code, but the
going is slow and I still can't test everything. If you have a problem
with a digital sensor, see the troubleshooting guide below and don't
forget to report your trouble!
The Synchronized Motor support has not been extensively tested for
accuracy. It seems to mostly work well but the accuracy of the braking
function and the closeness of the two motors to each other have not been
given a formal scientific assessment.
NXT-Python has not been tested and may not work with custom nxt
firmware versions (if you don't know what that means, you don't need to
worry about it). However, if the firmware supports the standard LEGO
USB/BT communications protocol, everything should more or less work.
NXT-Python has been tested with bricks using LEGO firmware version up to
1.29 and is compatible with protocol version 1.124 (used by most if not
all of the official firmwares). It has also been reported working with
LeJOS.
-=-=-If you co'd the SVN...-=-=-
The arduino directory of an svn checkout (not included with release
packages) contains a digital sensor unit test system called nxtduemu. It
is intended for developers and advanced users who are looking to
experiment with sensors and the digital sensor framework and classes.
See Arduino/README for more info and usage instructions.
Specific Stability Status:
nxt.brick, nxt.telegram, nxt.direct, and nxt.system:
Have been redone somewhat as of v2.2.0 but appear to work well.
USB Communication System (nxt.usbsock)
On Linux: Very stable and extensively tested.
On Windows: Somewhat tested; seems to work pretty well.
On Mac: Some users having problems.
BlueTooth Communication System (nxt.bluesock, nxt.lightblueglue)
On Linux: Stable; well tested with both pybluez and lightblue.
On Windows: Stable; working last I checked.
On Mac: Some users having problems.
Internet Communications System (nxt.ipsock)
Seems to work for the most part. Occasionally has hiccups.
Fantom Communications System (nxt.fantomsock)
On Linux: N/A (Fantom driver not supported)
On Windows: Not tested.
On Mac: Tested, USB interface working, Bluetooth not working.
nxt.locator:
Tested working with revamped logic and new code in v2.2.0.
nxt.motor:
Stable except for Synchronized Motor support, which is experimental at
this stage and has not been extensively tested.
nxt.sensor:
Code not specific to a particular sensor is well-tested and working
great. More than half of the sensor classes were last reported working;
the rest have not to my knowlege been tested and were written blindly
from the manuacturers' specifications.
nxt.error:
If there's a problem with this one, I'm gonna cry.
Contact:
NXT-Python's Head Developer:
Marcus Wanner (marcus@wanners.net)
The support and development mailing list:
http://groups.google.com/group/nxt-python
Report bugs and suggest new features at:
http://code.google.com/p/nxt-python/issues/list
Thanks to:
Doug Lau for writing NXT_Python, our starting point.
rhn for creating what would become v2, making lots of smaller changes, and
reviewing tons of code.
mindsensors.com (esp. Ryan Kneip) for helping out with the code for a lot of
their sensors, expanding the sensors covered by the type checking
database, and providing hardware for testing.
HiTechnic for providing identification information for their sensors. I note
that they have now included this information in their website. ;)
Linus Atorf, Samuel Leeman-Munk, melducky, Simon Levy, Steve Castellotti,
Paulo Vieira, zonedabone, migpics, TC Wan, jerradgenson, henryacev,
Paul Hollensen, and anyone else I forgot for various fixes and
additions.
All our users for their interest and support!
Troubleshooting Digital Sensors (don't read unless you have problems):
If you are getting errors, strange behavor, or incorrect values from a digital
sensor, chances are that there is a bug in our code. Follow these instructions
to try and find out what's wrong:
1. Test the sensor with a different access library to make sure it's working
right.
2. Check your code again. There are some weird 'features' in the interfaces
of some of the sensors; make sure you are doing things right.
3. Locate the sensor class's source code in nxt-python. It should be
somewhere in nxt/sensor/<manufacturer>.py, under the heading 'class SensorName(
BaseDigitalSensor):'. Read any comments for instructions on certain things.
If you get to here and are still having a problem, you can either go ahead and
report it now or continue to try and find and fix the problem and then report
it (or not report it at all, but that wouldn't be very nice...).
Python experience required beyond this point.
4. Get the sensor's specifications from the manufacturer's website. Make
sure it includes a table of I2C registers and instructions for using them.
5. Pick one of the following depending on what the problem is:
####Errors:
Cause: We screwed up.
Solution: Check the line mentioned in the error for incorrect syntax or
other problem. A bit of python experience and maybe some googling is needed
here.
####Strange Behavior (in sensors with modes/commands):
Cause: nxt-python's command enumerations are incorrect.
Solution: Verify them using the sensor's specs, and correct any problems.
See 'Incorrect Values' for more.
####Incorrect Values:
Cause: nxt-python is processing the value wrong.
Solution: Check what goes on in the sampling method against what the spec
says should be done. If there is an inconsistency, try to fix it.
Cause: nxt-python has an incorrect register number or type in I2C_ADDRESS.
Solution: Verify the address (the number) and the string (the struct format
string). To verify the address, use the spec. To verify the struct format, you
will need to read this: <http://docs.python.org/library/struct.html#format-
strings> or have experience with struct.
Read the spec for the sensor to determine how the given value should be read,
then start at the sample method and read through it, checking for problems as
you go. If it seems right, go back to the I2C_ADDRESS chunk (near the top of the
class) and make sure that the correct struct format string is being used. The
most common problem here is values that are off by plus or minus 128 or 32768
because of an incorrect signed/unsigned setting. This can be fixed by switching
the case (as in upper or lower) of the letter in the string. Other problems
could include the wrong size (B, H, or L) being used, or, in the two latter
ones, the wrong byte order (< or >). As always, common sense required.
Release historyRelease notifications | RSS feed
2.2.2
2.2.1
2.2.0
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
1.2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size nxt-python-2.2.2.tar.gz (91.6 kB) | File type Source | Python version None | Upload date | Hashes |
Filename, size nxt-python-2.2.2.zip (116.9 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for nxt-python-2.2.2.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 1a40f560778298b8a2b850c33fd0442ef7331a95eb4daef800b5fbb62bc9dc28 |
MD5 | a2407611e2b9475a9686e7981e970f0b |
BLAKE2-256 | feacfb2e5565b5c77d5abb5ad94d4cd3bc958955646a2e0b4498b577926cd92a |
Hashes for nxt-python-2.2.2.zip
Algorithm | Hash digest |
---|---|
SHA256 | 67e7bd09aee557fc07438fcf2d23605bc51ef233f20710c5732be36915b48f34 |
MD5 | 93a7f420e34082ff833f6196eb01b35e |
BLAKE2-256 | 410193d6722155c1f524119d4c5b8a39d41d35af04c7e77d360217eaadc544da |
Bringing back your old LEGO Mindstorms RCX to life is easier than you might expect. The bottleneck is being able to communicate with the RCX using the Infrared Communication Tower. Version 1 used a tower that was attached to the computer using the old serial port (RS232) while version 2 used a USB tower. The later is much easier to use these days since most computers still have plugs that are compatible with USB1.1. For this tutorial you will need:
- Windows XP
We will setup a virtual machine on your host computer (Mac or PC) and install Windows XP on it. We will then install the original Robotic Invention System (RIS) so that the USB driver is correctly installed. You can then use RIS to program you RCX or you can setup many other programming environments/languages. Another problem you might encounter is that the cables used to connect the sensor and actuators to the RCX have become brittle and the isolation comes off easily. You can still buy some new cables from Bricklink.
1. Install Virtual Box
Nxt 2.1 software, free download
Virtual Box is a free software to run virtual machines on any host computer. I am running a Mac and had to run Windows XP. With Virtual Box this is no problem. You can also use Virtual Box to run Mac OS X on a Windows computer. Virtual machines are pretty versatile.
2. Run the Virtual Box installer
Double click on the downloaded installer to run the process.
3. Install WindowsXP
4. Create a new virtual machine
5. Select Windows XP operating system
Give your virtual machine a name and select WindowsXP 64-bit as your Version. Then press continue. The wizard will walk you though a couple more steps and I selected the default options for all of them. I cannot help you with providing a Windows XP ISO file since you will also need a product key. Those are still hard to come by.
6. Select disk image
You can either insert an original Windows XP installer CD/DVD or you can select an ISO image. I already has a Windows XP ISO image on my hard disk, which is a much faster way to install any operating system. Click on 'Start' to start the process.
7. Run through the Windows XP installation process.
8. Install Robotic Invention System (RIS)
Download the RIS version 2 and mount the disk into the virtual machine by clicking on the DVD icon at the bottom of the screen. Select the RIS2.iso file. This will mount the disk and the install wizard will automatically start.
9. Run through the RIS installer
Do not yet plug in your USB Infrared tower. That will be part of the RIS setup wizard. The installer will also ask you to keep your more up to date ActiveX version (select yes) and it will also install QuickTime. You do not need to enter any registration number for QuickTime, just click on 'Next' once you are at that step. In the last step the installer will ask you to restart your computer. Go right ahead, it will only reboot your virtual machine.
10. Start the RIS
The first time you run the RIS it will walk you through the setup of our Infrared Tower and RCX.
11. Follow the wizard
Lego Nxt 2.0 Software Download Mac Installer
The wizard will start with the setup of your infrared tower. Click on 'Forward'
12. Select the USB Tower
In this step you can select between the old serial (RS232) and the USB tower. Hopefully you have the USB tower. Select it and click on 'Forward'
13. Mount the USB tower to your virtual machine
The wizard will ask you to plug your tower directly into the computer. When you do this, it will not yet show up in your virtual machine. You need to select the USB icon in the bottom bar and select the LEGO USB Tower to mount it into your virtual machine.
14. Go through the new hardware wizard
The previous step will trigger the new hardware wizard. You can use all the default options.
15. Insert the batteries into the RCX and place it in front of the tower.
The setup wizard will ask you to put batteries into the RCX, put it in front of the tower and switch the RCX on.
16. Install 2.0 firmware
It will then download the 2.0 firmware onto your RCX.
17. Check the firmware status
Your RCX should look like this after the firmware was installeced correctly.
18. Complete the setup wizard and start programming
Mindstorm Nxt 2.0 Software Download
You are all ready to go. Just build a robot you desire and program it in the RIS.