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

Photo exit event never fires. #21

Closed
ghost opened this issue Mar 23, 2016 · 1 comment
Closed

Photo exit event never fires. #21

ghost opened this issue Mar 23, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 23, 2016

Hi @troyth @dsteinborn @markelarizaga @mattmcneeney !

Not sure if this repo is still being maintained, but I've run into an issue.

Using the example code in "eg/photo.js" for capturing a photo, but the "exit" event never seems to fire. In fact, it seems to be stuck in some kind of loop. Note that I had to run control-C to kill the process manually.

Output:
screen shot 2016-03-23 at 00 18 51

Code:

var RaspiCam = require("../lib/raspicam");

var camera = new RaspiCam({
    mode: "photo",
    output: "./photo/image.jpg",
    encoding: "jpg",
    timeout: 0 // take the picture immediately
});

camera.on("started", function( err, timestamp ){
    console.log("photo started at " + timestamp );
});

camera.on("read", function( err, timestamp, filename ){
    console.log("photo image captured with filename: " + filename );
});

camera.on("exit", function( timestamp ){
    console.log("photo child process has exited at " + timestamp );
});

camera.start();

Notice: using Raspberry Pi 2, running Raspbian, and using official Raspberry Pi camera, with latest version of this node module Raspicam.

@alexcroox
Copy link

alexcroox commented Jul 5, 2016

I could never get exited event to fire but the following did stop the endless loop of taking photos:

camera.on("read", function(err, filename) {

    if(!err) {
        console.log('Photo taken and saved');
    } else {
        console.log('Error taking photo!');
    }

    camera.stop();
});

camera.start();

@ghost ghost closed this as completed Feb 17, 2018
This issue was closed.
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

1 participant