yi-hack-Allwinner-v2
yi-hack-Allwinner-v2 copied to clipboard
ftp upload not working
I have a problem with the ftp upload of the videos recorded by the camera, I have configured an ftp server in an asus router to which I have a pendrive connected, in the motion events settings, I have ftp upload enabled, in ftp host I have the router address 192.168.1.1, but it doesn't work, we don't upload the videos to the ftp server
Try to run the script ftppush.sh manually and check the logs.
How I run the script, I don't know how to do it
Login with ssh and run the folling commands:
root@yi-hack-allwinner-v2:~# . /tmp/sd/yi-hack/script/env.sh
root@yi-hack-allwinner-v2:~# /tmp/sd/yi-hack/script/ftppush.sh start
This is what I get when I run it manually by ssh, the time and date are not current because I don't have internet on the router where the camera is connected and I don't know how to manually set the date and time on the camera.
root@yi-96dd:~# . /tmp/sd/yi-hack/script/env.sh root@yi-96dd:~# /tmp/sd/yi-hack/script/ftppush.sh start 2020-04-17 [22-29-25] [INFO] === SERVICE START === 2020-04-17 [22-29-25] [INFO] checkFiles ftpput: unexpected server response to STOR: 550 Permission denied (restricted operation). 2020-04-17 [22-29-26] [ERROR] uploadToFtp: ftpput FAILED. 2020-04-17 [22-29-26] [ERROR] checkFiles: uploadToFtp FAILED - [/tmp/sd/record/2020Y04M17D22H/16M35S25.mp4]. ftpput: unexpected server response to STOR: 550 Permission denied (restricted operation). 2020-04-17 [22-29-26] [ERROR] uploadToFtp: ftpput FAILED. 2020-04-17 [22-29-26] [ERROR] checkFiles: uploadToFtp FAILED - [/tmp/sd/record/2020Y04M17D22H/17M00S60.mp4]. ftpput: unexpected server response to STOR: 550 Permission denied (restricted operation).
Line 5 says that the user does not have correct permissions.
The ftp server user is admin, in the asus router's ftp server configuration I have created a video folder which has R / W permissions activated for the admin user and in the motion events configuration, in ftp directory I have selected the video folder that I have created on the ftp server
Try to login manually (eg Filezilla) to the ftp and try to upload a file.
It already works for me, the problem was that the path of the videos folder of the ftp server was incorrectly configured in the camera configuration, the path that I had set was / Videos and the correct path is / sda1 / Videos
Thank you very much.
Same here. Anon user gets cant' t change directory to /home/ftp and normal user seems not providing the correct password to the server.
ftpput: unexpected server response to PASS: 530 Login authentication failed
What can I do?
I get the same here too but my error is:
ftpput: unexpected server response to STOR: 553 12M00S60.mp4: Permission denied.
I have tested the ftpuser in the FTP server with WinSCP and FileZilla and the user / pass works and can create directories/files.
I have disabled unwanted services like ONVIF and Telnet and tried to enable the swap option., Nothing works.
Any tips please?
Run it manually and post the full log: https://github.com/roleoroleo/yi-hack-Allwinner-v2/issues/101#issuecomment-783599076
In my case I'm an idiot)) I used camera's IP as ftp server address. Damn stupid)) Now it all works like a charm. Cam sends vids to a folder on the ftp server. That folder is synced to OneDrive and set as online only. So the vids don't take up any space on the ftp server and always available online.
Thanks Roleo!
Thanks so much for the replies. I have captured the output showing the error after running the ftppush start. It's here in pastebin. Is this what you meant or is there a log file I need to grab too?
In my case I'm an idiot)) I used camera's IP as ftp server address. Damn stupid)) Now it all works like a charm. Cam sends vids to a folder on the ftp server. That folder is synced to OneDrive and set as online only. So the vids don't take up any space on the ftp server and always available online.
Thanks Roleo!
I'm certainly one of those :) - I have checked the IP, user/pass many times.... so hope that's not it. Do you use a port number in the FTP Host field? I am leaving mine as just IP as the FTP sever is on default port 21.
I wonder if it can be the FTP server. I may spin up a test FTP server in a docker but I'd need to use another port... @roleoroleo does the FTP Host field support IP:PORT?
Sorry to spam the posts. I have used an admin account (instead of my ftpuser account) and it all works. I must have a permission error at my FTP Server end. Sorry for the messing around. Thank you Roleo for the great work.
Last post, I promise! :) Is it possible that there is a limit on the password length? I had used a password of 14 characters, no extended. Now I have a 6 char password, the ftpuser works fine. Just posted in case it helps others.
I will check it.
I think the problem is, that the created directory has only chmod 644.
If i chance the permissions to 755 at the ftp server, the uploads runs perfectly.
Maybe there is a error in the scripts, which do the upload?
The script doesn't set permission. Simply it runs the mkd command to create the directory. It depends on the user permissions or on the ftp server configuration, if the new directory is 644 or 755. But you could try to change line 167
echo -e "USER ${FTP_USERNAME}\r\nPASS ${FTP_PASSWORD}\r\nmkd ${FTP_DIR}\r\nquit\r\n" | nc -w 5 ${FTP_HOST} 21 | grep "${FTP_DIR}"
with this
echo -e "USER ${FTP_USERNAME}\r\nPASS ${FTP_PASSWORD}\r\nmkd ${FTP_DIR}\r\nsite chmod 755 ${FTP_DIR}\r\nquit\r\n" | nc -w 5 ${FTP_HOST} 21 | grep "${FTP_DIR}"
and 174
echo -e "USER ${FTP_USERNAME}\r\nPASS ${FTP_PASSWORD}\r\nmkd ${FTP_DIR}/${FTP_DIR_HOUR}\r\nquit\r\n" | nc -w 5 ${FTP_HOST} 21 | grep "${FTP_DIR_HOUR}"
with this
echo -e "USER ${FTP_USERNAME}\r\nPASS ${FTP_PASSWORD}\r\nmkd ${FTP_DIR}/${FTP_DIR_HOUR}\r\nsite chmod 755 ${FTP_DIR}\r\nquit\r\n" | nc -w 5 ${FTP_HOST} 21 | grep "${FTP_DIR_HOUR}"
Sorry ...
That doesn't change anything:
And: when you restart the cam, the folder with the date 2020 (etc.) is always created. Is that normal?
Check if the user you are using is able to change permissions.
This is the FTP from my web hosting provider, I don't have access to SSH here.
With the same access data, I can use everything in my FTP software, including CHMOD, etc.
Could you try to run this command manually?
- log in to you ftp server with a command line client.
- run "mkd" to create a new directory
- check the permissions
- run "site chmod" to change the permissions
- check again the permissions
I have a problem with the ftp upload in the new camera, the camera is yi home ifus version the Firmware: 9.0.36.02 and I use the y211ga files version: 0.1.8, the upload to the ftp server does not work and if I run the command: / tmp / sd / yi-hack / script /ftppush.sh start by ssh I get this in the registry:
root@porche:~# /tmp/sd/yi-hack/script/ftppush.sh start 2021-08-04 [19-19-45] [INFO] === SERVICE START === 2021-08-04 [19-19-45] [INFO] checkFiles 2021-08-04 [19-20-30] [INFO] checkFiles 2021-08-04 [19-21-15] [INFO] checkFiles ash: 080421E2: bad number 2021-08-04 [19-21-15] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E220M00S60.mp4] - already sent. 2021-08-04 [19-22-00] [INFO] checkFiles ash: 080421E2: bad number 2021-08-04 [19-22-00] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E220M00S60.mp4] - already sent. ash: 080421E2: bad number 2021-08-04 [19-22-00] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E221M00S60.mp4] - already sent. 2021-08-04 [19-22-46] [INFO] checkFiles ash: 080421E2: bad number
If I go into the motion event section, the folder of what he has recorded appears, but no file of what he has recorded appears, however if I connect by ftp to the camera if the recorded files appear. you can see it in the following images: https://drive.google.com/file/d/19Geg0jOIoL_93v00QSzTr1TTJI6ei3F7/view?usp=sharing https://drive.google.com/file/d/1mavQ6scVDpLs1foJUuoVKucunEw0xAir/view?usp=sharing https://drive.google.com/file/d/1bATWcqh63VTzi89SxCu_Yc8T9-yLT53k/view?usp=sharing
I need to use the ftp upload function for my video surveillance system.
Sorry, to many Problems...
I've returned the camera.
I have a problem with the ftp upload in the new camera, the camera is yi home ifus version the Firmware: 9.0.36.02 and I use the y211ga files version: 0.1.8, the upload to the ftp server does not work and if I run the command: / tmp / sd / yi-hack / script /ftppush.sh start by ssh I get this in the registry:
root@porche:~# /tmp/sd/yi-hack/script/ftppush.sh start 2021-08-04 [19-19-45] [INFO] === SERVICE START === 2021-08-04 [19-19-45] [INFO] checkFiles 2021-08-04 [19-20-30] [INFO] checkFiles 2021-08-04 [19-21-15] [INFO] checkFiles ash: 080421E2: bad number 2021-08-04 [19-21-15] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E220M00S60.mp4] - already sent. 2021-08-04 [19-22-00] [INFO] checkFiles ash: 080421E2: bad number 2021-08-04 [19-22-00] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E220M00S60.mp4] - already sent. ash: 080421E2: bad number 2021-08-04 [19-22-00] [INFO] checkFiles: ignore file [/tmp/sd/record/2021Y08M04D21H/E221M00S60.mp4] - already sent. 2021-08-04 [19-22-46] [INFO] checkFiles ash: 080421E2: bad number
If I go into the motion event section, the folder of what he has recorded appears, but no file of what he has recorded appears, however if I connect by ftp to the camera if the recorded files appear. you can see it in the following images: https://drive.google.com/file/d/19Geg0jOIoL_93v00QSzTr1TTJI6ei3F7/view?usp=sharing https://drive.google.com/file/d/1mavQ6scVDpLs1foJUuoVKucunEw0xAir/view?usp=sharing https://drive.google.com/file/d/1bATWcqh63VTzi89SxCu_Yc8T9-yLT53k/view?usp=sharing
I need to use the ftp upload function for my video surveillance system.
Probably the script must be updated with the new naming convention.
By when do you think you can have it corrected?
I need a few days.
No problem, I'll wait patiently.
Try this commit: https://github.com/roleoroleo/yi-hack-Allwinner-v2/commit/6e084f08227871573c05f067f0ee45f23507d2f8