question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to initialize the device

See original GitHub issue

Hello,

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:open
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
neonmuracommented, Jul 9, 2019

Error: Failed to initialize the device: Error: 400 Bad Request - Sender not Authorized at services.device.getDeviceInformation (C:\Users\tutor\Desktop\RTSP-STREAM\node_modules\node-onvif\lib\modules\device.js:453:12) at promise.then.catch (C:\Users\tutor\Desktop\RTSP-STREAM\node_modules\node-onvif\lib\modules\service-device.js:853:4) at process._tickCallback (internal/process/next_tick.js:68:7)

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.

1reaction
futomicommented, Apr 18, 2018

@davidgatti Thank you for your advice. I’ll try to check the code this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to initialize device (7) in Mi Home App : r/Aqara
The reason for the error is usually when your device has been added to a server that it wasn't designed for. So if...
Read more >
[Solved] Code 37: Windows cannot initialize the device ...
Method 1: Scan for hardware changes in Device Manager​​ 3) Click Scan for hardware changes in the Action section. Windows should then reinstall ......
Read more >
mi home failed to initialize device (3) - How to fix
try to reinstall the app. try to reboot the GateWay. check that the device is running (reset power on it = reboot) try...
Read more >
Windows cannot initialize the device driver for this ...
To perform this operation, open Device Manager. Next, identify the device driver that is creating issues. Select Uninstall device option. Unplug ...
Read more >
Why do I get "Failed to initialize video device" when using ...
The "Failed to initialize video device" error message is usually related to the DirectX driver or display driver, and only happens on the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found