Pelco Developer Network (PDN)

There was an error communicating to the device

Taken from March 8 post on forum topic here: Pelco SDK SampleCode ViewVideo Error

There was an error communicating to the device

I was trying to connect to the Pelco ip camera via SDK using C++. But the login step says it failed. I checked the returned code, which is "7", that refers to "There was an error communicating to the device" in the sdk header file. However, I can get live streams with the same ip and credentials using web browser. What could be the problem?
Thank you.

Hello there - thank you for your post and I'm sorry to hear that you are having some problems.

First, I must make sure that you understand that Pelco SDK is no longer under active development or support. I will help you out to answer your questions, but we do not recommend writing any new development efforts using Pelco SDK.

If you are writing a solution to communicate directly to a Pelco camera, we suggest using ONVIF. If you're writing a solution that involves a Pelco VMS, then it should be VideoXpert and you can make use of the VX SDK.

If you are trying to use the older Pelco SDK to communicate to a camera, it must first communicate to the Manager of the VMS. This was because originally during the design of those tools -- Pelco SDK -- with Endura, initial requests went to the Endura System Manager to obtain information about the cameras that were registered to the VMS. If you're trying to communicate to a camera, typically the first requests will go to the Manager (Endura), or VX Core (VideoXpert). It later and more recent versions of VideoXpert, the Pelco SDK can no longer communicate with and/or authenticate with the VX Core, leading to errors about communication problems. If you are using a VX VMS and trying to use Pelco SDK, this could be what the problem is.

I'm glad that you can communicate with the camera's web GUI properly; that does help to indicate that basic network TCP connections should be possible. Hopefully information in my response here will help provide you with direction.

Thank you very much for you response.
When I said SDK, I actually meant VideoXpert that I was using, since you clearly mentioned on your website that the Pelco SDK was out-of-date and will no longer be updated.
So, does that mean I have to move on to ONVIF, or is there still a way to communicate with the camera using VideoXpert? I'm using the latest version which is 2.1 for VS2015.

Oh, good, I'm glad to hear that you are working with the VideoXpert SDK -- thank you for that clarification.

One thing I wasn't quite clear on from your post... are you planning to write this development effort for cameras that are connected to the VideoXpert VMS platform? Or are they standalone cameras connected to another VMS using Pelco devices.

If not, and they are not going to be connected to the VideoXpert VMS... then there is no reason to use the VX SDK with them. In that case, then yes, you'll want to use ONVIF.

If you are working with a VideoXpert VMS, then using the VX SDK is the best plan. The SDK can communicate with the VX Core to obtain device information for streaming. Streaming itself is done via gstreamer in the VX SDK code Samples (not technically a part of the SDK itself) -- your choice of streaming is really up to you using the provided information from the VX SDK.

There was an issue with older versions of the VX SDK (2.0 and older) with newer versions of VideoXpert VMS (2.1 and later). There would be an authentication issue... similar to the error you saw. If you're using the newest VX SDK, as you indicated, than this shouldn't be the problem... but I felt it worth mentioning just in case.

Take a look at the logs located at "C:\ProgramData\Pelco\VxSdk\Logs" for useful information about the logging issues. If your versions are current, then it is most likely a permissions issue; either the credentials being tried aren't accurate, or the permissions for the user login aren't set up properly for what you're trying to do.

Thank you for your detailed answer.

The Pelco camera we're trying to get video from is connected to our local net and we'd like to stream from it using C++ to do further processing. We have a big project based on computer vision, and we're at the stage of choosing a proper ip camera. So the crucial part for us is to efficiently get real-time video within the code from the ip camera as simple as possible and send it to our algorithm.

The sample code we used is based on the 'Login to a VideoXpert system' section of this documentation:

The credentials we used are exactly the same as we used in our browser (the default values). If I get it right, in this case we should be able to use the above mentioned sample code to stream directly from the Pelco camera by VideoXpert SDK. But still, we get the same error. Please correct me if I misunderstood something here.

Thank you.

Thank you for your post. I think there's still some confusion as to what tools you should be using for this camera development.

If you have a VideoXpert Management System - with a VX Core PC, Gateway, Storage, etc and cameras attached to it, then you can use the VX SDK to connect to the VideoXpert Core IP address, using the VideoXpert user account credentials to log in to the VX System Core and obtain a list of devices.

It sounds like you only have Pelco cameras connected to your network, with each of their own IP addresses, and you are attempting to use the camera's web GUI credentials with the VX SDK. This will not work. The VX SDK is to communicate with the VideoXpert Core on a management system -- not to communicate to cameras on their own without VideoXpert involved.

You will want to use ONVIF for this setup. Using ONVIF will mean the best compatibility with cameras in general (not just Pelco cameras). You can find information about ONVIF at I would also recommend that you download the ONVIF Device Manager tool (aka ODM). You can use that tool, log into the cameras, and perform actions with the cameras using the application. Using Wireshark, you can then examine the network traffic for an idea of what calls the tool is making, which will help as well.