samtap / fang-hacks

Collection of modifications for the XiaoFang WiFi Camera
1.67k stars 340 forks source link

21-ir-control NOK #227

Open TheMym opened 6 years ago

TheMym commented 6 years ago

Hello, I updated the fang-ir-control.sh to keep the cam cool but now when I check the scripts it says the 21-ir-control is not ok. Anybody else have this problem ? The night vision is still working great but I just want to know if this is normal. Thanks !

kslmgd commented 6 years ago

must use reboot from fang hacks webpage after making the change.

toomuchio commented 6 years ago

Make sure it's not dos formating as well. You can use vi on the camera if you ssh in to edit the file, or sshfs to another Linux machine.

TheMym commented 6 years ago

@kslmgd I did reboot it as well but no go. @toomuchio I just edited the file with notepad++ and overwrote the old one before rebooting.

Put back the original fang-ir-control.sh in the meantime and the status is back to OK Maybe a bad edit ? I was looking for the updated fang-ir-control.sh but the link I found was 404.

DarkStorm99 commented 6 years ago

I had the same issue. I made a copy of ir control first. Ssh into the unit. Copied the new ir script to clipboard, opened original ir control with vi, and pasted content. This appeared to resolve the issue. I suspect maybe a permissions problem on the new file causes issues

ykhandler commented 6 years ago

If you want to transfer an .sh file dont use ftp, sometimes it change the format of the file. It is the return character problem. If you still want to use ftp, rename it without the .sh extention then transfer it, then rename it back to .sh if it is already copied.

TheMym commented 6 years ago

Thanks will try the sh trick !

PrawnMan commented 6 years ago

I cant seem to find the IR script:

https://raw.githubusercontent.com/samtap/fang-hacks/master/data/usr/bin/fang-ir-control.sh

The link seems broken?

Anybody have a link to the updated script? Is it in the current image?

EDIT: Is this it?

https://github.com/samtap/fang-hacks/blob/0d2913f11b6bcf471f97e7bb29e6d4b5777c1dbf/usr/bin/fang-ir-control.sh

jivonl commented 6 years ago

i had to change the " permissions " on the file.

Login with ssh on the device: cd /media/mmcblk0p2/data/usr/bin ls -l | grep fang -rw-r--r-- 1 root root 1433 Dec 19 09:31 fang-ir-control.sh -rwxr-xr-x 1 root root 818 Jan 25 2017 fang-ir-control.shbackup

this bold is the new file with wrong permissions (check with older file below) in this case the resolution was to use the next command chmod +x fang-ir-control.sh check with: /media/mmcblk0p2/data/usr/bin # ls -l | grep fang -rwxr-xr-x 1 root root 1433 Dec 19 09:31 fang-ir-control.sh -rwxr-xr-x 1 root root 818 Jan 25 2017 fang-ir-control.shbackup

now the script is " visible " and status OK

a-triant commented 6 years ago

Hello!

I have same issue, I overwritten the /media/mmcblk0p2/data/usr/bin/fang-ir-control.sh with the edited one, using a FTP client (FileZilla), also through SSH as said above I have set 755 permissions to the updated script. However the IR does not working after that, and the 21-ir-control shows NOK. Probably already reseted the camera and reformatted the SD card for over 15 times, tried disabling enabling the script, rebooting the camera many times, nothing helps.

I don't understand what i'm doing wrong, any ideas?

Thanks.

-------UPDATE------ Okay, I found the issue, it has to do something with encoding, after overwritten with the new file script, then I opened it through SSH VIM and found that every line has at end ^M, after fixing that everything worked.