Welcome to the early version of www.mrs.systronix.com
This web site is the work of Systronix Inc.
Lego Logo     MSDN logo

Updated 2006 Dec 08

Front of the box and some of what is inside. You get a lot of Technic parts, mostly "studless".

First Impressions:

Some of my first impressions of Microsoft Robotic Studio (MRS for short) have been presented at the Java.net robotics community and on the Lego user group mail list. There are many compelling reasons to look very closely at MSR. A lot of people are dismissing MRS just because it's from Microsoft. That's unfortunate (the dismissal) since they may be missing out on something really good.

Enough opinion; let's get busy:

Where to Start: Lego NXT

So, after some hours of wheel-spinning trying to figure out how to write our own DLL for the transducers on the Java.net Robot Fusion project, we have decided to retrench and start much simpler. One obvious and affordable approach is to use off the shelf hardware and software. In this case that means the new Lego NXT Mindstorms kit, a PC, MRS software (the Nov 2006 release), and a Bluetooth adapter (Targus ACB10US from the nearby Staples store). Also I have a Bluetooth phone, the Motorola Razr V3. Let's not forget batteries. I have a box of new Powerizer AA NiMH 2300 mAHr, and a great little Ultra rapid charger with (a surprisingly useful) LCD display. It charges each battery individually and the LCD shows the progress of each battery.

Ultra rapid charger w/LCD

Get the NXT controller brick running

The NXT box claims "your first robot in 30 minutes" but since I'm writing and photographing as I go (my friend and fellow Lego wizard Russ calls this 'leaving a trail of bread crumbs') it may take a bit longer. Indeed, it takes me 30 minutes to open the box and hook up the first NXT light sensor demo program, which only requires installing batteries, plugging in the light sensor and running the built in example program.

Install PC Bluetooth adapter

The Targus adapter comes with a cute mini-CD install disk which must be used before plugging in the USB adapter. Note that this adapter isn't on the Lego approved list, but is on this much larger list: http://www.vialist.com/users/jgarbers/NXTBluetoothCompatibilityList. The Targus adapter is actually a Broadcom BCM2045 device. The Installshield Wizard pops up window after window while my IBM/Lenovo T43 bings away at me as one USB driver after another gets installed. But we're not done yet; now the adapter must be configured. I decide to enable everything except FAX.

It's so small I'm a bit worried about losing it...

Connect NXT brick to PC

OK, now turn the NXT BT on, make it visible, and tell it to search. It finds my PC quickly. Now the NXT docs don't seem to match the actual brick LCD GUI. Here's what seems to work: tell the NXT to search, tell the PC BT to discover services, then select the PC name on the NXT. Then the PC asks for the NXT passkey. Enter that on the PC and it discovers two BT serial connections, "Dev A on NXT" and "Dev B on NXT" . But I'm not sure these are really valid. The PC just seems to not know anything about available NXT services.

Bluetooth Resources

Mindstorms has a Bluetooth area at http://mindstorms.lego.com/overview/Bluetooth.aspx and there is a list of approved BT adapters there. The NXT Mindstorms User Guide references that web page for BT phone information and it is on the page http://mindstorms.lego.com/overview/Mobile%20Application.aspx - but no Motorola phones are supported. That's too bad... But there is an NXT Bluetooth Developer kit in the Mindstorms NXTreme web area.

Configure NXT to work with MRS

This web page http://msdn.microsoft.com/robotics/learn/tutorials/platforms/lego/ntx/default.aspx has detailed instructions. So here goes.

First, though, how about wasting a couple of hours by experiencing the "dreaded clicking NXT syndrome"? Sounds great, so let's go:

  1. Install NXT software on PC
  2. Reboot (it's Windoze...)
  3. Check for updates to the NXT software at http://mindstorms.lego.com/support/updates/ and there are some, most pertinent: the NXT Driver 1.02 update. Download this, but first, in the NXT application, it already knows about...
  4. ... an update for the NXT firmware... but when I start up the NXT application, and look in Tools->Update NXT Firmware, there is already a 1.03 firmware update available. So I download it and the NXT software reports that the update was successful.
  5. But now the NXT brick screen is blank and it's clicking softly. No combination of button presses seems to get its attention.
  6. Try removing the batteries. No help.
  7. Search in the User Guide. Nothing about clicking and unresponsiveness.
  8. Googled for "resetting NXT brick" and found the reset button is in a Lego Technic hole under the brick's USB connector. A long paper clip is needed to reach in. Holding that for 5 seconds briefly stops the clicking but does not bring the brick back to life. It still has a blank screen.
  9. Reload firmware update. Successful again, but still a blank screen on a clicking brick.
  10. Google "can't connect to NXT after update". Find "Clicking Brick Syndrome" at http://thenxtstep.blogspot.com/2006/06/clicking-brick-syndrome.html - went through that procedure, still no luck. Still have an unresponsive clicking NXT brick. Leave the USB Bluetooth adapter disconnected.
  11. Try installing the NXT PC software update 1.02: "This software updates the LEGO MINDSTORMS NXT driver and addresses an issue that prevents the firmware from being downloaded to the NXT on some occasions." Sounds like it might be part of my problem. Install it.
  12. Reboot. Aargh. What ever happened to "your first robot in 30 minutes"? This is getting ridiculous.
  13. Restart the newly-updated NXT application. Now it can't find the NXT brick. Unplug the brick USB cable and reset it. Try this a couple of times. Finally it connects, the 1.03 brick firmware *really* downloads and the brick resets and the LCD is back. Wasn't that simple?
  14. So what happened the first three times that the NXT app reported a succesful update but the brick was really out in the ozone?
  15. Note to self: find out what USB-to-serial adapter chip the NXT uses and avoid it in any of our own products.
  16. If this problem is so common, why is there no discussion of it on the Lego website? Why force users to spend an hour or two Googling and getting frustrated trying to deal with a known issue?

the hidden NXT reset switch

Your First Robot in 30 Minutes

... or so claims the NXT Quick Start. It took me an hour, even with help from a 4- and 8- year old. It's very simple, with three motors (one is an inactive chassis element only) and no sensors, so it can't avoid running into things. It uses demo code built into the NXT brick. The brick is held up at about a 45° angle so it would not fit back into the Lego box at all, or my suitcase very well. But it runs and should allow control by MRS.

Connect NXT to MRS

The MSR NXT tutorial page has very clear instructions on how to connect NXT to PC/BT/MRS. In my case it connected on COM16. Then navigate on NXT to My Files, Software Files, and execute main. Woohoo! - we get the MSR screen on the NXT:

Now, how to start MSR? Try "Start Default DSS Node" which eventually starts a browser, after I tell Firewall that Intranet Settings are OK. Now there is a browser open to URL http://localhost:50000/ hmm, no COM port config, so try to start the NXT Brick service, now I get a popup window at URL http://ibm-t43-bab:50000/legonxt/604a8bf2-05a5-4560-b829-f84c2958d938 asking me to configure the BT connection, but the NXT brick goes to sleep before I can do this. No I have to start all over with the NXT connection, and this time it fails until I Stop the Bluetooth Device and then restart it. Hmmm.

Try to start the Lego NXT Brick service, without manifest. A browser window opens to config the BT connection but the connection never completes.OK, try again:

  1. Power off the NXT and Stop the Bluetooth Device on the PC.
  2. Start the Bluetooth Device on the PC
  3. Turn on the NXT brick and try to connect BT on Port 1.
  4. Good - the PC BT adapter acknowledges the connection and the BT adapter starts blinking.
  5. Now on NXT execute the Main program.
  6. Good - the MSR screen is there
  7. Now on the PC start DSS Default node
  8. Browser window opens listing all services which ship with MRS. Scroll down to Lego NXT Brick, start it without manifest. Here's a screen shot -- click for one you can really read.
  9. Now another browser window opens asking to config the BT port.

  10. Wait a long time. The connection never completes. Hmmm.
  11. Try again only this time select a different service. Still no luck. No output in the default DSS service window dsshost.exe
  1. Start all over, re-searching from the NXT to the PC Bluetooth connection.
  2. Now make the NXT-PC connection and start the default dss node, then try service:
    1. Lego NXT Brick without manifest - no luck
    2. Advanced Brick manifest - no luck
    3. NXT Brick manifest - main stops running on the NXT. Huh?
    4. TestLegoNxt manifest -

Try to use the MRS Simulator:

(Next day, Dec 04) Follow the simulator tutorial at http://msdn.microsoft.com/robotics/getstarted/simulation/sim1/default.aspx but I get nonsensical errors like "DssHost.exe is not a valid Win32 application". So, do a repair install of MRS.

Now it complains about the manifest file:
C:\Microsoft Robotics Studio (November 2006)>bin\dsshost /port:50000 /manifest:"config\SimulationTutorial1.manifest.xml"
Invalid manifest identifier: file:///C:/Microsoft%20Robotics%20Studio%20(November%202006)/config/SimulationTutorial1.manifest.xml

Aha, there's an error on the web page. The command line should be:
bin\dsshost /port:50000 /manifest:"config\SimulationTutorial1.manifest.xml"
note that the config folder with the manifest is under the samples folder, it's not the config folder which is under the MRS root.

That fixes it and now the simulator starts. It runs OK for a while then inexplicably terminates:

C:\Microsoft Robotics Studio (November 2006)>bin\dsshost /port:50000 /manifest:"samples\Config\SimulationTutorial1.manifest.xml"
* Starting manifest load: file:///C:/Microsoft%20Robotics%20Studio%20(November%202006)/samples/Config/SimulationTutorial1.manifest
.xml [http://ibm-t43-bab:50000/manifestloaderclient]
* Manifest load complete [http://ibm-t43-bab:50000/manifestloaderclient]
* Service uri: [http://ibm-t43-bab:50000/simulationtutorial1]
* Starting OBJ file conversion to BOS format:C:\Microsoft Robotics Studio (November 2006)\store\media\earth.obj
* Finished OBJ file conversion to BOS format:C:\Microsoft Robotics Studio (November 2006)\store\media\earth.obj
*** Object reference not set to an instance of an object. [http://ibm-t43-bab:50000/simulationengine]

It does restart again...

...though it sucks up most of my notebook resources and there doesn't seem to be a way to pause it or slow it down.

Since I'm on a roll, try the Simulation Tutorial 2 and zoom in on the NXT model:

and there is also a dashboard:

Invoking Task Manager causes the simulator to abruptly terminate with this error:
*** Object reference not set to an instance of an object. [http://ibm-t43-bab:50000/simulationengine]

There are five simulation tutorials and they are prebuilt. You don't actually need to build them with the C# compiler (but you can use the free Express 2005 edition).

Try to debug the NXT-MRS interface

There is an MRS forum at http://www.microsoft.com/communities/newsgroups/en-us/default.aspx

and searching on NXT turns up some possibly helpful tips which are worth pasting here:

Are you initiating the connection from the LEGO to the PC? If so, that is
the problem. The October release requires the connection to be established
from the PC to the LEGO.

Also, I use a tool called PortMon from www.sysinternals.com which lets me
watch the communication over the serial port. This is very helpful to
pinpoint this type of problem.

Another thing to check is the console output service. While your service is
running, open a web browser and navigate to:
http://localhost:50000/console/output. You may need to change the "50000" if
you are running on another port. In general, you will see details for any
errors on this page.

So, there appear to be some discrepancies between the website tutorials and the actual instructions for a specific MRS release. I'll try some of these tomorrow. There is a readme file in the MRS NXT install folder at
C:\Microsoft Robotics Studio (November 2006)\samples\Platforms\LEGO\NXT
...and indeed it contradicts the website instructions -- the connection to NXT must now be initiated from the PC for the Nov CTP release.

Had to punt on a working demo for the OMG presentation

So after way too many hours of grappling with all the above, I was unable to show a working MRS-NXT demo for a talk at OMG. This was a bit embarrassing for me and a disappointment for my colleagues as there is a lot of interest in the Studio. So instead my presentation covered the architecture of MRS and DSSP, and the hardware of the NXT. In the three months before the next OMG meeting I have pledged to figure this all out and make a further report.

Why is this proving so hard?

At the Washington OMG technical meeting I met several other people who had spent some time trying to get MRS to work with NXT. None had achieved much more success than I had. This is very puzzling to me, since I saw several MRS demos back in June at RoboDev, and MRS has been getting a lot of press coverage as The Next Big Thing, so it would be natural to assume that it really does work.

There are several layers to the PC-Bluetooth-MRS-NXT combination:

  1. Bluetooth - could there be an issue with this adapter, or the driver? It's on the approved for NXT list, so this seems unlikely. Still, how can we know for sure?
  2. DSSP and MRS on the PC. We don't have access to much debugging information there so it's hard to guess where a problem might lie.
  3. The DSSP service proxies/DLLs - we don't seem to have access to what's really going on there, so is it possible there's some problem? Seems unlikely since Lego and Microsoft are two large companies with a lot of resources and a vested interst in making this work.
  4. The NXT application code is pretty simple, and we should be able to debug it if needed.

So what we could try to do is find other applications which use each of these portions of the system and test them independently. For example if we can get some other use of the Bluetooth adapter to work reliably then we can rule out any Bluetooth-related issues.

References and Links:

The official Lego NXT site is http://mindstorms.lego.com/default.aspx
The official Microsoft Robotic Studio resource is http://msdn.microsoft.com/robotics/
Detailed description of the MRS application model: http://msdn.microsoft.com/robotics/getstarted/prgmmodel/default.aspx

Credits, thanks and whom to blame:

All the photos here are courtesy of Bruce Boyes - peruse their metadata for a bit more information. Lego, Microsoft, Java, etc are trademarks of Lego, Microsoft, Sun Microsystems, or their respective owner. Thanks to Radio Paradise for great music by which to work.