fritz-smh / yi-hack

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

Upgrading to 1.8.6.1B #122

Open mattbuford opened 7 years ago

mattbuford commented 7 years ago

I'm using the US/international version of the camera (from Amazon). After playing around a bit with the camera's original firmware, I installed this hack, and it works except there are a couple showstopping issues:

So, I went to Yi's site and downloaded the latest firmware, then copied that onto the "home" file on the sdcard. I booted into this and it worked, however it was starting the "K" rtspserver, which would crash immediately upon a user connection. I changed the equip_test.sh script so that it would start rtspsvrM, and that one doesn't crash. I connected with VLC and success, I see a nice well-lit scene!

However, after a few seconds it became apparent that it only gives me a single frame of video each time I connect. Data keeps flowing, but VLC never shows any further frames. VLC's statistics show the frame count increasing and data flowing, but the on-screen picture never changes. Pressing stop and play on VLC updates the picture to the current image, but then gets stuck again after only a single frame.

Also, starting cloud services doesn't seem to work. The app is never able to connect to the camera.

So, has anyone made any better progress on this?

In the end, I just want to have the IR light off, the video to work, and the picture to not be crazy dark. I don't really care what version of the firmware is used if I can make these things happen.

Gilgameshismist commented 7 years ago

It looks like the script is using the IR filter wrong. During daytime the IR filter should be before the lens, blocking IR light from the sun and the leds should be off, during nighttime the IR filter should be moved from the lens which will let sensor use the IR light from the LEDs (which should be on during nighttime). What seems to happen is that the IR filter comes before the lens during night blocking the light from the leds, making it "crazy dark".

ygator commented 7 years ago

IR LED See thread "turn off the IR leds" for information on disabling IR Leds at boot time by changing /etc/ui.conf. I am on 1.8.6.1B and I know it works for that. VLC I believe VLC has a problem with the stream when it is a night. If you watch the stream on a mobile device with MX Player or RTSP Player it is fine. It also works fine on a computer in chrome. See thread "Live stream view on camera home page".

mattbuford commented 7 years ago

Gilgameshismist: In other comments, I found a command to enable/disable the IR filter. When I did that (on the original hacked firmware), I did hear a click, but then the video would freeze up.

ygator: I did have ui.conf configured to disable the IR LEDs all along (the setting seemed to be preserved from my original use of the camera on the non-hacked firmware), but that wasn't honored when the hacked firmware booted into 1.8.5, which is why I went to 1.8.6 + hack. Anyway ... Aha! It looks like you are right about VLC. I just tried mx player and it plays video without getting stuck like VLC. So, I guess all my video freezing issues were just VLC not liking something about the night video. Thanks, that helps a lot.

Hmm, something is very wrong with the audio under mx player though. I'm getting something like 5 seconds of audio, 10 seconds of silence, 5 of audio, 10 of silence, and so on. Even more strange, the video continues uninterrupted during the audio silences. This has resulted in my video being ~3 seconds behind realtime while my audio is 5-10 minutes behind realtime. Hah! Anyway, I guess I'll play with this some more tomorrow and see what I can figure out.

death2all110 commented 7 years ago

@mattbuford for enabling cloud services with latest firmware, see my commit here.

hyptechdev2015 commented 7 years ago

@death2all110 It working perfect only on Yi Home with IR (US version, purchased from Amazon), lastest firmware 1.8.6.1B_201604071151

  1. I setup Yi Home by follow official setup
  2. Formate SD Card
  3. Download "death2all110's Yi-hack" package, and extract to SD card (from https://github.com/death2all110/yi-hack/commit/89549759e5fb4167c95efd96d45ee66ddb1033cf)
  4. Follow death2all110's instructions (readme.md)
  5. Replace replace "home" with official "home" (1.8.6.1B_201604071151) firmware from https://www.yitechnology.com/firmware/index/class/home
  6. It work perfectly with Cloud enabled and alerts

Thank you @death2all110, and @fritz-smh so much to update Yi-hack with enable Cloud, and alert features

technophile1 commented 7 years ago

Seconded, I have the cams working perfectly with the cloud enabled patch from @death2all110 . Thanks for all the amazing work to everyone!

My wishlist is: Enable the OSD date/time with latest firmware (the one with bottom left "YI" watermark) MQTT/ONVIF motion detection notification Tiny SNMP server Way to prevent user inadvertently upgrading firmware from app Timelapse snapshots?

jimiamoore commented 7 years ago

Has anyone tried the hack along side the current firmware -- 1.8.7.0A_201702081101?

death2all110 commented 7 years ago

I have not. I'll take a look this weekend.

ygator commented 7 years ago

@jimiamoore They are basically the same except for the following:

  1. goolink removed
  2. new p2p_tnp
  3. new oss (and hi_cipher.ko kernel module) info: https://github.com/aliyun/aliyun-oss-c-sdk
  4. Some tweaking of wifi tx power settings
death2all110 commented 7 years ago

According to the official changelog (that shows in app) it made some changes to night mode.

I updated my fork for the new firmware.

alfa756 commented 7 years ago

Followed the instructions. My camera is ver. 1.8.7.0A_201702081101 Works fine with original firmware but gets stuck on steady yellow light when booting custom firmware from microSD. Any suggestions?

alfa756 commented 7 years ago

Actually re-downloading all files corrected the error and got me to a point of "searching for wi-fi". However after about 45sec of blinking blue it turns to blinking yellow which I assume failure to connect to wi-fi. As i am a noob, could you please clarify if you script supports PSK2-AES and do I keep or remove the quotations marks around the SSID and password?

alfa756 commented 7 years ago

Does this look right: ctrl_interface=/var/run/wpa_supplicant ap_scan=1 network={ ssid=Guest1 scan_ssid=1 proto=WPA RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk=jfneoijf77wos }

death2all110 commented 7 years ago

@alfa756 your SSID and psk needs to be in double quotes

like

...
ssid="Guest"
...
psk="mypskgoeshere"
alfa756 commented 7 years ago

Tried this but no luck. The blue light blinks then goes steady for 3 secs of so and back to blinking yellow.

Here is the script:

ctrl_interface=/var/run/wpa_supplicant ap_scan=1 network={ ssid=“Guest1” scan_ssid=1 proto=WPA RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk=“usmloaner” }

This is what the router setup looks like (see attached)

Thank you for your help.

Anton


From: Blake L. notifications@github.com Sent: Wednesday, February 22, 2017 12:49 PM To: fritz-smh/yi-hack Cc: alfa756; Mention Subject: Re: [fritz-smh/yi-hack] Upgrading to 1.8.6.1B (#122)

@alfa756https://github.com/alfa756 your SSID and psk needs to be in double quotes

like

... ssid="Guest" ... psk="mypskgoeshere"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/fritz-smh/yi-hack/issues/122#issuecomment-281763677, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYt7ZNQiVhu59ZfX0WrGXfHGWLkZIhxiks5rfIMfgaJpZM4LkR5f.

death2all110 commented 7 years ago

@alfa756 your double quotes are messed up. Its using curly/non-ascii characters.

I've attached a fixed file with the information you have above. Just change the txt to conf wpa_supplicant.txt

If you're using textedit on a mac, hit cmd+a on the keyboard then go to edit>substitutions and click on "Smart Quotes" to de-select it. Then re-type the double quotes.

alfa756 commented 7 years ago

Followed your instructions exactly. Same thing: blinking blue for about 45 sec then steady blue for 3secs, then yellow flashing. Any other suggestions?

alfa756 commented 7 years ago

I tried something else also without success: I created a network with the name "your_wifi_ssid" and password "your_password" and just copies the original file I git from the site. Still not success. Could there be something wrong with one of the other files?

alfa756 commented 7 years ago

Got it, DHCP was not enabled by default in yi-hack.cfg Now struggling with getting rtsp stream to show in blue iris

alfa756 commented 7 years ago

Done, really appreciate your help! is there any way to disable the blue light with the added script?

jimiamoore commented 7 years ago

To confirm. This hack provides rtsp access and still allows you to access via the Yi Home app, correct?

alfa756 commented 7 years ago

I never ended setting up the Y home app so I can not confirm this, but it works very well with Blue Iris and it's mobile app.

death2all110 commented 7 years ago

@jimiamoore this version does not, but my fork does.

@alfa756 in the config should be able to set the LED_WHEN_READY to -boff -yoff

alfa756 commented 7 years ago

Thank you that worked great! Another question: is it possible to turn off infra-red with another script change - have camera monitoring through the window and need to disable it to avoid glare?

alfa756 commented 7 years ago

Any ideas on how to disable IR with a script?

death2all110 commented 7 years ago

I'm not sure. I'd check out the ui.conf file

alfa756 commented 7 years ago

Hm, there is no such file and any of the directories

tony-gutierrez commented 7 years ago

So is @death2all110 's fork the best place to start now? Is it being merged into here?

tony-gutierrez commented 7 years ago

@death2all110 Might want to modify your readme git clone to point to your own repo...I just did all that work for the wrong fork :)

raidenii commented 7 years ago

@technophile1 Not sure how to enable date & time OSD, but the watermark can be removed by following the guide here: http://diy.2pmc.net/solved-xiaomi-xiao-yi-ant-home-camera-can-used-china/

Just extract (or use paint to create) two 1x1 bmp files named hight_1555.bmp and low_1555.bmp to /home/hd1/test/, add cp -f /home/hd1/test/*.bmp /home/ to equip_test.sh (I added to the part after the camera finishs initialization), and that's all you need.

technophile1 commented 7 years ago

@raidenii Thanks!

death2all110 commented 7 years ago

@tony-gutierrez Fixed! Sorry about that!

brumsterino commented 7 years ago

Can someone confirm if this works with the International version: 1.8.7.0A_201702081101

I have a camera, I've copied @death2all110 fork to the SD card, reset the camera and then booted. The camera boots and then goes through the waiting for connection process as if its ignoring the SD Card.

wpa_supplicant.cfg looks like this:

ctrl_interface=/var/run/wpa_supplicant ap_scan=1 network={ ssid="my-ssid" scan_ssid=1 proto=WPA RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk="my-wifi-passwd" }

and I have DHCP set.

Am I missing something?

Thanks.

galadril commented 7 years ago

@brumsterino I've received my yi cam (1.8.7.0A_201702081101, international) and I can't get it to work with these packages.

brumsterino commented 7 years ago

Thanks @galadril

I've got a couple of queries out elsewhere. If I get anywhere I'll post back.