Adding Serial BT to Windows for Dummies

Kingfish

100 MW
Joined
Feb 3, 2010
Messages
4,064
Location
Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Mil
There is quite a bit of information on how to install Bluetooth (BT) on Windows on the web; some of the instruction though leaves an awful lot to presumption. It greaves me to find the state of knowledge vicariously applied – so here it is, a complete end-to-end step-by-step guide to getting BT service and communication working - and written explicitly for the technical-leaning inner-dufus type… like me. :p

//--------------------------------------------------------------------------
DISCLAIMER & FINE PRINT:
I, KINGFISH AM NOT RESPONSIBLE OR LIABLE FOR DAMAGE TO YOUR COMPUTER
OR HARDWARE FOR FOLLOWING ANY ADVICE AND DIRECTIONS BELOW.

Cruel to be kind: I am also not “Tech Support”, so please -
do not PM me with your petty computer issues.
//--------------------------------------------------------------------------


'nuff said. Let's get started.

System Requirements

  • Windows Update: Should go without saying – but make sure your computer is up to date and trouble free.
  • Knowledge of BT Technology: The latest BT version is 2.1 – try to remember this for equipment purchase & installation. Older versions are still compatible though will have less utility. Don’t bother with anything less than V1.1 because it probably will lead to frustration. More on this in a bit. Bluetooth on Wikipedia.
  • A Windows computer outfitted with Bluetooth: Most computers, laptops, and tablets in the past 5 years include BT; if you do not have BT hardware – for about $25 USD you can pick up something like the Belkin F8T016 Mini Bluetooth Laptop Adapter for USB.
  • Legacy Hardware: Special note for those of us with older equipment… my system has a 19-in-1 I/O Board from Logitech that was integrated at the factory. For whatever reason, BT was not working. After searching the web I found the latest hardware drivers matching my make/model – and this restored BT functionality.
  • Latest BT Drivers: BT will work on Windows XP, Vista, 7 & 8 in x86 and x64. However the drivers are slightly different. If you cannot get your BT to work, I suggest downloading the latest drivers from BroadCom.
  • Check your Configurations: We have to check the system to be sure we are seeing BT devices for without them there is no point going forward. Let’s run through the drill…
    1. These instructions will work for Windows 7, although they might be slightly different for other versions. Go to your Windows computer where you have Administrator rights.
    2. Start|Control Panel|Device Manager (alternate: Start|Run, enter “devmgmt.msc” w/o quotes and select OK)
    3. Near the very top of the List, you must see Bluetooth Radios; mine is directly below Batteries, and above Computer. If you do not see Bluetooth Radios then something is wrong. Let’s check Services to see if it is there and running:
      • Start|Administrative Tools|Services (alternate: Start|Run, enter “services.msc” w/o quotes and select OK)
      • Sort the List by Name, and look for “Bluetooth Support Service” alphabetically near the top. If you do not see the service – something is wrong: Return to the previous instructions and find the hardware or have your computer examined by qualified personnel.

        Services.BTSupportService.png

      • If Bluetooth Service is found, ensure that it is started. If not:
        • Highlight “Bluetooth Support Service” and double-click to open the Properties dialog:
        • Set the Startup Type to “Automatic” if not already.
        • Under Service Status, “Start” the service if not already. If there are problems starting the service, return to the previous instructions and find the hardware or have your computer examined by qualified personnel.
        • Close out the Property Dialog with OK or Apply.
        The next step presumes we have BT Services and all is good. Go back to the Device Manager.
    4. Open Bluetooth Radios; Mine has two entries:
      • Dell Wireless 355C Bluetooth 2.0 + EDR module
      • Microsoft Bluetooth Enumerator

      DeviceManager.BTRadio.png

    5. Check the Driver tab and select Update Driver… to fetch the latest driver from the Internet. (I’m on Windows 7 Ultimate x64; they’re dated 6/21/2006 and they work fine.)
      Bluetooth requires an address which your computer will see as a Network Device, and when that radio is in use it will assign a virtual COM Port through the Enumerator. There is nothing else to do here in this leaf so let’s move on and close out the Property dialogs.
  • With Device Manager, Bluetooth may show up in the Network Adapters leaf. Personally – I didn’t need to mess with it.
  • Good to go: At this point we’re ready to move forward and add more hardware for communicating to our Controllers.

Remote Serial-BT Communication Requirements

Hardware & Wiring
This next step requires two new inexpensive hardware components:
  • USB-TTL Converter (also described as USB FTDI Serial RS232 UART). The key features are that the mini-board accepts USB-in (minimum +5V, GND, Rx, Tx) and provides TTL-out (minimally +5V &/or +3.3V, GND, Rx, Tx). The type of USB connectors vary, as does the TTL out with either Male pins (4 or 6) or Female socket. The type used for this article is found here.
  • Bluetooth Module Serial Port (Master/Slave). Another name for the device is Arduino Wireless Bluetooth Transceiver Module Slave (with either 4 or 6 pin header). This board should utilize the latest BT version (Arduino typically will though clones do not). Older versions have less features and thus are less flexible; you get what you pay for. The type used for this article is found here.
  • In addition we’ll need a USB cable for the USB-TTL Converter if it is not a direct plug-in, and even if it is – I prefer to have the extra length to hang myself if something goes awry. This is after all… warrantee-free instruction.
  • A collection of Arduino jumper wires. Some USB-TTL Converters come with male pins or female sockets, and the same goes for the BT Serial Module. On top of that we need to cross the Rx & Tx lines in the next step. Purchase the correct type of jumpers to suit your needs, albeit Male-to-Male, Male-to-Female, Female-to-Female…
Let’s wire up the devices:

USB2BT.Serial.jpg


BluetoothConfigureConnection.png

Note that Rx & Tx are crossed.

The USB Port provides +5V and GND. The many BT Modules will accept +5V and convert it to +3.3V onboard. For this example – mine does that.

  • We are going to send standard AT commands to the BT Module. We must also pair Rx to Tx, and vice versa between the boards so that we can receive feedback. The schematic diagram above indicates this configuration, and the image above displays how this is achieved using individual jumper cables. Thank goodness we only have to make this arrangement once!
  • After wiring the two together, go ahead and plug the assembly into the computer USB Port. If there are no issues, the USB-TTL Converter will be found and configured automatically by the operating system – and we’ll see the COM Port show up in the Device Manager.

DeviceManager.USBSerialPort.png


Programming the BT Device for Serial
Program your BT Module using the USB-TTL Converter. Before we pair the BT module to the computer, we first need to change the factory configuration so we can use it for our controllers. We need software to talk to the devices, and there are options here too.

HyperTerminal type Software: I have Windows 7, so it did not come with Hyper Terminal. I have Tera Term for monitoring Caller ID through my Modem, though beyond that application – I don’t care for it. There are however some good candidates below – each having merits and failings, though I’ve used all in some regard to success.

  • Advanced Serial Port Monitor from AggSoft.com: I like this app for spying on an open port. You can download a 30-Day trial version for free, or purchase a single copy for $60. It is indispensable for software development.
  • Serial Port Monitor from Eltima.com: I have no experience with it, although they are well-marketed as the top-dawg. Standard edition goes for $69, and Pro for $149.
  • RealTerm at SourceForge.net. Lots of functionality in this freeware application, though cobbled together with less finesse that the two above. If you want to lurk on a serial port with Spy then you’ll need to pony up money for the drivers; $25 should do it.
  • PuTTY: A Free Telnet/SSH Client. The most basic of the bunch, and yet versatile. Can’t spy on a port though. It is better than Hyper Terminal and Tera Term.
For this programming demonstration I am going to use RealTerm.

First, let’s go to Device Manager and check the COM Port configuration; note that my USB Serial Port is COM 11 – although yours will be different. We only need to do this once, so pay close attention. Go and select the new COM Port and double-click it, select Port Settings tab. By default it should looks exactly like this: 9600, 8, None, 1, None. VERY IMPORTANT – don’t forget it! :)

USBSerialPortSettings9600.png


Open up one copy of RealTerm. Configure the tabs as follows:

RealTerm.Display.png

Display tab: Display as "Ascii" & checked.

RealTerm.Port.png

Port tab: 9600, N, 8, 1, N on COM Port 11.

RealTerm.EchoPort.png

Echo Port tab: Baud = Identical to Port tab, Echo On & Monitor checked.

Open the Port when you are ready by selecting Open on the Port tab; the status will change if success, or alert if not.

RealTerm.Port.Open.png


RealTerm.Send.png

Send tab; we communicate and pass commands here.

Let’s move to the Send tab. Below are the only valid commands that my BT Module would accept, with their description to the right. Commands are sent via the Dropdown ListBox that strangely acts like an Input TextBox. There’s a slight 1-2 second delay in the replies, so be patient.

Copy them to Notepad for quick cut & Paste:

Code:
AT                         Returns OK if healthy, and nothing if not.  This is a basic Go/No-Go test.  If it doesn’t work, something is wrong.  Stop, and do not continue until it’s sorted out.  Every command below will return “OK” + message if the device accepted it, otherwise nothing will be returned.

AT+VERSION                 Returns “OKlinvorV1.5”

AT+BAUD8                   Sets our baud rate to 115200, and returns “OK115200”.

AT+PN                      Sets Parity = None, returns “OK None”.

AT+NAMEControllerBT        Resets the Name of the BT Identity.  The default is “linvor” (or whomever is given as the Mfr in the VERSION request).  Here we have the opportunity to rename our device; the protocol is AT+NAME<custom name>; I’ve chosen “ControllerBT”.  Returns “OKsetname”.

AT+PIN8888                 Resets the Pin number for the device.  The protocol is AT+PIN<custom pin>, and in this example it’s “8888”.  Returns “OKsetPIN”.

There could be other commands that are useful, however my device is Version 1.5 so it does not appear to accept anything else. I did not spend the time to test every possible command. These are all that matter. :wink:

Use the commands in the order provided as you wish. Enter them into the top Dropdown ListBox (examples indicated in following images). Use the top Send ASCII button to send the command. Wait about 1 second for each reply.

Expected Results upon Success
  • We learned from the device the manufacturer name and BT Version
  • We’ve renamed our device for unique recognition during paring, and changed the Pass Key for security.
  • We’ve reset the maximum device speed to 115200, No Parity; this is the same as 115200, 8, N, 1, N.
Break the Connection with the USB Serial Port by switching RealTerm to the Port tab, and uncheck Open – which causes the Port to Close.

Test the USB Serial Port at the new Speed:
This is an interim test that validates we can now talk to the BT Module at the higher speed. It’s a good test before moving on to the next sequence.
  1. Update our USB Serial COM Port settings. Back at Device Manager, double-click on the COM Port, select Port Settings tab, and change the Bits per second to 115200, select OK to close.

    USBSerialPortSettings115200.png

  2. Update RealTerm Port and Echo Port tabs to have a Baud rate of 115200.
  3. Open the Port. Switch to Send tab. Select the Clear button to clear the screen. Type in AT and Send ASCII; the device should return OK – and we are good to go to the next step! Close the Port.

RealTerm.HighSpeedTestOK.png

High Speed test works!


Pairing the BT Module to the PC

There are a couple of different ways to go about adding a BT device. Perhaps the simplest is to begin with the Control Panel:

  1. Go to Start|Control Panel|Devices and Printers, then select “Add a device”, and after a tiny bit of searching the new device will show up as ControllerBT (or however you've named it). If it doesn’t appear then perhaps we need to help the operating system to find it:
    • With the at Control Panel\Hardware and Sound\Devices and Printers, back up to Control Panel\Hardware and Sound – then type into the Search BoxBluetooth” and this will produce a new result.
    • Under Devices and Printers, select the link “Change Bluetooth settings”.
    • On the Options tab, in the Discovery section, select the Checkbox (checked) to “Allow Bluetooth devices to find this computer”, and select OK to exit. This should speed things up quite a bit. Now go back and follow the instructions to find the device.

    BT.Add.a.Device.png

  2. In the Add a Device dialog, select the new device and the Next button will enable, so click that to proceed.
  3. Select a pairing option. Use the middle choice: Enter the device’s pairing code. If you changed it back when issuing AT commands with RealTerm, then use that code. Otherwise try “0000” or “1234”. With luck your code will work and the device will be found and paired to your system in a few moments. Let’s go check the Device Manager for the changes.
  4. On my system I see two new “Standard Serial Ports over Bluetooth link”. This is confusing; which one is it? Here’s how we find out:

    DeviceManager.BTSerialPort.png

    • Go back to Control Panel\All Control Panel Items\Devices and Printers so that you can see all the devices connected to your system.
    • Look for the device named “ControllerBT” (or whatever you named it) and double-click the device to get to the Properties.
    • Under the Hardware tab, read the Name: Mine says it’s COM 10 (and that’s what I’ll reference going forward though yours will be different) …and there you have it! :)

      ControllerBT.Properties.Hardware.png

    • Also check under the Services tab: Here we should see that indeed we have “Serial port (SPP)” assigned to COM10. Close all that out. We’re almost done.

      ControllerBT.Properties.Services.png
  5. Go back to Device Manager, select the COM Port matching the Bluetooth link and double-click:
  6. Go to Port Settings tab, and change the Bits per second to match 115200 we set previous with RealTerm. Now we are ready to truly test BT communication over Serial.

Test Bluetooth Connectivity
  • At this junction we are still wired up and connected as USB Serial Port to the BT Module.
  • One session of RealTerm is sitting idle on COM11, albeit a closed port.
  1. Open a second session of RealTerm (it might give you an error saying the COM Port is open; don’t worry about it).
  2. Configure this session to be identical to the first RealTerm; everything is exactly the same – EXCEPT we’re going to use COM10 (or whatever your BT COM Port is).
  3. Open the ports of both; check that they are open without errors. The BT COM Port opens a little slower than the USB Port.
  4. Make sure your Echo Port settings are correct; Baud rates must match Ports or you’ll get garbage or nothing at all.
  5. Switch to the Send tabs. Clear your screens. Using RealTerm on the USB Port, send “Hello World!” and look for it on the RealTerm BT Port screen. Did it work? If so…
  6. From the RealTerm BT Port, send “Yabadabadoo!”: Did it show up on the RealTerm USB Port?

RealTerm.BT2USBonCOM10Success.png

BT on COM 10 receives "Hello World!"

RealTerm.USB2BTonCOM11Success.png

USB on COM 11 receives "Yabadabadoo!"

:mrgreen: Congrats if so – you are ready to use this device in place of the USB Serial Cable – with a little bit more help to follow…

:oops: If not, we have problems. If everything worked up to this point you cannot send or receive – then I suggest that the Devil is in the details – and that in some step probably a very tiny item was overlooked. Retrace and review the screenshots for help. I know for myself – this took me nearly a week to figure out because there is no one single end-to-end guide, and here we are at 7 pages… and I’m still not finished.

Where to now Vern?
All we have done here is get the BT to work over wireless as a COM Port. We still have not connected a controller to it, nor tested the programming application. With regards to controllers, the EB2xx series uses a Baud rate of 9600, and the EB3xx uses 38400. Now that the BT device is set to 115200, matching about the fastest speed the PC can deliver, it should in theory accept any speed we set in the Device Manager… and I’ve tested that to success:

  1. Close the BT COM Port.
  2. Change the BT COM Port speed in Device Manager to 9600.
  3. Using RealTerm on the BT COM Port, change the Port and Echo Port Baud rates to 9600.
  4. Open the BT COM Port. Resend messages… it should work; mine did.

That’s it for now. Thanks for your interest. Feedback acceptable. I’m going back now to work on the original BT project:
Handheld Serial Programming: USB or Wireless

Cheers, KF
 
Back
Top