I have several cameras (all model DS-2CD2342WD-I) behind an NVR (DS-7608NI-E2 / 8P).
I am trying to figure out how I can modify some of the settings of the cameras using the API.
As an example, I am trying to figure out how I enable or disable the smart events Line Crossing .
Using a browser I can send the following command to the camera to get the current configuration of this type of smart event...
http://username:password@camera address
ort number/ISAPI/Smart/LineDetection/1
(note that the
is really "colon p")
The result of this is the following:
<LineDetection>
<id>1</id>
<enabled>true</enabled>
"); vertical-align: bottom; height: 10px;"><normalizedScreenSize>
<normalizedScreenWidth>1000</normalizedScreenWidth>
<normalizedScreenHeight>1000</normalizedScreenHeight>
</normalizedScreenSize>
"); vertical-align: bottom; height: 10px;"><LineItemList size="1">
"); vertical-align: bottom; height: 10px;"><LineItem>
<id>1</id>
<enabled>false</enabled>
<sensitivityLevel>60</sensitivityLevel>
<directionSensitivity>any</directionSensitivity>
"); vertical-align: bottom; height: 10px;"><CoordinatesList>
"); vertical-align: bottom; height: 10px;"><Coordinates>
<positionX>645</positionX>
<positionY>109</positionY>
</Coordinates>
"); vertical-align: bottom; height: 10px;"><Coordinates>
<positionX>28</positionX>
<positionY>365</positionY>
</Coordinates>
</CoordinatesList>
</LineItem>
</LineItemList>
<isSupportMultiScene>false</isSupportMultiScene>
<recogRuleType>vectorMode</recogRuleType>
</LineDetection>
However, since I want to automate the process perhaps using Python on my Raspberry pi, I need to be able to access this xml data using the curl command which I think should be as follows:
curl http://username:password@camera address
ort number/ISAPI/Smart/LineDetection/1
(note that the
is really "colon p")
Unfortunately, the response I am getting is not the same! Here is what I get...
<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
I have checked that the username and password are identical yet I am getting "Unauthorized"!
I do not believe that this should have any impact on this but I am accessing the cameras by entering the ip address of the NVR with the port assigned to the camera (Virtual Host). Because this works through the browser, I would expect that I should be able to also access the camera using a PuTTY session on my Raspberry or in a Command session on my Win10 PC... but I cannot!
Any ideas on why this is happening?
I am trying to figure out how I can modify some of the settings of the cameras using the API.
As an example, I am trying to figure out how I enable or disable the smart events Line Crossing .
Using a browser I can send the following command to the camera to get the current configuration of this type of smart event...
http://username:password@camera address

(note that the

The result of this is the following:
<LineDetection>
<id>1</id>
<enabled>true</enabled>
"); vertical-align: bottom; height: 10px;"><normalizedScreenSize>
<normalizedScreenWidth>1000</normalizedScreenWidth>
<normalizedScreenHeight>1000</normalizedScreenHeight>
</normalizedScreenSize>
"); vertical-align: bottom; height: 10px;"><LineItemList size="1">
"); vertical-align: bottom; height: 10px;"><LineItem>
<id>1</id>
<enabled>false</enabled>
<sensitivityLevel>60</sensitivityLevel>
<directionSensitivity>any</directionSensitivity>
"); vertical-align: bottom; height: 10px;"><CoordinatesList>
"); vertical-align: bottom; height: 10px;"><Coordinates>
<positionX>645</positionX>
<positionY>109</positionY>
</Coordinates>
"); vertical-align: bottom; height: 10px;"><Coordinates>
<positionX>28</positionX>
<positionY>365</positionY>
</Coordinates>
</CoordinatesList>
</LineItem>
</LineItemList>
<isSupportMultiScene>false</isSupportMultiScene>
<recogRuleType>vectorMode</recogRuleType>
</LineDetection>
However, since I want to automate the process perhaps using Python on my Raspberry pi, I need to be able to access this xml data using the curl command which I think should be as follows:
curl http://username:password@camera address

(note that the

Unfortunately, the response I am getting is not the same! Here is what I get...
<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
I have checked that the username and password are identical yet I am getting "Unauthorized"!
I do not believe that this should have any impact on this but I am accessing the cameras by entering the ip address of the NVR with the port assigned to the camera (Virtual Host). Because this works through the browser, I would expect that I should be able to also access the camera using a PuTTY session on my Raspberry or in a Command session on my Win10 PC... but I cannot!
Any ideas on why this is happening?