troyth / node-raspicam

A Node.js-based controller module for the Raspberry Pi camera based on a command structure similar to Johnny-Five
MIT License
323 stars 70 forks source link

Not getting photo #32

Open ScottChapman opened 7 years ago

ScottChapman commented 7 years ago

Here is my code. I've tried being specific about path to file, pausing between start/stop. Not seeing all the events get fired. It does give me the command it is going to run, which when I run in CLI I get the image I want:

var Raspicam = require('raspicam');

var camera = new Raspicam({
    mode: "photo", 
    verbose: true,
    timeout: 0,
    output: "/home/pi/Camera/picture.jpg"
});

camera.start();
console.log("about to wait...");
setTimeout(function() {
    console.log("done waiting");
    camera.stop();
}, 10000);

camera.on("read", function(err,timestamp,filename) {
    console.dir(err);
    console.dir(timestamp);
    console.log(filename);
});

camera.on("start", function() {
    console.log("Started!");
});

camera.on("exit", function() {
    console.log("Done!");
});
rajivvishwa commented 7 years ago

I'm facing the same issue. Code is same except for the path. Did you manage to resolve it?

unknowndomain commented 7 years ago

Have you folks enabled the camera from raspi-config?

mskogly commented 7 years ago

My rpi camera module is enabled. This is the output when running my script. No errors as far as I can see, but no file showing up in the folder. Any tips?

calling.... /opt/vc/bin/raspistill --verbose --output /home/pi/Pictures/hei.jpg --width 640 --height 480 stderr: raspistill Camera App v1.3.8

Width 640, Height 480, quality 85, filename /home/pi/Pictures/hei.jpg Time delay 5000, Raw no Thumbnail enabled Yes, width 64, height 48, quality 35 Link to latest frame enabled no Full resolution preview No Capture method : Single capture

Preview Yes, Full screen Yes Preview window 0,0,1024,768 Opacity 255 Sharpness 0, Contrast 0, Brightness 50 Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0 Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none' Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128 Rotation 0, hflip No, vflip No ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000

[1] Done leafpad index.js (wd: ~/node_programs/liveStreaming) (wd now: ~/node_programs/raspicam) [2]- Done leafpad index.html (wd: ~/node_programs/liveStreaming) (wd now: ~/node_programs/raspicam)

unknowndomain commented 7 years ago

It doesn't appear to be saving, maybe the output folder isn't writable?