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

Error: Network Error: socket hang up #39

Open
jlegall56 opened this issue Sep 9, 2018 · 2 comments
Open

Error: Network Error: socket hang up #39

jlegall56 opened this issue Sep 9, 2018 · 2 comments

Comments

@jlegall56
Copy link

Hello,
I want tu use your code with a sricam camera.

When I test the code for use preset or 'homeposition', I have an error :

The code :

// Create an OnvifDevice object
let device = new onvif.OnvifDevice({
  xaddr: 'http://x.x.x.x/onvif/device_service',
  user : 'user',
  pass : 'password'
});

// Initialize the OnvifDevice object
device.init().then(() => {
  console.log("Connect");
  // The OnvifServicePtz object
  let ptz = device.services.ptz;
  if(!ptz) {
    throw new Error('Your ONVIF network camera does not support the PTZ service.');
  }
  // The parameters for the gotoHomePosition() method
  let profile = device.getCurrentProfile();
  let params = {
    'ProfileToken': profile['token'],
    'Speed'       : 1
  };
  // Send the GotoHomePosition command using the gotoHomePosition() method
  return ptz.gotoHomePosition(params);
}).then((result) => {
  console.log(JSON.stringify(result.data, null, '  '));
}).catch((error) => {
  console.log("> error");
  console.error(error);
});

The response :

$ node preset_test.js  2
myArgs:  [ '2' ]
Connect
> error
Error: Network Error: socket hang up
    at ClientRequest.req.on (/home/user/node_modules/node-onvif/lib/modules/soap.js:168:11)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketOnEnd (_http_client.js:425:9)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Thanks for your help.
Julien
(from France)

@joaquinseco
Copy link

Same issue for me also with sricam cameras using the method "gotoPreset". I get the init and profile ok. Any solution?
Thank you very much

@emanueletoffolon
Copy link

emanueletoffolon commented Oct 25, 2018

Same issue for me also with sricam cameras using the method "gotoPreset". I get the init and profile ok. Any solution?
Thank you very much

Same issue for me also.
Thanks

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

3 participants