ColorVu and coyote

rdagger

Getting the hang of it
Joined
Oct 14, 2016
Messages
76
Reaction score
32
I have a Hikvision ColorVu DS-2CD3348G2-LISU and a coyote that's been chewing up the drip irrigation system on my green roof. I'm using Blue Iris with Code Project AI and would like to trigger the camera's dual white LEDs only when a coyote is detected by the AI.

I've successfully configured the AI to detect coyotes, but I'm struggling with the next step. Is there an alert command that Blue Iris can send to turn on the dual white LEDs on the camera?

I've tried using the camera's smart LED settings, but I haven't been able to get it dialed in correctly. The LED either doesn't come on at all or flashes on and off throughout the night. Additionally, the camera's built-in AI only supports detection for people and vehicles.

Any advice or suggestions would be greatly appreciated!
 

rdagger

Getting the hang of it
Joined
Oct 14, 2016
Messages
76
Reaction score
32
Thanks that's helpful! I'll have to read through the PDF's. The curl commands don't work. I inserted the correct IP address and credentials but it gives me an error message:

<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
Maybe something has to be modified in the camera's configuration, or it could be because I'm running the latest firmware which has changed substantially from previous versions.
 

rdagger

Getting the hang of it
Joined
Oct 14, 2016
Messages
76
Reaction score
32
I encountered the error message mentioned above after following the instructions in the linked post. I copied and pasted the curl command, then replaced the camera IP address with the correct one and updated the --digest -u switch with my actual camera username and password.

Code:
curl.exe -k --silent -H "Content-Type:application/xml" -X PUT -d "<SupplementLight><supplementLightMode>colorVuWhiteLight</supplementLightMode><mixedLightBrightnessRegulatMode>auto</mixedLightBrightnessRegulatMode><whiteLightBrightness>50</whiteLightBrightness></SupplementLight>" http://<YOUR_CAM_IP>/ISAPI/Image/channels/1/supplementLight --digest -u <USERNAME>:<PASSWORD>
 

trempa92

Getting comfortable
Joined
Mar 26, 2020
Messages
952
Reaction score
306
Location
Croatia,Zagreb
try to use --digest at the start

In order to test whats wrong, download postman and copy paste URL + Body and put digest auth info. If it works over postman, there's something wrong with curl
 

trempa92

Getting comfortable
Joined
Mar 26, 2020
Messages
952
Reaction score
306
Location
Croatia,Zagreb
This is how i do digest in C#


Code:
CredentialCache credentialCache = new CredentialCache();
credentialCache.Add(new Uri(url), "Digest", new NetworkCredential(username, password));

using var httpClientHandler = new HttpClientHandler
{
    Credentials = credentialCache
};

using var httpClient = new HttpClient(httpClientHandler);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

var response = await httpClient.PostAsync(url, new StringContent(jsonBody, Encoding.UTF8, "application/json"));
 

rdagger

Getting the hang of it
Joined
Oct 14, 2016
Messages
76
Reaction score
32
I figured it out. My auth problem was due to running the curl command from Linux subsystem in windows. I switched to powershell and it works.

I used the following command to ascertain the correct node and parameter syntax.
Code:
curl.exe -i --digest -u admin:mypassword -X GET http://192.168.1.68/ISAPI/Image/Channels/1/SupplementLight
I would manually set different setting combinations using the web GUI and then use the above command to see how the parameters changed.

This works to turn on the white LED light at full brightness the following works:
Code:
curl.exe -i --digest -u admin:mypassword -X PUT -d '<SupplementLight><supplementLightMode>colorVuWhiteLight</supplementLightMode><mixedLightBrightnessRegulatMode>auto</mixedLightBrightnessRegulatMode><whiteLightBrightness>100</whiteLightBrightness></SupplementLight>' http://192.168.1.68/ISAPI/Image/Channels/1/SupplementLight
This works to switch from the white led to the IR led:
Code:
curl.exe -i --digest -u admin:mypassword -X PUT -d '<SupplementLight><supplementLightMode>irLight</supplementLightMode><irLightBrightness>100</irLightBrightness><mixedLightBrightnessRegulatMode>auto</mixedLightBrightnessRegulatMode></SupplementLight>' http://192.168.1.68/ISAPI/Image/Channels/1/SupplementLight
This turns the supplemental lighting off:
Code:
curl.exe -i --digest -u admin:mypassword -X PUT -d '<SupplementLight><supplementLightMode>close</supplementLightMode><mixedLightBrightnessRegulatMode>auto</mixedLightBrightnessRegulatMode></SupplementLight>' http://192.168.1.68/ISAPI/Image/Channels/1/SupplementLight
 
Top