Node Foscam Client
Node client sdk for current HD foscam cameras that stream H.264 like the FI9821W, FI9831P, etc..
This is an early release and is not a fully functional SDK. Please open tickets and submit pull request as bugs are found. Until a 1.0.0 release, all 0.x.0 releases are considered major and may contain breaking changes, see CHANGELOG.md for release details.
Example Usage
Install using npm: npm install foscam-client
var Foscam = require('foscam-client'); var camera = new Foscam({ username: 'my-username', password: 'bad-password1', host: '192.168.0.50', port: 88, // default protocol: 'http', // default rejectUnauthorizedCerts: true // default}); // Get saved presets on the cameravar getPointList = camera.getPTZPresetPointList(); // Once the presets are received - print the list to the console and move to the 3rd saved presetvar gotoPresetPoint = getPointList.then(function(pointList) { console.log('PTZ Point List:' + JSON.stringify(pointList)); // Note that ptzGotoPresetPoint's promise is fulfilled as soon as the command is received by the // camera. There is no way to block until the camera has finished moving to the location. return camera.ptzGotoPresetPoint(pointList.point3)}); // Once the ptzGotoPresetPoint command is finished - snap a picturevar snapPicture = gotoPresetPoint.then(function(){ return camera.snapPicture2()}); // Once the picture is snapped - do something with itsnapPicture.then(function(binaryJpg){ // do something with the binary jpg});
Docs
Docs: http://lightswitch05.github.io/foscam-client
Generate Docs: npm run docs
Development
- Install dependencies
npm install
npm install --global gulp
- Run lint and tests
gulp