HCNet developers out there: I'm trying to remotely config my camera but...

BoraTSN

n3wb
Nov 23, 2021
1
0
istanbul
NET_DVR_DEVICEINFO_V30 struDeviceInfo;


char ip_address [] = "192.168.1.64";
WORD port = 8000;
char user_name [] = "admin";
char password [] = "12345abc";


printf("try to connect...\n");
/lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40);
lUserID = NET_DVR_Login_V30(ip_address, port, user_name, password, &struDeviceInfo);
if (lUserID < 0)
{
printf("Login failed, error code: %d\n", NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
printf("connection established.");

Here is my code, im getting error no 29 and can not figure out why. Can connect to camera via ip but can not connect it with script.
 
Yeah, error 29 , means , incombatible OS, I figured it out :+) , working now..

Seems not all is are supported, the lib is not compiled for them, I was testing with Alpine
 
Yeah, windows works, but I have created my project based on Linux, and not all distros are supported, works on debain for example, but not on alpine
 
Yes I tried Linux to (Ubuntu) and it didn't work but here was the error code 41. Wireshark said that no data was transmitted for login.
 
No, but I will work with it privatly if I find time for this.
For this issue I want to read the temperature data from a thermal camera and log them.
 
Ah ok, my project was for Home Assistant users, for video intercom, to capture call events, alarm events, open door, ...
 
We switched from SDK to ISAPI, its way easier and less messy.With isapi you cant get OS problems, as you use http requests which work on every OS there is.
 
Yeah, I know, but I don't like polling :-)

And SDK can do more that Isapi, not all devices have port 80 open, especially for alarm systems or indoor devices
 
Well if you look at 2022+ date devices, i dont see a single one without isapi(might be really few like DS-k2804). Plus with ISAPI u get to have ISUP which is way better than having arming on device(unstable af).

You open port on server not on each individual device.
 
Yeah, but we shared project as open source for home assistant or openhab or others, and we wanted to be compatible with all devices also older....


Also newer indoor devices for intercom , 2023 + do still have port 80 closed, only way is to use 8000 to capture events for tamper/gas/water leak...
 
Ok now I'm confused... I'm a beginner in this topic maybe you could help me...
When I said SDK I ment the SDK from HikVision (SDK) . I thought the communication runs over the ISAPI there. For the communication is Port 8000 used.
What do you mean with ISAPI and SDK and where is the different?
 
Well, sdk have some part of isapi not all of it is isapi requests.

Doing everything with SDK is heavily relying on SDK version which does change aswell arming on device.
Arming have 1 fault and that is if network is not ideal. When connection is interrupted in small timeline, you wont be able to get arming up again due to devices still having "arming" status in their buffer. And in order to use logout, you would need to arm first, but you are not armed even tho device think it is.

Isapi is different, it does not require ideal network enviroment , work with post/get/put requests and you get xml/json data.

I think its way better than working with byte arrays.

SDK is limited to some OS's which makes harder to find cheap servers to be reliable with .net app/script. While using purely ISAPI over 80, i believe any language can do it and OS.

Tell me which stuff you cant do via ISAPI requests which u can do with SDK. There might be some, but hikvision is going in direction of requests rather than SDK.

Also to mention, new access control devices dont even support sdk arming anymore, and its all switchinbg toward ISUP/isapi requests.
 
Isapi is sending request over http 80, nothing needed...
SDK is used for sending request over port 8000, SDK LIB needed from Hikvision
 
  • Like
Reactions: trempa92