Arduino 101 and Windows 10 bandwidth / timmings

I'm trying to make a midi wireless controller using an Arduino 101 (one way, only sends data), I've succeeded in sending messages and receiving / outputing midi (receiving program in C# via UwpDesktop that exposes some WinRT functionality), on one analog input I have one standard footswitch (which is basically a potentiometer) and I update the associated 'BLEUnsignedIntCharacteristic' in each cycle with its current analogRead value... however currently I'm receiving only 8 messages per second which makes continuous controllers feel a lot less continuous and more stair-step like. Is there a way to increase the rate of messages BLE sends / receives?

Hello, there:

Would you please provide more info on the following questions,

  1. Are you using the 101 as a BLE Peripheral sending data to a Central (eg. cell phone, PC, iPad, etc).

  2. If so, are you making your BLEUnsignedIntCharacteristic as "notification"? That is the fast way to send data but lossy.

  3. What is the Connection Interval setting in your Central device? The small the value, the more chances for data transaction.

Thanks,
Sid

Hi, thanks for the reply, I'm not sure if I can answer all those questions, I'm still trying to understand a lot of things, anyway here I go...

  1. Yes, Arduino should only send data (nothing to receive)
  2. Yes (I suppose that's the meaning of BLENotify)
  3. Not sure (details to follow)

I'll provide more details...

--- Arduino side:

global variables

// peripheral instance
BLEPeripheral blePeripheral;
// BLE custom service
BLEService footPedalService( ...some guid 1... );

static const int analogControllersCount = 2;
BLEUnsignedIntCharacteristic analogControllerCharacteristic[analogControllersCount] =
{
	BLEUnsignedIntCharacteristic( ...some guid 2... , BLERead | BLENotify ),
	BLEUnsignedIntCharacteristic( ...some guid 3... , BLERead | BLENotify)
};

in setup()

blePeripheral.setLocalName( ...a string... );
blePeripheral.setDeviceName( ...a string... );
// set the UUID for the service this peripheral advertises:
blePeripheral.setAdvertisedServiceUuid(footPedalService.uuid());
blePeripheral.setConnectionInterval(MIN_CONN_INTERVAL, MIN_CONN_INTERVAL);

// add service and characteristics
blePeripheral.addAttribute(footPedalService);
for (int i = 0; i < analogControllersCount; ++i)
	blePeripheral.addAttribute(analogControllerCharacteristic[i]);

// initialize values
for (int i = 0; i < analogControllersCount; ++i)
	analogControllerCharacteristic[i].setValue(0);
  • then in loop is used like:
analogControllerCharacteristic[i].setValue( ... )

--- Central side (c# app running in windows 10)
A lot of code here, so I'll just put the device related stuff
I list potential devices using:

DeviceInformation.CreateWatcher(GattDeviceService.GetDeviceSelectorFromUuid( ...guid 1... ), new[] { "System.Devices.ContainerId" })

then something like:

var service = await GattDeviceService.FromIdAsync(value.Id));
var characteristic = service.GetCharacteristics( ...guid 2 / 3... )[0];

I don't see nothing related to interval settings in those classes, maybe some configuration in windows control panel?