Setting up Bluetooth for NXT
|For ROBOTC Bluetooth NXT functions, check out the NXT Bluetooth Functions page!|
Connecting via Bluetooth - Pairing
|Each BT device is identified by a unique 12 hexadecimal digit address. It's a little awkward to refer to devices with this address so the BT protocols include a "friendly name" that is a more conventional 15-character string. The default friendly name for a NXT brick is "NXT" but you can modify this using the NXT's on-brick user interface, or from the ROBOTC IDE, or directly from within a ROBOTC program.
Before you can connect two devices via BT they must be "paired". The pairing process exchanges messages between the two devices where they share their BT address, their friendly names and their supported profiles. The devices confirm that they support the same profiles and that the (optional) password matches. Once two devices have been paired, you can make subsequent connections using just the friendly names. The devices remember the passwords so that they don’t have to be re-entered each time
There's a lot of low-level messages used in establishing a paired connection. Fortunately, this is hidden from the user on the NXT with a simple user interface via the user interface on the NXT.
From the BT menu on the NXT, a search is performed to build a internal list in the NXT of all the devices that are currently available via BT. The NXT simply broadcasts a "who's available" message over BT and collects a list of all the devices that replied.
Once connected, the "slave" device will be added to the NXT's internal table of paired devices, i.e. the "My Contacts" list on the NXT. Next time you want to make a connection you can select the device from the "My Contacts" and avoid the 30-second search.
NOTE: Sometimes you'll find that you cannot get two previously paired devices to connect. One cause of this is that one device is no longer powered on. Another cause is that somehow the devices have got out of sync on the pairing status where one device has "lost" the paired status. If this happens, try removing both devices from the "My Contacts" list on each NXT and restart the connection using the "Search" function.
Installing USB Adapter Drivers
|Before you can use your Bluetooth USB adapter with ROBOTC, you must install the drivers and set up the device for use.
Note: Not all Bluetooth adapters will work with the NXT brick due to its built-in chip limitations. ROBOTC community member Laurens has compiled a great list of adapters that are known to work with the NXT bricks, complete with a listing of internal laptop adapters. Check it out at her blog, robotsquare.com
|1. Start Windows and plug in USB adapter. Windows should automatically recognize and install your device. If you do not see a popup near the notifications area like the one shown below, click here for some workarounds.|
|2. Open the Start Menu, click on Devices and Printers, right click on the appropriate adapter, and select "Bluetooth Settings".|
|3. Make sure "Allow Bluetooth devices to find this computer", "Allow Bluetooth Devices to connect to this computer", and "Alert when a new Bluetooth device wants to connect" are checked.|
|4. Turn on the NXT brick, navigate to the Bluetooth menu, and make sure Bluetooth is turned 'On' and Visibility is set to 'Visible'; then, select 'Search'. This will start the pairing process between the NXT and the computer. You will still need to register the device in ROBOTC to compile wirelessly (instructions below).|
|5. The NXT will pull up all available devices within range, including other eligble NXT bricks, that have Bluetooth enabled and turned on. Select your computer from the list and select 'Connect'. If you do not know your computer's name, navigate to Start Menu> All Programs> Accessories> System Tools> System Information. Your computer's name is "System Name".|
|6. Select which port on the NXT you would like to save the connection to and enter your passkey when prompted (1234 by default) and select the check mark.|
|7. Windows should recognize that there is a new connection and will pop up another notification saying so. Click on the notification and enter the passkey for the NXT when prompted, then click 'Next'.|
|8. Windows will finish connecting to the NXT and display "Your device is ready to use notification" when completed.
PC/NXT Pairing with ROBOTC
Connecting Two NXT Bricks
Disconnecting Two NXT Bricks