NXT-G Bluetooth woes (NXT <> PC)

Discussion specific to the intelligent brick, sensors, motors, and more.
Post Reply
stro4
Posts: 5
Joined: 17 Feb 2012, 01:29

NXT-G Bluetooth woes (NXT <> PC)

Post by stro4 »

Hello everyone-

I am sorry to have to ask you this but I am having some frustration with getting my Bluetooth connection established between my PC and the NXT 2.0 brick. I've exhausted the material in the instruction guide that came with my NXT 2.0 system, the material on the Lego Mindstorms site at: http://mindstorms.lego.com/en-us/bluetooth/default.aspx, and the instructions provided at the back of Laurens Valk's book on pages 288-289.

My hardware is a Dell Latitude D410 notebook with the Lego ABE Bluetooth Dongle. I am using Windows XP with SP3. The driver being used is Microsoft Bluetooth Enumerator, version 5.1.2600.5512, dated 13 April 2008.

NXT-G is version 2009-03-25-1336; NXT version is FW 1.28; AVR 1.01; BC4 1.01; Build 1902091856

The Fantom driver is 1.1.3

The problem I am having is that the NXT will not connect. Everything goes well, and as predicted, until after the passkey is entered on the NXT brick. Then I immediately get a dialog window on the NXT-G software that reads the NXT "Cannot connect to NXT device" and shows an error code of -142016, which I can't seem to find defined anywhere. After clicking "OK" on the error dialog, the communications dialog in NXT-G then reads that my NXT Bluetooth is "Unavailable" (it was "available" until the error was generated).

Recycling power on the NXT brick and the computer have no effect. Deleting the connection in the NXT-G dialog and re-scanning has no effect. No contacts are generated on the NXT brick (to delete).

The $< symbology is always present in the upper left corner of the NXT brick, which makes sense since they do seem to be talking to one another and the NXT brick DOES ask me for the passkey (default of 1234 on both the NXT-G and NXT brick).

I've also installed fresh batteries in the NXT brick and even set it varying distances from the laptop to see if there was some sort of signal interference-all to no avail.

The USB connection works fine.

Any thoughts?

Many thanks,
-stro
Last edited by stro4 on 04 Mar 2012, 18:00, edited 2 times in total.
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Bluetooth woes

Post by hassenplug »

Sounds like you're doing everything right.

Have you looked at the bluetooth devices on the PC? Not in NXT-G, but in the PC control panel.

The next thing I would do is go into the PC's bluetooth settings, delete any NXT device, and try connecting to the NXT from there. If that works, I think it will come up in NXT-G next time you run it.

If that doesn't work, the next step may be to go through the registry and try to remove any trace of NXT/bluetooth comports. That can get very tricky, and if you're not comfortable doing it, don't do it.

Hope that helps.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
stro4
Posts: 5
Joined: 17 Feb 2012, 01:29

Re: Bluetooth woes

Post by stro4 »

Steve-

THANK YOU!!!!

Your idea of going into Windows XP Control Panel and connecting before starting up NXT-G worked like a charm.

You da man.

Many, many thanks for this. Makes me feel like the $40 dongle is worth it. Sort of...

Cheers!
-stro
mcsummation
Posts: 220
Joined: 23 Jan 2012, 17:07
Location: Round Rock, TX

Re: Bluetooth woes

Post by mcsummation »

Be aware that the connection may go away at any time that NXT-G is connecting with the NXT. Don't ask me why, it just does. Each time it does, you will need to go through this same connection process.
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bluetooth woes

Post by afanofosc »

The error codes are defined in tStatus.h from the fantom SDK. Here's a summary:

Code: Select all

      kStatusOffset = -142000
      //! Error: Bluetooth pairing operation failed.
      //! Warning: You have already paired with that Bluetooth device.
      kStatusPairingFailed                = (kStatusOffset + -5),    // 0x54B
      //! Error: Bluetooth search failed.
      kStatusBluetoothSearchFailed        = (kStatusOffset + -6),    // 0x54A
      //! Error: System library not found.
      kStatusSystemLibraryNotFound        = (kStatusOffset + -7),    // 0x549
      //! Error: Bluetooth unpairing operation failed.
      kStatusUnpairingFailed              = (kStatusOffset + -8),    // 0x548
      //! Error: Invalid filename specified.
      kStatusInvalidFilename              = (kStatusOffset + -9),    // 0x547
      //! Error: Invalid iterator dereference. (No object to get.)
      kStatusInvalidIteratorDereference   = (kStatusOffset + -10),   // 0x546
      //! Error: Resource locking operation failed.
      kStatusLockOperationFailed          = (kStatusOffset + -11),   // 0x545
      //! Error: Could not determine the requested size.
      kStatusSizeUnknown                  = (kStatusOffset + -12),   // 0x544
      //! Error: Cannot open two objects at once.
      kStatusDuplicateOpen                = (kStatusOffset + -13),   // 0x543
      //! Error: File is empty.
      //! Warning: The requested file is empty.
      kStatusEmptyFile                    = (kStatusOffset + -14),   // 0x542
      //! Error: Firmware download failed.
      kStatusFirmwareDownloadFailed       = (kStatusOffset + -15),   // 0x541
      //! Error: Could not locate virtual serial port.
      kStatusPortNotFound                 = (kStatusOffset + -16),   // 0x540
      //! Error: No more items found.
      kStatusNoMoreItemsFound             = (kStatusOffset + -17),   // 0x53F
      //! Error: Too many unconfigured devices.
      kStatusTooManyUnconfiguredDevices   = (kStatusOffset + -18),   // 0x53E
      //! Error: Command mismatch in firmware response.
      kStatusCommandMismatch              = (kStatusOffset + -19),   // 0x53D
      //! Error: Illegal operation.
      kStatusIllegalOperation             = (kStatusOffset + -20),   // 0x53C
      //! Error: Could not update local Bluetooth cache with new name.
      //! Warning: Could not update local Bluetooth cache with new name.
      kStatusBluetoothCacheUpdateFailed   = (kStatusOffset + -21),   // 0x53B
      //! Error: Selected device is not an NXT.
      kStatusNonNXTDeviceSelected         = (kStatusOffset + -22),   // 0x53A
      //! Error: Communication error.  Retry the operation.
      kStatusRetryConnection              = (kStatusOffset + -23),   // 0x539
      //! Error: Could not connect to NXT.  Turn the NXT off and then back on before continuing.
      kStatusPowerCycleNXT                = (kStatusOffset + -24),   // 0x538
      //! Error: This feature is not yet implemented.
      kStatusFeatureNotImplemented        = (kStatusOffset + -99),   // 0x4ED
      //! Error: Firmware reported an illegal handle.
      kStatusFWIllegalHandle              = (kStatusOffset + -189),  // 0x493
      //! Error: Firmware reported an illegal file name.
      kStatusFWIllegalFileName            = (kStatusOffset + -190),  // 0x492
      //! Error: Firmware reported an out of bounds reference.
      kStatusFWOutOfBounds                = (kStatusOffset + -191),  // 0x491
      //! Error: Firmware could not find module.
      kStatusFWModuleNotFound             = (kStatusOffset + -192),  // 0x490
      //! Error: Firmware reported that the file already exists.
      kStatusFWFileExists                 = (kStatusOffset + -193),  // 0x48F
      //! Error: Firmware reported that the file is full.
      kStatusFWFileIsFull                 = (kStatusOffset + -194),  // 0x48E
      //! Error: Firmware reported the append operation is not possible.
      kStatusFWAppendNotPossible          = (kStatusOffset + -195),  // 0x48D
      //! Error: Firmware has no write buffers available.
      kStatusFWNoWriteBuffers             = (kStatusOffset + -196),  // 0x48C
      //! Error: Firmware reported that file is busy.
      kStatusFWFileIsBusy                 = (kStatusOffset + -197),  // 0x48B
      //! Error: Firmware reported the undefined error.
      kStatusFWUndefinedError             = (kStatusOffset + -198),  // 0x48A
      //! Error: Firmware reported that no linear space is available.
      kStatusFWNoLinearSpace              = (kStatusOffset + -199),  // 0x489
      //! Error: Firmware reported that handle has already been closed.
      kStatusFWHandleAlreadyClosed        = (kStatusOffset + -200),  // 0x488
      //! Error: Firmware could not find file.
      kStatusFWFileNotFound               = (kStatusOffset + -201),  // 0x487
      //! Error: Firmware reported that the requested file is not linear.
      kStatusFWNotLinearFile              = (kStatusOffset + -202),  // 0x486
      //! Error: Firmware reached the end of the file.
      kStatusFWEndOfFile                  = (kStatusOffset + -203),  // 0x485
      //! Error: Firmware expected an end of file.
      kStatusFWEndOfFileExpected          = (kStatusOffset + -204),  // 0x484
      //! Error: Firmware cannot handle more files.
      kStatusFWNoMoreFiles                = (kStatusOffset + -205),  // 0x483
      //! Error: Firmware reported the NXT is out of space.
      kStatusFWNoSpace                    = (kStatusOffset + -206),  // 0x482
      //! Error: Firmware could not create a handle.
      kStatusFWNoMoreHandles              = (kStatusOffset + -207),  // 0x481
      //! Error: Firmware reported an unknown error code.
      kStatusFWUnknownErrorCode           = (kStatusOffset + -208),  // 0x480
The OP's error was -142016 which is "unable to locate virtual serial port". This can happen when the pairing between the computer and the NXT does not create both virtual serial ports that should be created. If you initiate the pairing from the NXT as master to the PC as a slave then you could run into this trouble. It can also indicate that you are using a bluetooth stack on your computer other than the Microsoft or Broadcomm (aka widdcomm) stack. If your computer uses the Toshiba drivers or any other than Microsoft or Widdcomm then you might have troubles with the Fantom drivers.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
stro4
Posts: 5
Joined: 17 Feb 2012, 01:29

Re: Bluetooth woes

Post by stro4 »

Thank you for the error code definitions, John.

It does seem odd that I got that message since I followed, exactly, the instructions Lego provides for NXT to PC communications via Bluetooth.

Also, I am using the Microsoft Bluetooth Enumeration stacks, which installed automatically when I plugged the Lego dongle in for the first time.

Following Steve's directions for establishing comms via the XP Control Panel PRIOR to starting up NXT-G seems to have fixed the issue. A bit of a mystery, I guess. I suppose it is possible that the error code generated doesn't accurately reflect what really happened with the software...

Cheers!
-D
stro4
Posts: 5
Joined: 17 Feb 2012, 01:29

Re: Bluetooth woes

Post by stro4 »

***UPDATE***

I just wanted to follow up about my experiences with this situation since implementing Steve's suggested method. So many times, people ask for help, get it, and then don't provide feedback after they got it working. I wanted to let other people who may be struggling with this same situation, as well as those who made suggestions, that everything seems to be working very well.

So far, I have been able to completely power down (cold-boot) the PC, standby (warm-boot) the PC, cold boot the NXT with any combination of the aforementioned PC power down modes, and the BT connection always comes back after I start NXT-G and get in to the communications console.

Mindstorms doesn't ask for passkeys on either end, NXT-G doesn't throw errors out anymore, and program downloads, memory monitoring and remote control all work as advertised. I've never had to delete "contacts" on the NXT, or get back into the BT configuration on the PC.

Many thanks again to those who provided input and were able to help me "cut the USB cord"!

-Darrin
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Bluetooth woes

Post by HaWe »

thank you for feed back!
Just 1 proposal:
could you pleas change the title of you thread opening post into
NXT-G: Bluetooth woes (NXT to PC)

this makes it easier for people e.g. if they are saerching for worries from NXT to NXT.

thx in advance!
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: NXT-G Bluetooth woes (NXT <> PC)

Post by hassenplug »

where's the "like" button? :)

Thanks for the feedback.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests