Electronic – Bluetooth module

bluetooth

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.
properties

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

Device Manager shows COM6 and 7 for serial over bluetooth.
device manager

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.
PuTTY configuration

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.
PuTTY session

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

Best Answer

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!