fritz-smh / yi-hack

Xiaomi Yi Ants camera hack
1.4k stars 339 forks source link

turn off the IR leds #84

Open reginastracii opened 8 years ago

reginastracii commented 8 years ago

can switching off the IR leds be added to the script? I have the cam behind a glass window so low light mode is unusable. the option is available in the app so it is technically possible to switch them off.

irovder commented 7 years ago

This is very important if the camera is used in the night behind a window or similar.

irovder commented 7 years ago

Disable IR LED with the command: /home/sendMq 0x10 1 0x1141 0 This works, but only once and after the light changes you need to run it again. Workaround: crontab job with that command or put it inside the loop in check_motion.sh. Not very elegant but it seems to work for me.

reginastracii commented 7 years ago

thanks, here's the dumb guy work around I came up with. revert to the original software; install the annoying chinese app back on the phone and do the settings you want there - including IR off and image rotation. pop the card back in. In my case all the settings were kept when running on the hack. of course if one wants to go back or change more settings same thing again....talking about not elegant.

irovder commented 7 years ago

Not bad;) Which chinese version do you use? Mine has no "IR off" option...

reginastracii commented 7 years ago

I just let the app update to the current ver it has the IR-off setting.

irovder commented 7 years ago

Interesting as I have the "YI Home Camera Version: 2.10.2.12_20161207" which I think is actual (and FW 1.8.5.1M_201512011815) and still no IR-off setting...

joozy commented 7 years ago

irovder,

I've the same Yi Home version, 2.10.2.12_20161207 (fw Q).

Select camera, select setting (top left gear icon) select camera setting - Night Vision IR Light toggle.

Do you have the toggle?

photo google photos

reginastracii commented 7 years ago

mine looked same as joozy's I uninstall it when I'm done with settings so couldn't take a scrshot

irovder commented 7 years ago

Nope but my FW is M instead of Q - maybe that's why. Is the hack working with Q without problems? (telnet, ftp, rtsp...)

joozy commented 7 years ago

I tested the hack with Q but at some point that camera refused to boot...constant yellow, I think. Did not attempt to reflash. Reverted to a different hack.

Not conclusive that it does not work with Q, could have been something I did wrong.

R is out.

ygator commented 7 years ago

The setting that corresponds to the Night Vision IR Light in the app is wrHdThreadKB in /etc/ui.conf. 2=Off 1=On

This is on firmware 1.8.6.1B_201604071154

irovder commented 7 years ago

I edited the file, changed the param from 1 to 2, rebooted but IR light is still on.

ygator commented 7 years ago

@irovder Did you check that the setting is still 2 after reboot? When I make changes I normally do the following:

  1. /home/killapp.sh
  2. kill -9 log_server dispatch
  3. Make changes
  4. sync; sync; reboot

What firmware version are you on? I guess it could be different. You can always check. Telnet in and change it in the app and see what changes in /etc/ui.conf. That is how I got the various settings.

irovder commented 7 years ago

Thanks for your answer - yes the setting is still 2 after reboot; using M FW - app shows no IR off option so that could be the problem. Maybe I should try another FW but don't know which one works with this hack (China HW).

ygator commented 7 years ago

I also have two china cameras which are on 1.8.5.1M_201512011815, but they do not have IR.

airdrummingfool commented 7 years ago

In my testing (firmware 1.8.5.1M_201512011815), a modified ui.conf had to be written to mtd2 in order to have any effect (though I've only played with a couple settings).

Here's how I write to it (adapted from update.sh) - do this at your own risk!:

sync
TMPCONF=$(sed  '/conf/!d' /proc/mtd |awk -F':' '{print $1}')
/home/flash_eraseall /dev/$TMPCONF
dd if=/etc/ui.conf of=/dev/$TMPCONF count=128 bs=1024
sleep 5 && reboot
ygator commented 7 years ago

@airdrummingfool, I don't think that is really necessary. I have tried the wrHdThreadKB (IR) on my US camera and it works. Also ddnsSIndex and ptz_hflip works on my China cameras. Have not tried anything else.

airdrummingfool commented 7 years ago

@ygator thanks for letting me know. I must not have been using sync to flush the disk buffer or something like that.

josephdonati commented 7 years ago

@irovder When you place the command to turn off the IR in the check motion script, how exactly do you place it in? Could you possibly share the contents of your check_motion.sh?

When I submit the command directly it works, but I'm having trouble putting it in the loop and getting it to work. I'm just using VI to edit the file, but I could pull the SD card out to edit on computer, too.

Clem- commented 7 years ago

Hi, Did you try running the command with its full path like: ‘/home/led_ctl -boff -yoff &’

josephdonati commented 7 years ago

I did, I placed the line "/home/sendMq 0x10 1 0x1141 0" into the loop in check_motion.sh.

jelbo commented 5 years ago

Has anyone gotten this to work? Like @josephdonati, the command /home/sendMq 0x10 1 0x1141 0 works, but putting it in \test\check_motion.sh does not. How I have set it up:

cd /home/hd1/record/
while [ 1 -eq 1 ] 
  do
    /home/sendMq 0x10 1 0x1141 0
    motion_file=$(find . -type f -name "*.mp4" -mmin -1 | tail -1)
    echo "M="$motion_file
    echo $motion_file | sed "s/.\//record\//" > /home/hd1/test/http/motion
    sleep 30
done

I've also edited /etc/ui.conf from wrHdThreadKB=1 to wrHdThreadKB=2 and I've even done the steps @airdrummingfool suggested, using dd.

Then I've tried to turn off the IR option using the Yi Home app. I downloaded an .apk from version 2.10.19.1_20171213, which worked. I upgraded the firmware to 1.8.7-something and then the option was there. Turned it off. Went back to the hacked firmware (after a reset and putting back the microSD) and the IR LEDs go back on.

/edit: I got it to work. After the Chinese firmware upgrade and the IR LED setting, going back to the hack and doing a /home/killapp.sh, sync, vi /etc/ui.conf edit (see above), sync and reboot, it works and sticks.

jcconnell commented 5 years ago

I'm running this firmware on a 22US: https://github.com/npetrovski/yi-hack-easy

I was able to horizontally flip my image by:

vi /etc/ui.conf
#change ptz_hflip=0 to ptz_hflip=1
sync
reboot

Working great now.