Issue: Can pair a Windows 10 device with an Arduino device and communicate over RFCOMM.  Although can pair two Windows 10 devices over Bluetooth Serial, I can’t serially transmit between them: No serial port for OutGoing end.

 

Context

The aim of the SurfPad project is to use a Windows Touchscreen, such as with a Surface (including a WinRT Surface 2) as the UI frontend for a remote embedded and/or IoT device. The backend can be such devices as an Arduino or Windows 10 IoT Core device. Others are possible as the communication protocol between the front and backend is quite simple. The communication conduit can be Network Sockets (Client-Server architecture), USB Serial or Bluetooth Serial.

 

These configurations have been implemented but a problem has arisen when using Bluetooth Serial between a Windows 10 Desktop frontend and a Windows 10 IoT Core backend. Whilst the two ends can be Bluetooth paired they fail to connect at runtime. I have reduced the problem to a failure to connect two serial terminal between two paired Windows 10 desktops.

 

Setup to demonstrate the problem.

- Two Windows 10 desktops

  1. Surface Book 2 OS Version 1709 Build 16299.309
  2. Dell Probook 450 G1 OS (Fast Track) 1803 Version Build 1728.

NB: This problem occurred with earlier Builds of the OS

- Bluetooth enabled

    - NB: Tried this with Built in Bluetooth Radios

  1. Marvell AVASTAR Bluetooth Radio Adapter
  2. Qualcomm Atheros QCA9565 Bluetooth 4.0 + HS Adapter

   - And with external Generic Dongles (internal radio disabled)

            - CSR (Cambridge Silicon Radio Ltd)

    - Pairing details later.

    - Serial Terminal Program

        - Eg Putty (and others)

       -  UWP Bluetooth RFCOMM code.

 

Methodology

1. Setup and pair the two machines as below.

  • 2. Open the serial ports.

3. Attempt to transmit text using the terminal program

Outcome: No transmission. Transmitting end appears to never transmit

 

Pairing

Pairing between a Windows 10 desktop and an Arduino Bluetooth Shield is covered in a previous blog article: SurfPad: Your old Surface as a Remote App Touchpad: Bluetooth Connectivity-1/2. This covers the main aspects of pairing.

Note that you get to the Bluetooth COM Port settings through More Bluetooth options under Related Settings on the right of the Bluetooth & other devices settings page:

clip_image001

 

Note also that on the first tab following that you get the option to make a PC discoverable as well as to get alerts when something is trying to connect:

clip_image003

 

The COM ports are configured via the COM Ports tab.

Where the connectivity supports Bluetooth serial (SPP profile) a COM port will/may be created. There are two types of COM port connectivity

Incoming (remote device initiates connection)

- The remote device connected to by the PC initiates the connection

Outgoing (the PC initiates the connection)

- The PC connects to the remote device

 

The following demonstrates an Outgoing COM port from a PC to an Arduino Bluetooth Shield:

clip_image005

Note the identified Serial service Dev B.

 

If the PC is to be connected to from another PC (or IoT Core device) then one end would be the Incoming device and the other the Outgoing.

Having set both PCs in Add a Device/Bluetooth Device Pairing mode on one device to select the other to pair:

clip_image007

A mirroring dialog then appears, after a while, on the other device (the laptop in this case),
querying :

Pair device?
Does the PIN on “your device” match the PIN below?
641880
[ Yes ] [ Cancel ]

Except [Connect] and [ Yes ] on the PCs and the pairing is complete.

 

On the device accepting the pairing, an Incoming COM port (in this case COM3) is automatically created. This also shows under Device Manager/COM Ports:

clip_image008

 

But on the device that initiated the pairing, no COM port is automatically created.

clip_image010

No Device to select from the Outgoing COM ports.


Select [Browse] and then select the other device (in this case Laptop):

clip_image012

In this case no Serial Port available:

clip_image014

 

Whilst it indicates that the problem is at the other end, the other PC’s Bluetooth connection does have an Incoming Serial Port (COM3 in this case) that was automatically assigned when the pairing occurred. But then again the Surface Book is able to connect the Arduino Bluetooth Shield as the initiator (and Outgoing COM port).

 

In Summary

The quest here is:

How can you get two UWP apps running on separate Windows 10 systems (whether desktop or IoT Core) to communicate over Bluetooth Serial? 

This can be reduced down to:
Having paired two Windows 10 desktops over Bluetooth, with their Bluetooth radios both supporting RFCOMM (SPP profile) how do we get a COM port on the Outbound connection?

 


PS

As a workaround with with with an IoT Core device (eg RPI) as the remote device and a desktop as the frontend, I used a SparkFun Bluetooth Mate (Gold )connected to the RPI UART (Pins 8 & 10) in which case on the RPI,  the connectivity reduces to be pure serial comms.