charliegerard / Epoc.js

Node.js addon for the Emotiv C++ SDK
MIT License
782 stars 48 forks source link

How to make .emu file ? #7

Open manifestinteractive opened 6 years ago

manifestinteractive commented 6 years ago

I have an Emotiv Epoc+ v1.1 released back in 2015 and have the latest emotiv MacOS framework installed ( community-sdk-3.5.1-WIN-MAC-ANDROID ).

screenshot 2018-05-25 at 11 28 07 pm

I am successfully able to turn on the device and use it in the emotiv apps and see feedback.

screenshot 2018-05-25 at 11 50 21 pm

However there does not appear to be any Profiles folder in my users Emotive folder:

/Users/peter/Library/Application Support/Emotiv

screenshot 2018-05-25 at 11 14 06 pm

I assumed, likely incorrectly, that since I did not have that file, perhaps your instructions were stating I should make a file, as there was a comment in the example for "path/to/user/file".

Here is a sample code I used to see if I could get things running:

var Epoc = require('epocjs')();

Epoc.connectToLiveData('./test.emu', function(event) {
  if (event) {
    console.log('Event Fired');

    if (event.batteryLevel && event.batteryLevel > 0) {
      console.log(`Battery level: ${event.batteryLevel}%`);
    }
  }
});

Here is the output from that command

screenshot 2018-05-25 at 11 30 12 pm

If there is something I am supposed to be doing with the Emotiv in the background, it would be helpful to learn this. The docs make it sound like I can just plug on the device, make sure I can access it via the Emotiv software, then fire up some node script to connect to it, and that is not turning out to be the case :(

BTW, for the sake of testing purposes, I also use the Epoc.connectToEmoComposer method while tinkering with the EmotivXavierComposer app in the background, and the output from that was only ever Connected to EmoComposer but none of the tested events seemed to fire off either. Not sure if maybe something else is going on here where the method are not firing for some reason I don't know about.

Here was my test file for that, should this be a related issues:

var Epoc = require('epocjs')();

Epoc.connectToEmoComposer(function(event) {
  if (event) {
    pastAction = action;

    if (event.blink > 0) {
      action = 'blink';
    }

    if (event.lookingLeft > 0) {
      action = 'looking left'
    }

    if (event.lookingUp > 0) {
      action = 'looking up'
    }

    if (event.gyroX) {
      console.log("gyroX: ", event.gyroX);
    }

    if (event.gyroY) {
      console.log("gyroY: ", event.gyroY);
    }

    // at the moment will only handle 1 event at a time. Need to fix that
    if (pastAction !== action) {
      console.log('action', action)
    }
  }
});

Any help would be greatly appreciated 😃

manifestinteractive commented 6 years ago

Just a heads up that I was able to figure out why I was not getting any output from these methods. Looks like this library only works with the USB Dongle connection, which I was not aware of. I was using the Bluetooth LTE connection.

The original question regarding how one makes the profile .emu file, or if it is even required, is still something I am interested in learning more about.

ocyedwin commented 6 years ago

@manifestinteractive I'm also confused about the existence of this file, any clue yet?

manifestinteractive commented 6 years ago

@ocyedwin Nope :)

Only thing I could remotely find on it was related to Emotiv Cloud Profiles. Here are three files on the Emotiv Community SDK that seemed to talk about it, though not exactly sure of any Emotiv apps that have this feature built in.

https://github.com/Emotiv/community-sdk/search?q=.emu&unscoped_q=.emu

Heck, I even have the pro account at $99 a month and don't see any way of exporting these files.

However, it does appear that the code works regardless if the .emu file exists. So who knows at this point. Would be super awesome to learn how this is used in this project, but guessing that's not the biggest priority given the other stuff they are working on.

holistudio commented 5 years ago

Hello world! I'm fairly new to the use of Emotiv and am having similar issues finding the profile file.

I've so far used the EmotivBCI app to train the expression/command recognition. Within the EmotivBCI I can definitely see it works for smile recognition.

I suspect the profile files are "in the cloud." Maybe it's worth reaching out to Emotiv to see if we can still access those training profiles.