Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received 0 frames @ 0fps #230

Open
Iono-9 opened this issue Mar 29, 2019 · 1 comment
Open

Received 0 frames @ 0fps #230

Iono-9 opened this issue Mar 29, 2019 · 1 comment

Comments

@Iono-9
Copy link

Iono-9 commented Mar 29, 2019

Hello, I am trying out leapjs. I have installed the Leap Motion software already and I confirmed that it worked correctly and validly from the the Diagnostic Visualizer of the Leap Motion Control Panel. I have also placed all the files from this repository into my local directory.

However, when I run node leapjs.js, all I got is these:

$ node leapjs.js

Waiting for device to connect...
received 0 frames @ 0fps
received 0 frames @ 0fps
received 0 frames @ 0fps
received 0 frames @ 0fps
...

So could you please tell me what went wrong?

Here is what inside leapjs.js:

const Leap = require('leapjs');

Leap.loop(function(frame){
  console.log(frame.hands.length);
});

var controller = new Leap.Controller()
controller.on("frame", function(frame) {
  console.log("Frame: " + frame.id + " @ " + frame.timestamp);
});

var frameCount = 0;
controller.on("frame", function(frame) {
  frameCount++;
});

setInterval(function() {
  var time = frameCount/2;
  console.log("received " + frameCount + " frames @ " + time + "fps");
  frameCount = 0;
}, 2000);

controller.on('ready', function() {
    console.log("ready");
});
controller.on('connect', function() {
    console.log("connect");
});
controller.on('disconnect', function() {
    console.log("disconnect");
});
controller.on('focus', function() {
    console.log("focus");
});
controller.on('blur', function() {
    console.log("blur");
});
controller.on('streamingStarted', function() {
    console.log("streamingStarted");
});
controller.on('streamingStopped', function() {
    console.log("streamingStopped");
});
controller.on('deviceStreaming', function() {
    console.log("deviceStreaming");
});
controller.on('deviceStopped', function() {
    console.log("deviceStopped");
});

controller.connect();
console.log("\nWaiting for device to connect...");

I am just starting out this, so any help is appreciated. My node's version is v8.12.0.

@ElectricCookie
Copy link

Check the checkbox "Allow web apps" in the settings of the leap :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants