Where to add UUIDs in Arduino BLE example
Posted: 17:53, 03 Mar 2015
Hello All,
I am trying to use my peripheral with the arduino ble example. I am using a tinyduino microcontroller with the BLE shield.
I have changed the example to my peripheral name like so in the app.js:
after doing so i attempted to connect to the peripheral using the evothing ide and the log outputs:
Scanning...
LOG: found device: BGLib U1A1P 38.4NF
LOG: Found arduinoble
LOG: Connecting...
LOG: Connected
LOG: Reading services...
LOG: ERROR: RX/TX services not found!
I do not know why the rx/tx services are not working.
My uuids are as follows:
BLUEGIGA_SERVICE_UUID "195A*********************************************"
BLUEGIGA_CHAR_TX_UUID "2181*********************************************""
BLUEGIGA_CHAR_RX_UUID "5FC5*********************************************""
in the app.js I am unaware of where to put these UUIDS after reading i did it this way but i have had not luck getting it to work:
I am not sure where to retrieve the descriptor UUID
I would really appreciate the help.
Anyone?
I am trying to use my peripheral with the arduino ble example. I am using a tinyduino microcontroller with the BLE shield.
I have changed the example to my peripheral name like so in the app.js:
Code: Select all
startScan: function()
{
console.log('Scanning...');
evothings.ble.startScan(
function(deviceInfo)
{
if (app.knownDevices[deviceInfo.address])
{
return;
}
console.log('found device: ' + deviceInfo.name);
app.knownDevices[deviceInfo.address] = deviceInfo;
if (deviceInfo.name == 'BGLib U1A1P 38.4NF' && !app.connectee)
{
console.log('Found arduinoble');
connectee = deviceInfo;
app.connect(deviceInfo.address);
}
},
function(errorCode)
{
console.log('startScan error: ' + errorCode);
});
},
after doing so i attempted to connect to the peripheral using the evothing ide and the log outputs:
Scanning...
LOG: found device: BGLib U1A1P 38.4NF
LOG: Found arduinoble
LOG: Connecting...
LOG: Connected
LOG: Reading services...
LOG: ERROR: RX/TX services not found!
I do not know why the rx/tx services are not working.
My uuids are as follows:
BLUEGIGA_SERVICE_UUID "195A*********************************************"
BLUEGIGA_CHAR_TX_UUID "2181*********************************************""
BLUEGIGA_CHAR_RX_UUID "5FC5*********************************************""
in the app.js I am unaware of where to put these UUIDS after reading i did it this way but i have had not luck getting it to work:
Code: Select all
getServices: function(deviceHandle)
{
console.log('Reading services...');
evothings.ble.readAllServiceData(deviceHandle, function(services)
{
// Find handles for characteristics and descriptor needed.
for (var si in services)
{
var service = services[si];
for (var ci in service.characteristics)
{
var characteristic = service.characteristics[ci];
if (characteristic.uuid == '2181****************************')
{
app.characteristicRead = characteristic.handle;
}
else if (characteristic.uuid == '5FC5****************************')
{
app.characteristicWrite = characteristic.handle;
}
for (var di in characteristic.descriptors)
{
var descriptor = characteristic.descriptors[di];
if (characteristic.uuid == '2181****************************' &&
descriptor.uuid == '5FC5****************************')
{
app.descriptorNotification = descriptor.handle;
}
}
}
}
if (app.characteristicRead && app.characteristicWrite && app.descriptorNotification)
{
console.log('RX/TX services found.');
app.startReading(deviceHandle);
}
else
{
console.log('ERROR: RX/TX services not found!');
}
},
I am not sure where to retrieve the descriptor UUID
I would really appreciate the help.
Anyone?