Jump to content
graphite

CIFS-based storage for HikVision camera

Recommended Posts

Hi everyone,

 

I have a HikVision DS-2CD2010-I (Firmware Version V5.2.0 build 140721) camera and I'm trying to set up video recording to a network storage. I have a Linux machine and I've set up a Samba server there. I can connect to it, create and delete files both from Windows and cli smbclient. I've also attached it to the camera and can see it within "Storage" tab, but it always stays as "Uninitialized". I tried to format the drive from camera UI, it fades for ~5 seconds, says complete and then returns to uninitialized state. After that, there is no new files on the server created, but everything that was there is gone, so camera indeed can access the share and delete files.

 

Another weird thing is that the camera reports 0.00GB of free space, but correctly displays total capacity. I've checked with smbclient and dir that capacity and free space are reported correctly by Samba server. I've seen some discussions at CCTV suggesting to set a particular quota for the share, but I'm not aware if it is at all possible with Samba on Linux.

 

Did anyone face this issue? Any suggestions to try? Any alternatives to consider? I have also an FTP server at the same machine and it works fine, but the camera seems only can upload images over FTP, not videos

Share this post


Link to post
Share on other sites

It's amazing how many people have this issue, as have I. Hikvision must be underestimating how many people are using this feature for them not to have fixed this, or at least published a correct guide.

 

I successfully got mine setup using SMB/CIFS setting on the camera to my Qnap NAS. I had a similar error scenario to what you report, until I added a quota to the Hikvision user I had created on my NAS. Then it worked. I've no idea how or if you can set per-user quotas on Linux. Perhaps you can try setting a quota or max size on the share/disk you're pointing the camera to? I would have tried that first, but QNAP only allow per-user/group quotas and not per-share.

 

 

My post in another thread about this issue:

I was able to get my DS-2CD2432F-IW setup and working nicely with my Qnap NAS, using SMB. I initially tried SMB and then NFS, failing at both attempts. I was repeatedly formatting the share/directory, but then immediately having the camera tell me it was "uninitialized," as many have reported.

 

The trick to get it working (I think) was to

 

- create a user account just for the camera on my NAS

- then set the quota for that user to 300gb

 

The specific number probably doesn't matter; I picked it because I saw some mention of hikvisions having trouble with NAS drives over 500 gb. It seems that the failures are due to the camera either seeing too big of a "drive" (in this case all 1.5 terabytes of my NAS) --which seems unlikely-- or because the camera looked at the share/drive and couldn't get any value for free space, only total space...or something like that. After setting the quota to 300gb, that value showed up right away as the disk size in the Hikvision setup screen.

Share this post


Link to post
Share on other sites

Sure, I've seen your post. I've just set a filesystem's quota and checked that it is actually enforced. Unfortunately, it didn't help.

On the other side, my problem is not related to a too large disk as it is definitely not the case. Can anyone try to play with quota/partition size and check which is the smallest one when camera still works? I failed to find any information from user manual.

Share this post


Link to post
Share on other sites

How small do you want me to try?

Note that I'm limiting the size in my setup with a user quota (on the NAS), not a share/drive/parition quota. The camera seems to interpret that as a disk size, though, so maybe it doesn't matter.

Share this post


Link to post
Share on other sites

I guess it is trying to be smart and use min(user_quota, free_space) as a free space, so changing quota may do the trick. Could you try to start with 5GB and check if it formats successfully? If doesn't - double the quota and so on (5GB, 10GB, 20GB, 40GB).

Up to now we already know that 500Gb seems to be too much and 300Gb works fine, so I want to find out a lower boundary.

Thank you very much for your help.

Share this post


Link to post
Share on other sites
I guess it is trying to be smart and use min(user_quota, free_space) as a free space, so changing quota may do the trick. Could you try to start with 5GB and check if it formats successfully? If doesn't - double the quota and so on (5GB, 10GB, 20GB, 40GB).

Up to now we already know that 500Gb seems to be too much and 300Gb works fine, so I want to find out a lower boundary.

Thank you very much for your help.

 

5gb: Failed; reported completion of format instantly, but status "uninitialized"; used 732mb of quota used

10gb: Success; format took at least 20 minutes; somewhere around 780mb of quota

550gb: Success; format took more than an hour; perhaps 1gb used (tough to say because the camera started recording once finished)

 

It is possible 5gb would have worked and it was just a temporary network error causing the failure. But I did try it several times. Something to note: when returning to the "Nas" settings tab and 'testing' the directory and user/password --which I did each time I changed the quota size, just in case-- each time the test failed; I had to reenter the password for it to work. I don't think it actually lost authentication to the NAS, but rather it is just a bug/feature causing the password to need to be reentered once you click to edit the NAS directory settings.

 

EDIT: I tested a user quota of 550gb and it was successful.

 

Details

NAS: Qnap TS-212p; up to date firmware as of Jan 2015

Camera: Hikvision DS-2CD2432F; Firmare: 5.2.3; SMB/CIFS selected as NAS method

Edited by Guest

Share this post


Link to post
Share on other sites

Yay! Now it works!

 

I use one of those cloud computing providers to backup video remotely. It is a bit expensive if I use too much of HDD, so I needed to know minimal CIFS share size before upgrading to another package. As I only write video on motion and it is a camera directed to an entrance door of the apartment, there will be around 300-500Mb per day, which means I can keep around 2 weeks of video with a 10Gb share - this is even more than I would like to have.

 

In my install I have a CIFS share at Linux server in a virtual filesystem with a capacity of ~10Gb (I started with ~5Gb and it didn't work). Now everything worked smoothly, during format it set up 27 containers and transferred around 70Mb to a server (I didn't even need to set a quota now). Then I triggered a motion detection and got a video immediately. So far it works great and I can still stay with a cheapest instance, which costs $5/month (and which I still use for other small projects).

 

To summarize: the smallest network storage this camera can use is ~10Gb, keep that in mind.

Share this post


Link to post
Share on other sites
Yay! Now it works!

 

I use one of those cloud computing providers to backup video remotely. It is a bit expensive if I use too much of HDD, so I needed to know minimal CIFS share size before upgrading to another package. As I only write video on motion and it is a camera directed to an entrance door of the apartment, there will be around 300-500Mb per day, which means I can keep around 2 weeks of video with a 10Gb share - this is even more than I would like to have.

 

In my install I have a CIFS share at Linux server in a virtual filesystem with a capacity of ~10Gb (I started with ~5Gb and it didn't work). Now everything worked smoothly, during format it set up 27 containers and transferred around 70Mb to a server (I didn't even need to set a quota now). Then I triggered a motion detection and got a video immediately. So far it works great and I can still stay with a cheapest instance, which costs $5/month (and which I still use for other small projects).

 

To summarize: the smallest network storage this camera can use is ~10Gb, keep that in mind.

 

That's not a bad price and solution at all. I suppose the main downside is no internet = no footage. Too bad these cameras can't write to onboard SD and NAS simultaneously. Although you are now protected from a worst-case-scenario, like someone stealing all the equipment or burning down the place. Seems like a fair trade off.

 

It's interesting mine showed almost a gigabyte of quota usage in formatting, with yours using a tenth of that. It makes me wonder if I simply read the units wrong...although I'm not sure how that would have happened. In any case a gig is a lot of overhead on a 10gb drive. I'm glad yours didn't take up that much on the cloud server.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×