Hi all,
since i got my 2 Pucks, i am doing some experiment with BLE devices.
I was tempted and i've bought an Awox BLE Color Bulb, but i'm having problem getting Primary Services.
I am only able to use the first Primary Service "33160fb9-5b27-4e70-b0f8-ff411e3ae078" and its characteristic "217887f8-0af2-4002-9c05-24c9ecf71600", where sending 0 or 1 will turn the bulb off/on.
There are at least 2 other Primary Service (discovered with nRF Connect), 1 for warm light brightness and 1 for RGB lights.
Trying to use one of these, i receive the error on command gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032")
Uncaught Error: Unhandled promise rejection: Error: Too many custom UUIDs already
Actually, yesterday i could correctly see at least the first PrimaryService UUID ("33160fb9-5b27-4e70-b0f8-ff411e3ae078"), so the only way i found to access other services is using gatt.PrimaryServices() and then use the array index of the service i need instead of using for example gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032")
This is the portion of the (dirty) code i am using, just for testing purpose
function connectToBulb(){
console.log("Connecting to bulb...");
NRF.connect("98:7b:f3:77:a4:23").then(function(g){
connected = true;
digitalPulse(LED3, 1, 500);
gatt = g;
return gatt.getPrimaryServices();
}).then(function(service){
return service[4].getCharacteristics(); // Equals to "fff6fe25-469d-42bc-9179-b3a093f19032"
}).then(function(c){
c[1].writeValue(0x7F); // Equals to "d8da934c-3d8f-4bdf-9230-f61295b69570"
});
}
while using gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032") or gatt.getCharacteristic("d8da934c-3d8f-4bdf-9230-f61295b69570") are returning me the mentioned error.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi all,
since i got my 2 Pucks, i am doing some experiment with BLE devices.
I was tempted and i've bought an Awox BLE Color Bulb, but i'm having problem getting Primary Services.
I am only able to use the first Primary Service "33160fb9-5b27-4e70-b0f8-ff411e3ae078" and its characteristic "217887f8-0af2-4002-9c05-24c9ecf71600", where sending 0 or 1 will turn the bulb off/on.
There are at least 2 other Primary Service (discovered with nRF Connect), 1 for warm light brightness and 1 for RGB lights.
Trying to use one of these, i receive the error on command gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032")
If i try gatt.PrimaryServices(), i get this
Actually, yesterday i could correctly see at least the first PrimaryService UUID ("33160fb9-5b27-4e70-b0f8-ff411e3ae078"), so the only way i found to access other services is using gatt.PrimaryServices() and then use the array index of the service i need instead of using for example gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032")
This is the portion of the (dirty) code i am using, just for testing purpose
while using gatt.PrimaryService("fff6fe25-469d-42bc-9179-b3a093f19032") or gatt.getCharacteristic("d8da934c-3d8f-4bdf-9230-f61295b69570") are returning me the mentioned error.
Am i doing something wrong?