npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sony-camera

v0.0.6

Published

Wifi control for Sony Alpha cameras

Downloads

8

Readme

SonyCamera

Originally forked from https://github.com/eqot/RemoteCamera

Rebuilt as a library with event support.

Installation

npm install sony-camera

Or, for development and using the demo app:

git clone https://github.com/timelapseplus/node-sony-camera.git
cd node-sony-camera
npm install

Usage

var SonyCamera = require('sony-camera');

var cam = new SonyCamera();

cam.on('update', function(param, data) {
	console.log("updated: " + param  + " = " + data.current);
});

cam.connect(); // puts the camera in remote mode and starts monitoring events

Properties

cam.params

Contains a list of parameters available. Example:

cam.params: 
 { cameraFunction: { current: 'Remote Shooting', available: [Object] },
   postviewImageSize: { current: '2M', available: [Object] },
   shootMode: { current: 'still', available: [Object] },
   exposureMode: { current: 'Manual', available: [] },
   flashMode: { current: 'on', available: [] },
   focusMode: { current: 'MF', available: [Object] },
   isoSpeedRate: { current: '1250', available: [Object] },
   shutterSpeed: { current: '1/60', available: [Object] },
   fNumber: { current: '5.6', available: [Object] }
 }

Methods

cam.connect(callback)

Puts the camera in remote control mode and starts monitoring events. Required before calling any other methods.

cam.disconnect(callback)

Disables remote control mode and stops monitoring events. After disconnecting, cam.connect() will have to be called before any other methods.

cam.set(param, value, callback)

Sets a parameter. Check the cam.params property to find available options. The (optional) callback has an error argument.

// example
cam.set('fNumber', '5.6');

cam.capture([multipleCallback,] callback)

Takes a picture. If set, optional multipleCallback boolean argument, causes the callback to be called twice -- once when the capture is complete (includes image name), and again when the image is downloaded. If there is an error, the callback is not called again.

// example
cam.capture(true, function(err, name, imageData) {
	if(err) {
		console.log("error: ", err);
	}
	if(image) {
		console.log("received image buffer for " + name + " with a length of " + imageData.length + "bytes");
	} else if(name) {
		console.log("capture complete: " + name);
	}
});

cam.startViewfinder(callback)

Starts streaming liveview, firing the "liveviewJpeg" event repeatedly for each liveview frame until cam.stopViewfinder() is called.

cam.stopViewfinder(callback)

Stops streaming liveview, disabling the "liveviewJpeg" event.

Events

cam.on('update', function(param, data))

Fired whenever a parameter on the camera changes. The data object has two properties: data.current (the current value), and data.available, an array of possible options.

cam.on('liveviewJpeg', function(jpegBuffer))

Fired repeatedly when liveview is enabled. Returns a buffer with the jpeg data for the current frame.

Demo

alt text

The included demo is a lightweight app to show the basic features, allowing interaction with the camera in realtime with liveview and live-updating parameters.

1. Setup:

cd node-sony-camera/demo
npm install

2. Connect computer wifi to camera

On the camera, go to Menu->Appication->Smart Remote Control to enable remote wifi mode, then connect the computer to the wifi network shown on the camera screen.

3. Start demo app

node ./server.js

4. Open http://localhost:3000/

License

Copyright © 2013-2014 Ikuo Terado, 2017 Elijah Parker. Released under the MIT license.