GithubHelp home page GithubHelp logo

Connect Muse on Mac OS 10.14.5 about muse-js HOT 4 CLOSED

urish avatar urish commented on July 29, 2024
Connect Muse on Mac OS 10.14.5

from muse-js.

Comments (4)

360disrupt avatar 360disrupt commented on July 29, 2024 1

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.

urish avatar urish commented on July 29, 2024

I'm not running on Mac OS (rather Windows), but I will try to answer based on my memory:

  1. 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
  2. Can you connect to the headset using your phone? Does it show up and you scan for bluetooth devices on your mac?
  3. 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.
  4. Nope, you don't need any of the muse SDKs to work. This library implements everything from scratch.

from muse-js.

360disrupt avatar 360disrupt commented on July 29, 2024

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.

larskarbo avatar larskarbo commented on July 29, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.