# Bluetooth module

I'm trying to use a bluetooth module, but I'm stuck at connecting/configuring it.

When powered, the module blinks an led connected to PIO5 once per second, so it is in Discoverable/Inquiring/Idle according to "7.3 LED Status" of the user manual.

When I view the properties of the device on my laptop, it shows its using COM6.

Bluetooth Settings shows the device using two ports: COM6 and COM7.

Device Manager shows COM6 and 7 for serial over bluetooth.

My first question is why there are two ports being used; one for outgoing and one for incoming. I did not expect to see separate ports for incoming and outgoing.

I attempt to connect to the device from my laptop with PuTTY over COM6 using the settings documented in 3.2 and 3.3 of the user manual.

The LED stops blinking, but that behavior isn't documented.
PuTTY 's session window is empty and doesn't allow me to type/send characters, even after hitting enter a dozen times.

Am I doing something wrong?
Should I have a second session open on COM7?

-
I'm not convinced this is on-topic; thoughts? –  antony.trupe May 1 '11 at 21:49
Trupe, I think people working with the bluetooth module asking for help probably fits. They will not get help on another SE site and it normally has to do with the detailed workings of the technology, for this example, bluetooth. I think that this is getting to the boundary of our site, but is still on the boundary and worth answering. –  Kortuk May 1 '11 at 21:54
What do you mean "PuTTY doesn't allow data entry"? You don't see anything? Unless what you're connecting to actually sends some sort of reply, the window won't show anything, even if you're transmitting. –  Nick T May 2 '11 at 12:13
@Nick T I was expecting to be able to type a string, hit enter, and be moved to the next line, rinse, repeat. –  antony.trupe May 2 '11 at 14:35

A bit of background first: the distinction between incoming and outgoing RFCOMM (Bluetooth stack protocol for virtual COMs) ports is necessary because it's always one of the communicating devices that initiates the connection (a bit similar to TCP sockets - where you have server and client).

• The outgoing COM port is used when the PC initiates the connection to the remote device (opening the port initiates RFCOMM connection to the remote device).
• The incoming COM port is used when the remote device initiates the connection.

Once the connection is opened it is bidirectional, regardless of the type.

That said, this Bluetooth module supports both master and slave mode (see manual chapter 2), that's why it advertises 2 RFCOMM/SPP ports, I guess. If you want PC to initiate the connection, use COM6, otherwise use COM7.

Why you see no echo in PuTTY? By default there's no local echo, and you actually shouldn't see any characters you type (unless you short UART_RX to UART_TX, or have some real device attached there to communicate with). The module itself is transparent (in the data mode, that is).

Also, baud rate etc. shouldn't really matter for Blueooth connection - note, that chapter 3.2 refers to configuring the device via physical serial port (UART_RX/TX pins, i.e. from the device side), while 3.3 describes configuring over virtual port (i.e. from the PC side). I somehow feel you're confusing the module sides ;)

This excerpt from the manual is quite important:

To connect to FireFly, browse for services, you should see: “SPP” profile with a virtual COM port. Open this virtual COM port to create a Bluetooth connection. Once connected, the device will be in data mode allowing data to flow in both directions as if the serial port were locally attached to the PC. The device must be in command mode for configuration and programming. To enter command mode type “\$” (three dollar signs) from either the remote Bluetooth connection or the local serial port connection. You must enter command mode within 60 seconds (configurable by setting the config timer).

Cool module, btw!

-
I understand the pair of COM ports now, thanks. –  antony.trupe May 2 '11 at 19:25
I probably am confusing the physical/virtual ports. I have an ardiuno uno wired up to the physical module's rx and tx pins. If I send a character to the module from my pc, I should be able to read it off the physical uart_rx pin, right? –  antony.trupe May 2 '11 at 19:39
That's how I understand the docs - in the data (default) mode, the module should be transparent. Yet I have spent only a few minutes browsing the manual. –  Code Painters May 2 '11 at 22:39
gotchu. I really appreciate you taking a look at this with me. –  antony.trupe May 3 '11 at 0:15
I got the bt module connected to an Uno to send messages to PuTTY, and PuTTy to send messages to the bt module and echo'd to the serial monitor of the Uno! –  antony.trupe May 5 '11 at 22:55