Anybody successful getting a Hikvision to FTP images?

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
*UPDATE*
After Much hemming and hawing I confirmed that in my case 5.1.2 is just terrible software for FTP. Does not work properly at all. 5.1.6 seems to work fine.

-------------

I got my 5.1.2 turret working to an NFS (at least for now, fingers-crossed). One thing I'm thoroughly failing at is getting anything whatsoever to FTP. I want to be able to FTP images so that I have some semblance of coverage in case my PC is stolen, for example. I have checked it seems all the options, from FTP on events, to snapshots, to whatever else. My FTP server appears to be setup fine; I can access it and read and write to it from a couple of PCs on the local network. Don't believe firewall can be an issue, as i"m using the router's FTP and I can access the FTP by external IP or 192.168.1.1 from a PC, but neither of those work for the camera. I've tried saving in the root directory, the parent, the child, etc.

The lack of a "test connection" in the FTP tab is quite bothersome, but consistent with how the rest of the camera's software was written (let's say "hastily").

Would appreciate any ideas :)

EDIT: It seems in the folder I specified the camera to FTP to I have found now two files that were deposited this morning. Not sure why they went at that point in time. They were two 0 KB .jpgs time-stamped, IIRC (for some reason I deleted them). That's all I've ever seen re. ftp.
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,340
Reaction score
5,310
Location
Denver, CO
check the logs of your ftp server, perhaps the login your using does not have permission/access for creating/uploading files.
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
check the logs of your ftp server, perhaps the login your using does not have permission/access for creating/uploading files.
Unfortunately the linksys default firmware on my router (EA6200) is built to be easy to use, so there is no logging at all (contrary to reviews, though, it's really not a bad router--I've found it stable, and its on-board storage speed is much quicker than I would have thought!). I'm 99% sure, though, after multiple checking that the user/pass is good because it's working on other devices through browsers. My next effort was going to be with Filezilla's free FTP server, but I would like confirmation first that this even works from these cameras on this firmware!

EDIT: Oh, there is some very elementary logging. I just enabled it, thanks nayr (post below this one).
 
Last edited by a moderator:

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,340
Reaction score
5,310
Location
Denver, CO
ah its running from your router, probably a configuration issue of the ftpd (could be trying to use passv transfer mode when ports are not open for it)

try using the command line 'ftp' from dos window to upload a file to the path you configured with the login you used.. It may login just fine and then hang trying to upload a file.

not having server logs does not help you debug this any.. FTP uses unix path names so make sure your using proper slashes / = good; \ = bad and see if the ftpd wants a full absolute path or not.. (ie cd /srv/ftp/cameras, or cd /cameras)
 

PLGVIE

n3wb
Joined
Aug 24, 2014
Messages
3
Reaction score
0
Can't confirm for turrets or 5.1.2 but with lots of different Hiks and firmware versions from 4.something to 5.2.0 I've never had a problem with ftp (Qnap NAS as ftp server, device name as share, camera names as directories because "custom" didn't exist in 4.x fw).

HTH
Peter
 

framednlv

Getting the hang of it
Joined
Mar 17, 2014
Messages
254
Reaction score
69
Try turning off the NFS as I was unable to use both NFS and FTP at the same time on my DS-2CD3332-I.
I would also like to know if both can run at the same time.
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
I was unable to use both NFS and FTP at the same time on my DS-2CD3332-I.
I would also like to know if both can run at the same time.
For continuous record perhaps not, but under events if you have motion detection, there is a checkbox for "channel" (record to NAS) and one for FTP.

I will return to this thread hopefully shortly. I need to get that FTP server setup on my PC so I can see with verbose logging what is going on. I'm glad to hear that plgvie hasn't had issues. Hopefully it's my own failing.
 

PLGVIE

n3wb
Joined
Aug 24, 2014
Messages
3
Reaction score
0
For continuous record perhaps not, but under events if you have motion detection, there is a checkbox for "channel" (record to NAS) and one for FTP.

I will return to this thread hopefully shortly. I need to get that FTP server setup on my PC so I can see with verbose logging what is going on. I'm glad to hear that plgvie hasn't had issues. Hopefully it's my own failing.
Unfortunatly no FW 5.1.2 cam available, but got today some 5.1.6: FTP to another Qnap-NAS over site2site OpenVPN again without any issues!

Kind rgds
Peter
 

mqranch

n3wb
Joined
Apr 11, 2014
Messages
18
Reaction score
0
If it's any help, I've had exactly the same issue for the past week and finally resolved it by ticking the Enable Event-Triggered Snapshot box under ADVANCED CONFIGURATION > STORAGE > SNAPSHOT TAB (which is NOT what it describes in the manual). However, once the camera started uploading snapshots, it put all of them in the root directory under various names and numbers and would not put them into the public_html directory where I wanted them. The only way that could happen was to download the updated firmware which finally gave me a 'custom' button allowing me to designate the directory I wanted to put the snapshots into. That works but now I find out that this camera will not allow me to overwrite or replace name which means I have a crapload of images uploading to my FTP. I want each image to upload under the same name so that it is replaced every so minutes by the the image that follows it which would make setting up a webpage for the camera (to be used as a weather/tourism camera) reasonably simple. That's actually why I'm in this forum is that I am hoping someone here knows how I can get around the problem.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,340
Reaction score
5,310
Location
Denver, CO
does this ftp server run a shell? you could setup a script on a timer to cleanup the files.
 

mqranch

n3wb
Joined
Apr 11, 2014
Messages
18
Reaction score
0
I don't know but it sounds like a great idea. Where would I find the information about doing that?

Thx
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
I don't know but it sounds like a great idea. Where would I find the information about doing that?

Thx
What is your FTP Server? If you were running one on, say, a Windows PC, you could create a powershell script, so even if you don't know how to create one you could google something like "script rename files with overwrite". Regardless of platform your goal would then be to have this script run on regular intervals (windows scheduler can do that, for example), like every minute, and it just runs through an entire directory of files and renames each file to a particular name, overwriting the previous with the same. Then it gets to the next file and does the same. This way it's basically removing all files in a directory except for one, which will end up with the same name, because when it overwrites a file it's actually just deleting it. Such a script could handle one file or a thousand, it wouldn't matter; you'd just end up with a single of the name you want.
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
You might have to alter one a bit. Depending on your technical knowledge you could borrow ideas from different spots and combine or, if you're desperate, find the script that's close to what you want and then beg somebody on stackexchange.com to finish it up exactly to your needs!
 

mqranch

n3wb
Joined
Apr 11, 2014
Messages
18
Reaction score
0
Since I have zero knowledge in that regard, I'll have to find a script. It's why I told the salesman at Nelly's Security when I was looking at the 2632 Hikvision specifically what I wanted the camera for and what I wanted it to do, so that the camera would have the software I needed to do the job without having to find scripts or other software. He assured me the camera would do what I wanted it to. Obviously he misrepresented to me the ability of the camera to do that and I now either have to find a work around or send the camera back for a refund. Not easy when I'm in Canada. But thank you for your help. I'll see how easy it is to find a script.
The Tech guy at Nelly's Security gave me the following but it doesn't look like it will clean up the images nor does it look like it does overwrite/replace. In fact, I'm not even sure how to use it.


(Nelly's Security)
Sep 25 10:12 AM
There isn't. However, I asked our web guy and he mentioned a php script which is listed below.
<?php
$dirname = "images/"; // file path to the image directory
$images = glob($dirname."*.jpg"); // this grabs everything with a .jpg extension
foreach($images as $image) {
echo '<img src="'.$image.'" /><br />'; // this is the html output to display each image
}
?>
Reference: http://stackoverflow.com/questions/11903289/pull-all-images-from-a-specified-directory-and-then-display-them
Ryan O'Daniel
Nelly's Security
Direct: 918-532-6522
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
Okay, I finally got Filezilla FTP on there and it has a lot of logging. I also got 5.1.6 on a camera and it has a test FTP feature, which sends a file to the expected directory. I have had two cameras FTP very, very intermittently and unpredictably (a few files/hour in one case). For the most part my cameras just don't want to FTP despite trying a multitude of different settings combinations to encourage them to. The fact that some files are coming through tells me it's configured properly.

The filezilla log is hardly ever showing anything and since I know now the server is definitely setup properly, I gotta put the blame back to the cams.

EDIT: Also, the images are all 640X480, not the megapixel in the dropdown.

Well this is interesting, I found on one of my cams there are FTP images corresponding with breaks in the continuous timeline. Normally it's perfect, but a few times it broke last night as these happened. One such event was at 11:00 PM. Sometimes the ivs 4500 smart app crashes my camera, and it did crash it last night, but when the camera came up it ftped around 8 images--then it did not FTP anymore.
 
Last edited by a moderator:

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
Okay, I am determined like all to get out to get this to work, just on principle now. Can anybody check their settings against this? Although this is 5.1.2 firmware for the example below, I'm having the same problem on 5.1.6 and on 5.1.6 I was able to use the test feature to successfully send a file to the FTP server, so I know the server is setup right. Here's what I have going this very moment. As you can see, the timeline is capturing events and working properly.

FTP Setup to parent directory using device name and the folder does exist, all is good there.

Oh, and timing snapshots absolutely do not work, either. If I go to playback and look for them, nothing is returned on any camera, ever. I seem to be the only person on the internet with this problem, but as you can tell I've diligently attacked it from many angles.

UPDATE: Progress. I figured out what is causing the occasional 640X480 images only! When I have image snapshots (I know this isn't FTP, but bear with me--because FTP and snapshots seem to be work at the same time) enabled AND I view the substream ONLY then do images save--and they do so in 640X480 according to the snapshot settings on the 4 second interval, but with the substream's lower 640X480 resolution (not the megapixel set in the snapshot's dropdown). Furthermore, the camera has a very high tendency to crash shortly after viewing this substream with images turned on, but I do manage to get some in the time line. So in conclusion it appears that images only save while a stream (substream specifically) is being viewed.

I wonder if others using FTP are simply not using its built in storage (either SD or network based) and maybe that is why FTP is working better. I haven't explored that yet because it makes the camera useless unless you're using a separate NVR.


EDIT: Giving up on this for now. I think it's a waste of effort; going to use the camera's ability to allow retrieval of an image by URL (thread over at a different forum) and I'll write some bit of code if I can't find it to intermittently pull images off the camera directly. The more I learn about IP cameras in this price range the more I think I should see them as just a "dumb camera" and use their onboard software as little as possible, just like most other people who use NVR software of some sort.

9/29/2014 21:23 update

I don't want to keep bumping this thread, so I'll just update this post for the most part. Yesterday, post #15, mqranch asked a question re. his FTP issue. I think I have a potentially easier solution, and it's using the ability of the camera to grab an image from a URL. It relies upon some of the teachings in this thread: http://www.cctvforum.com/viewtopic.php?f=19&t=35960.

mqranch, you're trying to get the FTP images off the camera and rename them to a single image that you're hosting on a local web site. That will work, but frankly if you're using the URL approach there is a much easier way to do it. The following is a powershell script I have confirmed works. This is on windows, if you have some other OS I've no clue :) To use Powershell in windows you can install it if it's not already there, then you run a powershell window--it's like the cmd window you may have seen, but jacked up! So this should work for you:

1) Create a file called SAVEIMAGE.ps1 in C:\IMAGEDUMP and put exactly this into it--just three lines:


$url = "http://192.168.1.131/onvif/snapshot/snapshot.jpg"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, "C:\IMAGEDUMP\snapshot.jpg")

2) Now when you run this script the camera's main stream image will be pulled and overwrite the existing version of snapshot.jpg. So how to run the powershell script manually, once you have powershell installed and you've loaded the window (possibly need to right-click it and run as administrator:

2.a) cd c:\imagedump
2.b) .\SAVEIMAGE.ps1

That should do it. If powershell complains about not having permissions, run this command:
set-executionpolicy remotesigned

and try again. If still not working, and you're on a 64 bit system, you may have two executables for powershell, so you may need to try the other powershell run time.

3) If you've gotten this far, now you're wondering how to have this kick off every 10 seconds or whatever. Simplest is to use windows scheduler. Look up online how to create that, but the command will be something like this:
powershell -file c:\IMAGEDUMP\SAVEIMAGE.ps1 -WindowStyle Hidden

If this thing pops up each time it runs, which is of course annoying, create a separate windows account and you can associate that account with just this script. Since you won't be logged in with that account, you won't see the pop ups.

Or you can use some of the above with the FTP approach to create a different powershell script that renames the FTPs if you have some problem pulling the url off the camera.
 

Attachments

Last edited by a moderator:

mqranch

n3wb
Joined
Apr 11, 2014
Messages
18
Reaction score
0
Holy cow! Okay, I've got a bunch of stuff I'm behind on but as soon as I get a chance I'll work on your suggestion above and see what happens.....

Thank you very much for going to these lengths. I just got a message from the Nelly's Security techie that says pretty much "Too bad, so sad, can't take the camera back, can't resell it... etc., etc." which is not particularly helpful.
 

LittleBrother

Pulling my weight
Joined
Sep 16, 2014
Messages
479
Reaction score
115
Holy cow! Okay, I've got a bunch of stuff I'm behind on but as soon as I get a chance I'll work on your suggestion above and see what happens.....

Thank you very much for going to these lengths. I just got a message from the Nelly's Security techie that says pretty much "Too bad, so sad, can't take the camera back, can't resell it... etc., etc." which is not particularly helpful.
Good luck--I should clarify, with windows scheduler ever one minute is the best you can do unless you make multiple processes and stagger them. I need something that runs more often and date stamps so I built a small app to do that but you shouldn't need any of that.
 

woozie

n3wb
Joined
Nov 17, 2014
Messages
4
Reaction score
0
Anyone have this working with the DS-2CD2432F-IW on the latest firmware?
I'm trying to ftp to my synology nas, it won't allow upload to the root so I set it as custom and typed in home. But nothing is uploading there.
I can see the test files, I have enabled trigger snapshot and linked the ftp upload, but nothing.
The logs are not even showing a ftp connection other than the test connection.

Any help?
 
Top