Read the statement by Michael Teeuw here.
Bluetooth connections with noble
-
How did you rebuild? Which command did toy use?
-
Hey @yawns,
I tried to rebuild noble and bluetooth-hci-socket by:npm uninstall bluetooth-hci-socket
followed by
npm install bluetooth-hci-socket
within the /home/pi/MagicMirror/modules/MMM-OralB/ - folder and also the
npm rebuild bluetooth-hci-socket
which should to to same.
Same for the hole noble package within the same folder.
-
with the help of @dfuerst we were able to solve this issue by rebuilding electron with a special version:
sudo npm rebuild --runtime=electron --target=1.4.6 --disturl=https://atom.io/download/atom-shell --abi=50
-
Great. That’s what I was aiming for.
-
So noble is working fine. I find all bluetooth devices as expected, as long it’s not running within the MM-framework.
It seems like noble isn’t able to power on the bluetooth adapter on the raspberry pi3 board when started by magicmirror.
Any ideas?
Here is a minimal example:
var noble = require('noble'); console.log('stateChange is: ' + noble.state); noble.on('stateChange', function(state) { console.log('changed state to: ' + noble.state); if (state === 'poweredOn') { noble.startScanning(); }else { noble.stopScanning(); } }); console.log('stateChange is: ' + noble.state);
leeds to:
stateChange is: unknown stateChange is: unknown
-
maybe using hcitool with the syntax for pairing a device before would solve this issue, have you tried that?
as far as i understand the rpi3 bluetooth is on, at startup, but you have to pair the devices every startup, unless you use hcitool with the corresponding syntax for direct pairing within your .js -
We were able to solve this issue by ruinning the MM² with sudo-right. See here for details.