Failed to initialize the device
See original GitHub issueHello,
I got this:
Failed to initialize the device: Error: Networ Error: socket hang up at services.media.getProfiles (node_modules\node-onvif\lib\modules\device.js:464:12) at promise.then.catch (node_modules\node-onvif\lib\modules\service-media.js:392:4) at<anonymous>
I try to launch example of Create OnvifDevice object:
'const onvif = require(‘node-onvif’); // Create an OnvifDevice object let device = new onvif.OnvifDevice({ xaddr: ‘http://IP:PORT/onvif/device_service’, user : ‘xxxx’, pass : ‘xxxx’ });
// Initialize the OnvifDevice object device.init().then((info) => { // Show the detailed information of the device. console.log(JSON.stringify(info, null, ’ ‘)); }).catch((error) => { console.error(error); });’
It gives me this error when I try to launch it on Windows Server 2012, but when I launch it on my pc (Win 10), it works fine. I tried to turn off firewall, make in and outbound rules, with no success. The camera has public is behind router and has forwarded ports. Any help is appreciated.
EDIT So it turned out, that it doesn’t work on my local pc either. It was connecting to my LAN IP cam, even though I typed IP address of public IP camera. EDIT2 It is getting stranger, and stranger. When I my local IP cam connected to router, the app can connect both to local, and public IP cam (I can tell by Hardware ID), but when I disconnect local IP camera, it suddenly can’t connect to public camera. When I try snapshot app and type public IP it gets snapshot…from local IP camera.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (1 by maintainers)
Normally this happens when the clock in your client and camera differs more than 5 secs. I’ve noticed that in my camera, and solved it by either syncing both camera and client to same NTP or disable the function of “replay attack protection” in the axis camera.
@davidgatti Thank you for your advice. I’ll try to check the code this weekend.