Data forwarder wont detect virtual port

I’m having issues passing data from a virtual com port into the data forwarder.

Project ID:

Context/Use case:
I have a system with a wearable 6DOF accelerometer sensor, transmitting the formatted data through bluetooth to my computer. using com0com, that data is then being forwarded to a virtual port (com9) on my computer. however, i cant get the data forwarder to detect com9. i do need to transmit the data through bluetooth, as the sensor is to be worn by dancers and thus cant have cables. how can i pass the data recieved through bluetooth into the platform for classification?

Hi @rubencasta44658,

Can you share the error message you’re seeing and (if possible) your code? If that doesn’t work, I might recommend collecting data onto SD cards that you can then upload in e.g. CSV format for model training.

the code is just a simple mixture of the bluefruit ble_multi example and some code to get the IMU data to send and format it. its being run on a xiao seeed studio nRF52840 sense. the code is just as follows:

#include <bluefruit.h>
#include “LSM6DS3.h”
#include “Wire.h”

uint8_t connection_count = 0;
#define CONVERT_G_TO_MS2 9.80665f
#define FREQUENCY_HZ 100
#define INTERVAL_MS (1000 / (FREQUENCY_HZ + 1))
static unsigned long last_interval_ms = 0;

//Create a instance of class LSM6DS3
LSM6DS3 myIMU(I2C_MODE, 0x6A); //I2C device address 0x6A

// BLE Service
BLEDfu bledfu; // OTA DFU service
BLEDis bledis; // device information
BLEUart bleuart; // uart over ble

void setup()
while ( !Serial ) delay(10); // for nrf52840 with native usb
if (myIMU.begin() != 0) {
Serial.println(“Device error”);
} else {
Serial.println(“Device OK!”);

Serial.println(“Bluefruit52 BLEUART Example”);

// Setup the BLE LED to be enabled on CONNECT
// Note: This is actually the default behaviour, but provided
// here in case you want to control this LED manually via PIN 19

// Initialize Bluefruit with max concurrent connections as Peripheral = 2, Central = 0
Bluefruit.begin(MAX_PRPH_CONNECTION, 0);
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values


// To be consistent OTA DFU should be added first if it exists

// Configure and Start Device Information Service
bledis.setManufacturer(“Adafruit Industries”);
bledis.setModel(“Bluefruit Feather52”);

// Configure and Start BLE Uart Service

// Set up and start advertising

Serial.println(“Please use Adafruit’s Bluefruit LE app to connect in UART mode”);
Serial.println(“Once connected, enter character(s) that you wish to send”);

void startAdv(void)
// Advertising packet

// Include bleuart 128-bit uuid

// Secondary Scan Response packet (optional)
// Since there is no room for ‘Name’ in Advertising packet

/* Start Advertising

    • Enable auto advertising if disconnected
    • Interval: fast mode = 20 ms, slow mode = 152.5 ms
    • Timeout for fast mode is 30 seconds
    • Start(timeout) with timeout = 0 will advertise forever (until connected)
  • For recommended advertising interval
  • Technical Q&A QA1931: Using the correct Bluetooth LE Advertising and Connection Parameters for a stable connection
    Bluefruit.Advertising.setInterval(32, 244); // in unit of 0.625 ms
    Bluefruit.Advertising.setFastTimeout(30); // number of seconds in fast mode
    Bluefruit.Advertising.start(0); // 0 = Don’t stop advertising after n seconds

// print a string to Serial Uart and all connected BLE Uart
void printAll(uint8_t* buf, int count)
Serial.write(buf, count);
size_t sent;
// Send to all connected centrals
for (uint8_t conn_hdl=0; conn_hdl < MAX_PRPH_CONNECTION; conn_hdl++)
sent = bleuart.write(conn_hdl, buf, count);

char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
char fmt[20];
sprintf(fmt, “%%%d.%df”, width, prec);
sprintf(sout, fmt, val);
return sout;

void loop()
uint8_t buf[20];
uint8_t bufacc[21] = “”;
char accbuf[21] = “”;
uint8_t bufgyr[21] = “”;
char gyrbuf[21] = “”;
char fbuf[10];
int count;
float accX;
float accY;
float accZ;
float gyrX;
float gyrY;
float gyrZ;

if (millis() > last_interval_ms + INTERVAL_MS) {
last_interval_ms = millis();

accX = myIMU.readFloatAccelX() * CONVERT_G_TO_MS2;

accY =myIMU.readFloatAccelY() * CONVERT_G_TO_MS2;

accZ = myIMU.readFloatAccelZ() * CONVERT_G_TO_MS2;

gyrX =myIMU.readFloatGyroX();

gyrY =myIMU.readFloatGyroY();

gyrZ = myIMU.readFloatGyroZ();

dtostrf(accX, 5, 4, fbuf);
strcat(accbuf, fbuf);
strcat(accbuf, "\t");
dtostrf(accY, 5, 4, fbuf);
strcat(accbuf, fbuf);
strcat(accbuf, "\t");
dtostrf(accZ, 5, 4, fbuf);
strcat(accbuf, fbuf);
strcat(accbuf, "\t\0");

dtostrf(gyrX, 3, 2, fbuf);
strcat(gyrbuf, fbuf);
strcat(gyrbuf, "\t");
dtostrf(gyrY, 3, 2, fbuf);
strcat(gyrbuf, fbuf);
strcat(gyrbuf, "\t");
dtostrf(gyrZ, 3, 2, fbuf);
strcat(gyrbuf, fbuf);
strcat(gyrbuf, "\n\0");

for (int i = 0; i < sizeof(accbuf); i++){
 bufacc[i] = uint8_t(accbuf[i]);

for (int i = 0; i < sizeof(accbuf); i++){
 bufgyr[i] = uint8_t(gyrbuf[i]);

count =  sizeof(bufacc);

// count = sizeof(buf);
printAll(bufacc, count);

count =  sizeof(bufgyr);

printAll(bufgyr, count);

// Forward from BLEUART to HW Serial
if ( bleuart.available() )
 count =, sizeof(buf));

 printAll(buf, count);


// callback invoked when central connects
void connect_callback(uint16_t conn_handle)
// Get the reference to current connection
BLEConnection* connection = Bluefruit.Connection(conn_handle);

char central_name[32] = { 0 };
connection->getPeerName(central_name, sizeof(central_name));

Serial.print("Connected to ");

Serial.print("Connection count: ");

// Keep advertising if not reaching max
if (connection_count < MAX_PRPH_CONNECTION)
Serial.println(“Keep advertising”);


  • Callback invoked when a connection is dropped
  • @param conn_handle connection where this event happens
  • @param reason is a BLE_HCI_STATUS_CODE which can be found in ble_hci.h
    void disconnect_callback(uint16_t conn_handle, uint8_t reason)
    (void) conn_handle;
    (void) reason;

Serial.print(“Disconnected, reason = 0x”); Serial.println(reason, HEX);


the code seems to work, as i am able to connect to bluetooth and send it to putty, however, when i try to connect the data forwarder, there is no error message, but it tries to connect to the cable on com 5 (which is only conected at the moment for testing purposes) and doesnt even acknowledge the virtual port of com 9. my supervising teacher and i have decided to atempt to use puTTy’s logs, converted to CSV, in order to upload the data we need. Sorry for bothering your team and thanks for the help.

1 Like