FTP on Huisun

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
I noticed in the web GUI that it support FTP. I know what FTP is, however, can it be set to send the recordings right after a motion recording ends? Or it used to send recording on a time inverals?

I am have a NAS drive and since Huisun doesn't support NAS yet so I am trying to think a way for it to write or send it's recordings after a motion detect to the NAS drive.

Thank you
Bill
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
i enabled FTP but it seem to do nothing

If I can't get FTP working then this cam is no good for me.

Bill
 

klasipca

Banned
Joined
Mar 27, 2014
Messages
3,146
Reaction score
750
Yeah, there seems to be looooots of bugs in the v2 firmware, I keep sending them to Monica, but sometimes I feel it just goes to black hole because I never know what they will fix. On the positive side, it's a lot better then working with Hikvision, they don't even care...
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
Yeah, there seems to be looooots of bugs in the v2 firmware, I keep sending them to Monica, but sometimes I feel it just goes to black hole because I never know what they will fix. On the positive side, it's a lot better then working with Hikvision, they don't even care...
You are right. It a sweet camera and Monica been good trying to stay on top of those bugs with engineers but I need the FTP to work.

My current cameras "Sharx" can ftp video to a storage of my choosing after a motion is detected. Then I can view the playback on any media player in any room that is linked to that storage and delete them on the fly. That why I like self-contained camera with SD cards so I don't have to fiddle with NVR or Blue Iris etc.

I was hoping to replace my existing Sharx with the Huisun cameras however so far it not looking like I will be replacing it anytime soon. I probably just sell it on here in classified at my cost and cover the shipping cost myself if I don't see a fix for the FTP anytime soon.

Huisun are great camera if you are using Blue Iris or NVR with it but it not ready to be a stand-alone camera yet.

Bill
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
can you put your ftp server into debug logging mode and see if its even hitting it?

FTP can be a quirky protocol and many times it could be a simple feature mismatch.. ie, trying to make a recursive path on a ftp server that rejects that.
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
can you put your ftp server into debug logging mode and see if its even hitting it?

FTP can be a quirky protocol and many times it could be a simple feature mismatch.. ie, trying to make a recursive path on a ftp server that rejects that.
Actually I got the FTP working, it was firewall issue.

But the jpg which was uploaded is all distorted and there is no video upload at all. I suspect when they program in the FTP part on the firmware, they forgot to set it at binary mode and it uploading in ascii mode instead since picture are coming in all distorted.

Bill
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
what ftpd are you running? many times you can disable ascii support all together through its config.

for example on vsftpd that I use there is:
Code:
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
what ftpd are you running? many times you can disable ascii support all together through its config.

for example on vsftpd that I use there is:
Code:
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES

IIS on Windows 7

Yes I am looking at the FTP control in IIS right now to see if I can lock it to binary mode for every upload.

Reason I use Windows 7 because it also my SageTV HTPC server as well too.

Bill
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
I heard back from them. They said to use Serv-U FTP server and it cost 500.00 to buy it.

I am not going to buy something for 500.00 because it the only FTP server that this camera will work with.

Bill
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
there are other ones for windows, I have to imagine every single one of them is better than what IIS is offering.. use google, find open source and give it a shot.. cant hurt.
 

Fully

n3wb
Joined
Mar 29, 2016
Messages
11
Reaction score
2
Location
Australia
I am using Filezilla, and experiencing corrupted FTP images with Huisun PTZs. Filezilla is working fine with Foscam and Hikvision cameras. Has anyone found a freeware ftpd that forces binary or tested to see if that's the issue ?
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
I am using Filezilla, and experiencing corrupted FTP images with Huisun PTZs. Filezilla is working fine with Foscam and Hikvision cameras. Has anyone found a freeware ftpd that forces binary or tested to see if that's the issue ?
I am told by the seller to use Serv-U FTP that it would work with the camera but I have not tried it yet

Bill
 

Fully

n3wb
Joined
Mar 29, 2016
Messages
11
Reaction score
2
Location
Australia
Hi Bill and All,
I have tested a huisun and a hikvision against a ser-u ftp server. Both worked fine.

The logs of the transfer are below. It is interesting to note the different command sequence the hisun uses. The hiusn was corrupting files when used with a filezilla ftp server.

Does anyone know of a free ftp server that is compatible with huisun devices ?



HiSun FTP Transfer

[21] Wed 30Mar16 11:55:45 - (000013) 331 User name okay, need password.
[20] Wed 30Mar16 11:55:45 - (000013) PASS **********
[02] Wed 30Mar16 11:55:46 - (000013) User "SwampCreek" logged in
[02] Wed 30Mar16 11:55:46 - User has connected from xxx.xxx.xxx.xxx (local address 192.168.1.50, port 50001)
[21] Wed 30Mar16 11:55:46 - (000013) 230 User logged in, proceed.
[20] Wed 30Mar16 11:55:46 - (000013) SYST
[21] Wed 30Mar16 11:55:47 - (000013) 215 UNIX Type: L8
[20] Wed 30Mar16 11:55:47 - (000013) TYPE I
[21] Wed 30Mar16 11:55:47 - (000013) 200 Type set to I.
[20] Wed 30Mar16 11:55:47 - (000013) PASV
[21] Wed 30Mar16 11:55:47 - (000013) 227 Entering Passive Mode (60,242,126,199,195,84)
[20] Wed 30Mar16 11:55:47 - (000013) STOR snap_ch0_MotionAlarm_20160330115538.jpg
[11] Wed 30Mar16 11:55:47 - (000013) Receiving file "D:\Camera\SwampCreek\snap_ch0_MotionAlarm_20160330115538.jpg"
[21] Wed 30Mar16 11:55:47 - (000013) 150 Opening BINARY mode data connection for snap_ch0_MotionAlarm_20160330115538.jpg.
[11] Wed 30Mar16 11:55:48 - (000013) Received file "D:\Camera\SwampCreek\snap_ch0_MotionAlarm_20160330115538.jpg" successfully (39.17 KB/sec - 20,615 Bytes)
[21] Wed 30Mar16 11:55:48 - (000013) 226 Transfer complete. 20,615 bytes transferred. 37.98 KB/sec.
[20] Wed 30Mar16 11:55:49 - (000013) QUIT
[21] Wed 30Mar16 11:55:49 - (000013) 221 Goodbye, closing session.
[02] Wed 30Mar16 11:55:49 - (000013) User "SwampCreek" logged out



Hikvision FTP Transfer
[21] Wed 30Mar16 12:04:15 - (000033) 331 User name okay, need password.
[20] Wed 30Mar16 12:04:15 - (000033) PASS **********
[02] Wed 30Mar16 12:04:15 - (000033) User "BottomCamp" logged in
[02] Wed 30Mar16 12:04:15 - User has connected from xxx.xxx.xxx.xxx (local address 192.168.1.50, port 50001)
[21] Wed 30Mar16 12:04:15 - (000033) 230 User logged in, proceed.
[20] Wed 30Mar16 12:04:15 - (000033) TYPE I
[21] Wed 30Mar16 12:04:15 - (000033) 200 Type set to I.
[20] Wed 30Mar16 12:04:15 - (000033) CWD BottomCamp
[21] Wed 30Mar16 12:04:15 - (000033) 250 Directory changed to /BottomCamp
[20] Wed 30Mar16 12:04:15 - (000033) CWD BottomCamp
[21] Wed 30Mar16 12:04:15 - (000033) 250 Directory changed to /BottomCamp/BottomCamp
[20] Wed 30Mar16 12:04:15 - (000033) PASV
[21] Wed 30Mar16 12:04:15 - (000033) 227 Entering Passive Mode (60,242,126,199,195,104)
[20] Wed 30Mar16 12:04:15 - (000033) STOR test
[11] Wed 30Mar16 12:04:15 - (000033) Receiving file "D:\Camera\BottomCamp\BottomCamp\BottomCamp\test"
[21] Wed 30Mar16 12:04:15 - (000033) 150 Opening BINARY mode data connection for test.
[11] Wed 30Mar16 12:04:15 - (000033) Received file "D:\Camera\BottomCamp\BottomCamp\BottomCamp\test" successfully (0.79 KB/sec - 38 Bytes)
[21] Wed 30Mar16 12:04:15 - (000033) 226 Transfer complete. 38 bytes transferred. 0.79 KB/sec.
[20] Wed 30Mar16 12:04:16 - (000033) QUIT
[21] Wed 30Mar16 12:04:16 - (000033) 221 Goodbye, closing session.
[02] Wed 30Mar16 12:04:16 - (000033) User "BottomCamp" logged out
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
Hi Bill and All,
I have tested a huisun and a hikvision against a ser-u ftp server. Both worked fine.

The logs of the transfer are below. It is interesting to note the different command sequence the hisun uses. The hiusn was corrupting files when used with a filezilla ftp server.

Does anyone know of a free ftp server that is compatible with huisun devices ?



HiSun FTP Transfer

[21] Wed 30Mar16 11:55:45 - (000013) 331 User name okay, need password.
[20] Wed 30Mar16 11:55:45 - (000013) PASS **********
[02] Wed 30Mar16 11:55:46 - (000013) User "SwampCreek" logged in
[02] Wed 30Mar16 11:55:46 - User has connected from xxx.xxx.xxx.xxx (local address 192.168.1.50, port 50001)
[21] Wed 30Mar16 11:55:46 - (000013) 230 User logged in, proceed.
[20] Wed 30Mar16 11:55:46 - (000013) SYST
[21] Wed 30Mar16 11:55:47 - (000013) 215 UNIX Type: L8
[20] Wed 30Mar16 11:55:47 - (000013) TYPE I
[21] Wed 30Mar16 11:55:47 - (000013) 200 Type set to I.
[20] Wed 30Mar16 11:55:47 - (000013) PASV
[21] Wed 30Mar16 11:55:47 - (000013) 227 Entering Passive Mode (60,242,126,199,195,84)
[20] Wed 30Mar16 11:55:47 - (000013) STOR snap_ch0_MotionAlarm_20160330115538.jpg
[11] Wed 30Mar16 11:55:47 - (000013) Receiving file "D:\Camera\SwampCreek\snap_ch0_MotionAlarm_20160330115538.jpg"
[21] Wed 30Mar16 11:55:47 - (000013) 150 Opening BINARY mode data connection for snap_ch0_MotionAlarm_20160330115538.jpg.
[11] Wed 30Mar16 11:55:48 - (000013) Received file "D:\Camera\SwampCreek\snap_ch0_MotionAlarm_20160330115538.jpg" successfully (39.17 KB/sec - 20,615 Bytes)
[21] Wed 30Mar16 11:55:48 - (000013) 226 Transfer complete. 20,615 bytes transferred. 37.98 KB/sec.
[20] Wed 30Mar16 11:55:49 - (000013) QUIT
[21] Wed 30Mar16 11:55:49 - (000013) 221 Goodbye, closing session.
[02] Wed 30Mar16 11:55:49 - (000013) User "SwampCreek" logged out



Hikvision FTP Transfer
[21] Wed 30Mar16 12:04:15 - (000033) 331 User name okay, need password.
[20] Wed 30Mar16 12:04:15 - (000033) PASS **********
[02] Wed 30Mar16 12:04:15 - (000033) User "BottomCamp" logged in
[02] Wed 30Mar16 12:04:15 - User has connected from xxx.xxx.xxx.xxx (local address 192.168.1.50, port 50001)
[21] Wed 30Mar16 12:04:15 - (000033) 230 User logged in, proceed.
[20] Wed 30Mar16 12:04:15 - (000033) TYPE I
[21] Wed 30Mar16 12:04:15 - (000033) 200 Type set to I.
[20] Wed 30Mar16 12:04:15 - (000033) CWD BottomCamp
[21] Wed 30Mar16 12:04:15 - (000033) 250 Directory changed to /BottomCamp
[20] Wed 30Mar16 12:04:15 - (000033) CWD BottomCamp
[21] Wed 30Mar16 12:04:15 - (000033) 250 Directory changed to /BottomCamp/BottomCamp
[20] Wed 30Mar16 12:04:15 - (000033) PASV
[21] Wed 30Mar16 12:04:15 - (000033) 227 Entering Passive Mode (60,242,126,199,195,104)
[20] Wed 30Mar16 12:04:15 - (000033) STOR test
[11] Wed 30Mar16 12:04:15 - (000033) Receiving file "D:\Camera\BottomCamp\BottomCamp\BottomCamp\test"
[21] Wed 30Mar16 12:04:15 - (000033) 150 Opening BINARY mode data connection for test.
[11] Wed 30Mar16 12:04:15 - (000033) Received file "D:\Camera\BottomCamp\BottomCamp\BottomCamp\test" successfully (0.79 KB/sec - 38 Bytes)
[21] Wed 30Mar16 12:04:15 - (000033) 226 Transfer complete. 38 bytes transferred. 0.79 KB/sec.
[20] Wed 30Mar16 12:04:16 - (000033) QUIT
[21] Wed 30Mar16 12:04:16 - (000033) 221 Goodbye, closing session.
[02] Wed 30Mar16 12:04:16 - (000033) User "BottomCamp" logged out

So it only upload the motion screenshot, not the motion recordings? My current camera Sharx uploads the motion recordings which I needed.. I was hoping Huisun can do the same but we shouldn't have to use a 500 dollar FTP software just to be able to use FTP.

Are your Serv-U on trial period right now?

Bill
 

Fully

n3wb
Joined
Mar 29, 2016
Messages
11
Reaction score
2
Location
Australia
Hi Bill,
yes using the trial period, just as a quick test to isolate the issue. I am not sure about ftping live video, Re the ftp server I am hoping some else knows of a freeware version.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
all its doing is using PASV, which might require some extra ports open or a better ftpd.

its setting TYPE I, which is image and binary, not ascii
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
Hi Bill,
yes using the trial period, just as a quick test to isolate the issue. I am not sure about ftping live video, Re the ftp server I am hoping some else knows of a freeware version.
My camera does not upload live video, It upload the motion video after it no longer detect any more motions and stop recording. This is the feature I am using and I depends on it however I am reading up on Blue Iris right now and see if I can run it as a back-end server to do task that I wanted it to do and also use the android apps on my TV streaming devices etc.

Still it would be nice if Huisun set it to FTP the motion video over after it done recording like my existing cameras.

Bill

Bill
 

TechBill

Known around here
Joined
Nov 1, 2014
Messages
1,772
Reaction score
1,182
all its doing is using PASV, which might require some extra ports open or a better ftpd.

its setting TYPE I, which is image and binary, not ascii
You are correct and I am wondering why can't the other ftpd acknowledge it. I wonder what command it using that Serv-U understood when it set to binary.

It almost seem if the programmer of the firmware enter wrong syntax in the FTP code that Serv-U is forgiving to accept commands with syntax error in it.

Bill
 

AsX

n3wb
Joined
Sep 15, 2016
Messages
6
Reaction score
2
I tried to figure out how to use IIS (Microsoft) FTP server for camera uploads and found this old thread. So - the uploaded pictures are garbled.

Binary comparison of files downloaded directly and uploaded to the FTP show that there is extra <CR> added to <LF> in garbled files, so yes, it's ASCII instead of image/binary transfer.

IIS FTP logs do not show TYPE I command. Strange that somebody else's logs showed it. Maybe the camera is selectively not sending TYPE I depending on SYST response? Weird.

There is an easy way to fix the uploaded JPEGs, just need to replace all <CR>LF> to just <LF>. I used gsar utility available here:

http://gnuwin32.sourceforge.net/packages/gsar.htm

Command line:

gsar -du InFile.jpg OutFile.jpg

or to overwrite the original file(s):

gsar -o -du InFile.jpg
gsar -o -du *.jpg

Note: use this command only once per file, otherwise more than required replacements will be done and the file will become garbled in a different way.

I wonder if they ever fix this bug in the firmware. And maybe add videos...
 
Top