01304 827609 info@use-ip.co.uk Find us

Trying to send ANPR images to a local FTP server fails?

AdamB

New Member
Messages
3
Points
1
Hello,

I have been struggling with this for a long time and am really hoping someone can help me. I need to send ANPR images from a HikVision ANPR camera to an FTP server on its local network. For the FTP server I am using Raspberry Pi computer running vsftpd configured in anonymous mode. This server seems to work perfectly well when I connect to it from FileZilla on a local Windows PC and drop a file into the correct folder.

But, the HikVision camera (model DS-2CD4A26FWD-IZS/P) produces an error when I hit the TEST button on the relevant config screen. It says "The user has no permission to write". This is strange since FileZilla has no problem uploading files to the FTP server. Both clients are connecting in anonymous mode, so how come one has permission to write and one doesn't? Obviously something else is going on here, but I don't know what.

Some other notes:-
- I wasn't originally using anonymous mode. I was using a username & password for authentication, but then the TEST button on the cameras config screen produced an error that said the user name / password were incorrect - which they were not.
- On other cameras which support SFTP I have had this working well. But this camera only supports FTP.
- I can share specific of my vsftpd.conf or camera config if that would help. What I would really like is to see someone else's working configuration.

I would be massively grateful for some help with this. I would love to hear from someone who has successfully had a camera of this model (or similar) talking to an Raspberry Pi (or similar) over FTP to send ANPR images.

Thanks in advance.

Adam
 
Hi Adam,
Have you tried bypassing the test and just send an image to the RPi?

Sometimes I use Wireshark to help see what's going on between the two devices. Checking the FTP protocol messages may give up more detail than the camera does. if you see the FTP protocol connects, check other protocols between the devices.

Could you adjust the permissions on the RPi folder you are writing to?

David
 
Thanks David,
> Have you tried bypassing the test and just send an image to the RPi?
I'm not sure how you mean I should send an image. Do you mean using FileZila? If so that works fine. If you mean letting the camera send images, then it is configured to do so, but none are being received.

> Using Wireshark...
I used this years ago on a website project on a Windows PC. How would I use it in this case? It doesn't look like I can install it on the RPi.

> RPi folder permissions changes...
I am not sure what permissions changes I should make to the RPi folder, so I have experimented with doing a "chmod a+w" on the folder, that has granted some write access that wasn't there before. I will try later and see if this has helped ( - I can't to the cam at the moment).

Also, in case this helps I just copied the following lines from the vsftpd.log file which shows what happened when attempting to use the TEST button recently. It clearly logs in successfully using anonymous mode and then fails to upload a file called "/anpr/test", which I can confirm is the folder name and file name that I was expecting.

Thu Dec 15 08:08:03 2022 [pid 2110] [ftp] OK LOGIN: Client "::ffff:192.168.30.95", anon password "ipc@anonymous"
Thu Dec 15 08:08:03 2022 [pid 2112] [ftp] FAIL UPLOAD: Client "::ffff:192.168.30.95", "/anpr/test", 0.00Kbyte/sec

Thanks for your help so far.

Regards,

Adam
 
Hi Adam
If you mean letting the camera send images, then it is configured to do so, but none are being received.
That is what I meant.

> Using Wireshark...
You can use it to monitor the data to / from the camera and RPi IPv4 address. You can filter against specific protocols and see the text messages. Sometimes the text messages are in hex, just use an online converter. I'm an occasional user and find it very useful.

FAIL UPLOAD: Client "::ffff:192.168.30.95", "/anpr/test", 0.00Kbyte/sec
This looks like a fail to write permissions problem.

"/anpr/test"
I wonder if the "test" file needs an extension like test.txt? It's possible the file operating system security does not like file names without an extension. Maybe your recent permission changes will fix this.

David
 
@AdamB I have one of these same cameras and no problems sending test or images using FTP (vsftpd too in my case) although I have not tried anonymous, I always use a user/password even though it's local.

Perhaps a silly question but you have pre-created the "anpr" directory? e.g. that dir already exists in your ftp area?

My setup is just this:
Network -> Advanced -> FTP
  • Server Address: local IP address of my FTP server
  • Port: 21
  • User Name/Password: I created a user/password to use
  • Directory: Save in the parent directory
  • Parent Directory: Custom (I specify a pre-created directory for each camera)
  • Picture Filing Interval: OFF
  • Picture Name: Default
  • Upload Picture: Checked
 
Could you adjust the permissions on the RPi folder you are writing to?
Changing the directory permissions has fixed the error "The user has no permission to write". So now the test button successfully delivers a test file. Hooray and thanks for your help!

Regards,

Adam
 
Last edited:
Changing the directory permissions has fixed the error "The user has no permission to write". So now the test button successfully delivers a test file. Hooray and thanks for your help!

Regards,

Adam
you're welcome.

David
 
Back
Top