hciconfig hci0 down && hciconfig hci0 up
Hi there. I'm trying to run an example from https://lab.ruuvi.com/iota/ and I cannot seem to get it to work. When I try to run "example.js" it gives me the error... pi@RaspAurora:~/ruuvi-nodejs $ node example.js
module.js:540
throw err;
^
Error: Cannot find module '../build/Release/binding.node'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/pi/ruuvi-nodejs/node_modules/bluetooth-hci-socket/lib/native.js:3:15)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
Hi Sandeep.
Thanks for this awesome library :)
I am struggling to get notification updates after I made a write to a different characterstic.
I can successfully subscribe and get notified of updates from characteristic A, but when I make a write to characteristic B, then the notifies on A stop working.
If I don't write to B then A will happily keep receiving notifications.
service.discoverCharacteristics(null, (err, characteristics) => {
for (var i in characteristics) {
console.log(' ' + i + ' uuid: ' + characteristics[i].uuid);
console.log(playerNumberCharacteristicUuid);
if (characteristics[i].uuid === movementCharactersticUuid){
console.log('got the right one');
movementCharacteristic = characteristics[i];
movementCharacteristic.read(function (error, readdata) {});
movementCharacteristic.on('read', function (readdata, isNotification) {
}.bind(this));
movementCharacteristic.subscribe(function (err) {
if (err) console.log('error subscribing!');
console.log('subscribed to characteristic ...');
});
} else if (characteristics[i].uuid === playerNumberCharacteristicUuid){
playerNumberCharacterstic = characteristics[i];
playerNumberCharacterstic.write(Buffer.from('1','utf8'), true, function (error) {
}.bind(this));
}
}
});