Comments (4)
I installed the two alternative packages. I also noticed that the headset is shown in my Mac's bluetooth devices as connected. I'm not quite sure when this happend, probably my phone shared the connection.
My code is now:
const noble = require('noble-mac');
const bluetooth = require('bleat').webbluetooth;
const { MUSE_SERVICE, MuseClient } = require('muse-js');
async function connect() {
let device = await bluetooth.requestDevice({
filters: [{ services: [MUSE_SERVICE] }]
});
const gatt = await device.gatt.connect();
const client = new MuseClient();
await client.connect(gatt);
await client.start();
// Now do whatever with muse client...
client.eventMarkers.subscribe((event) => {
console.log(event);
});
}
noble.on('stateChange', (state) => {
if (state === 'poweredOn') {
connect();
}
});
{
"name": "brainwave",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"muse-js": "^3.1.0",
"bleat": "https://github.com/larskarbo/bleat-mac",
"noble-mac": "https://github.com/Timeular/noble-mac.git",
"scribbletune": "^2.0.2"
}
}
The only msg I got so far is:
Initing modified version of bleat. (swapping noble with noble-mac) 👍
Now it is connected! Many thx!
from muse-js.
I'm not running on Mac OS (rather Windows), but I will try to answer based on my memory:
- Are you using the 2016 version of the headset? the older run (I think it was 2014) doesn't run on Bluetooth Low Energy and isn't supported
- Can you connect to the headset using your phone? Does it show up and you scan for bluetooth devices on your mac?
- Yes, the http://localhost:4445/ address is from running within the browser. Does the browser version work? You can also try this online app: https://muse-eeg-app.firebaseapp.com/ which is based on the very same library.
- Nope, you don't need any of the muse SDKs to work. This library implements everything from scratch.
from muse-js.
1 )Yes, I got the 2016 version of MUSE I.
2) I can connect the headset to my phone, but it automatically connects to the muse app. The manual for the app also tells that it shouldn't be connected via the phones Bluetooth settings. I don't see the device on my phone/mac if I scan for Bluetooth devices.
3) The firebaseapp detects the headset and connects to it.
Does the browser version work?
What do you mean by that?
Opening the localhost does show the website is not reachable.
PS:
I wasn't able to install xpc-connection
. The package seems to be depreceated. I installed xpc-connect
(a fork of the original package) instead and changed all refrences in the node_modules to xpc-connect
.
from muse-js.
@360disrupt I ran into this issue myself!
It seems to be a problem with the noble
package not using the latest CoreBluetooth API (but using xpc-connection instead i guess).
I got noble
working by using noble-mac
instead. https://github.com/Timeular/noble-mac
You also have to patch the bleat
module (because it has its own reference to noble
). I made a repo where I monkeypatched the bleat
module to use noble-mac
instead. https://github.com/larskarbo/bleat-mac
So basicly you can make it work by including these two in your package json:
"bleat": "https://github.com/larskarbo/bleat-mac",
"noble-mac": "https://github.com/Timeular/noble-mac.git",
And changing require('noble')
to require('noble-mac')
in your script file
const noble = require('noble-mac');
const bleat = require('bleat').webbluetooth;
from muse-js.
Related Issues (20)
- Absolute Band Powers? HOT 2
- Reconnection HOT 5
- Is it possible use this library in ASP Net Core project?
- Where did you get information? HOT 3
- Muse S compatibility HOT 4
- Muse js - raw file values mV or uV? HOT 2
- What type of window does muse js use? HOT 1
- Argument of type '(reading: EEGReading) => Observable<EEGReading[]>' is not assignable to paraming[] HOT 2
- Protocol Advice HOT 8
- Connect issue breaks web software with Muse 2016 - Edit HOT 3
- Muse S optical sensor support HOT 4
- Support for 2014 Muse hardware?
- semi off-topic: MUSE USB COM PORT
- Simultaneous EEG / PPG and zipping samples HOT 1
- how to subscribe to only one electrode?
- How to obtain the mellow & concentration values?
- Feature request: Check if electrodes are well placed
- How to integrate with LSL?
- Sample rate and chunk size HOT 2
- Battery Percentage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from muse-js.