LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems connecting to NXT with Bluetooth

I've been using the LabView toolkit with the NXT for awhile now and have been quite impressed with it.  I've been able to use the direct commands over USB to controll the NXT directly.  However recently I picked up a Bluetooth adapter and have been unable to connect to the NXT using Labview and Bluetooth.  I've tried to  make my own Vi as well as use a few of the examples, unforatunly I haven't been able to see the NXT at all.  It does however work without a problem in NXT-G.  I think I have all the settings set up properly, on the NXT I have bluetooth enabled, and allow it to be searched.
 
Does anyone have any thoughts on this?
 
I'm using:
NXT Firmware 1.04
LabView 8.2
MSI StarKey USB Bluetooth adapter
Windows XP Pro
0 Kudos
Message 1 of 7
(13,411 Views)
I'm a little confused as to what your problem is.  Are you trying to write your own VI that leverages the toolkit VIs to search for and communicate with your NXT over Bluetooth?  Or are you using the "NXT Terminal" menu option in LabVIEW to try to connect to your NXT?  In the LEGO MINDSTORMS software, are you able to download programs to your NXT via Bluetooth?
------
James Blair
NI R&D
0 Kudos
Message 2 of 7
(13,380 Views)

Well after playing around with it a bit more from the NXT Terminal Menu it seems that the first time in never finds the NXT, the second time I try it it does. And then if I close the terminal and reopen it, its the same thing first time nothing, second time it can find it.

However even after finding it with the terminal I still can't use any direct command VI's to search for or even communicate with the NXT. 

In the Lego Mindstorms Software (NXT-G) everything works perfectly, I can download and run programs over bluetooth and it finds it and connects flawlessly everytime.

0 Kudos
Message 3 of 7
(13,377 Views)
Finally resolved my Bluetooth connection issues (many the same symptoms as everyone else, so I hope this helps).  I'm running WinXP Home SP2 on a Toshiba laptop (I removed the Toshiba Bluetooth stack) using a Kensington dongle (from BestBuy) that comes with Widcomm drivers.  The NXT firmware has been updated to 1.04.  Ok, the short of it is that I was having a timeout issue.  The NXT would show up as "Unavailable" in the connection window in the Mindstorm software.  Based on another suggestion, I was able to at least get it to say "Available", but it would still give the lost connection error message when attempting to connect.  That other suggestion was to hit the orange button on the NXT immediately as soon as it made the sound and asked for a pass-code.  Just leave the default 1234 and hit the orange button as soon as you hear that tone.  Look in the install directory of the Mindstorm software for a file named "MINDSTORMS Options.ini".  In this file, modify the BluetoothSearchTimeout setting.  Mine was set to 20 (assuming seconds) as default.  I bumped it up to 60.  As soon as I did that, I was able to connect all the way through.  Some other suggestions that I did along the way, though I can't be sure any of these made a difference:  Be sure the "Remove" and "Scan" connections in the Mindstorm software after you have a failure.  I'm highly suspicious that it is caching a lot of that stuff.  Also, be sure you don't have the NXT configured as a Bluetooth connection/device on your PC.   If the dialog that pops up on you PC asking for a passcode is a Windows dialog, it probably won't work.  You want the dialog to popup from the Mindstorm software.  Hope that helps.
Message 4 of 7
(13,022 Views)
Tito,
 
Thank you for the very detailed and helpful post!  I've encountered some of these issues myself and I have other friends who have, too.  I appreciate your tips so much that this page is now one of my bookmarks!
 
Rock on, NXT!
 
Pete
Peter L.
Applications Engineer
National Instruments
www.ni.com/support/
0 Kudos
Message 5 of 7
(13,008 Views)
What Tito is describing sounds a lot like the drill I have recommended elsewhere to get fairly consistent Bluetooth connections.  However, changing the MindstormsOptions.ini is something I hadn't tried.  I played with the settings on one of the computers we use, and it seems to make a big difference.  However, I did not have any luck setting it to 60.  With it set at 60, when I tried to scan for an NXT, the screen would just flash and no NXTs would be found.  For this computer (Dell notebook with an Intel duo 1.6 processor), setting it to 40 allowed the software to find the NXT and to connect even if I was a bit lazy pushing the orange button.  I'll try it on one of our slower computers which is more difficult to connect and see how it works.
0 Kudos
Message 6 of 7
(12,991 Views)
Jaguar,
I just would like to know if you solved the BT problem eventually.
I'm in the same trouble as you were (NXT-G OK, Labview KO).
Thanks.
0 Kudos
Message 7 of 7
(12,130 Views)