If you frequent Banggood, AliExpress, etc. you have probably come across the very reasonably-priced Xiaomi XiaoYi “Ants” IP cameras that come in at around €25-30 delivered depending on the model. However, they’re not without their snags. I’ve compiled some notes on making best of these cheap Nest clones.
China Version vs. International Version
The first thing to know is that there are two versions of the first version of the YI WiFi webcam: the China home market version (the version that, at the time of writing, you will see for around €25-30 on AliExpress / Bangood) and the ‘International’ / Rest of World version (which I’ve seen on AliExpress for about €50 delivered – not such a bargain!). Also be aware that there are also different product lines at the time of writing – the first version, a newer version that looks similar but doesn’t have all the guts in a cylindrical puck and has higher resolution and also a motorised Pan-Tilt-Zoom (PTZ) version. In this article I’m talking about the version 1 IP Camera product line. Within that product line there is a slightly lower-resolution version and a slightly higher resolution version which also has IR LEDs with about €5 difference in the price.
For each kind you need either the China version of the XiaoMi YI Home mobile app for your smartphone or the Rest-of-World (RoW)/”International” version. Once you start with the China version of the camera, you are pretty much committed to continue with the China version, and vice versa for the RoW/”International” version. At the time of writing, I believe that there is no hack to convert between China domestic market and RoW versions.
The YI Home App
The mobile app for this product is called ‘YI Home’. If you have a China version of the camera hardware you need to get the app from the Xiaomi App Store, not Google Play. Assuming you don’t speak Chinese, here’s where to click on the page to download the APK:
After installing the app you’ll need to log in to / register an account with Xiaomi. It’s a pain, but that’s how the whole thing gets hooked up between the Yi camera in your home (or wherever) and the rest of the Interweb.
Pairing With the YI Home App
This can be a whole load of fun if, like me, you don’t speak Chinese. The issue is that the China version of the device has all the voice prompts from the camera in Chinese (except the new “This Camera Can Only Be Used Within China” message which is in English – see later).
- Power on the camera. Wait for a couple of clicks from the camera and then two Chinese phrases, the second phrase keeps repeating every ~30s. This means the camera is ready for pairing.
- Start the YI Home app on your smartphone and press the ‘+’ on the app to add another camera
- Follow through the app instructions until you see a QR barcode on your smartphone screen. You need to show this QR code to the Yi camera lens. (This is the magic step whereby the Yi camera gets to know how to log on to your WiFi network and also about your Xiaomi account. As soon as the Yi camera sees the QR code, the LED will turn flashing blue, there will be Chinese voice messages from the camera (and possibly the app) and, after a short while the app should recognise the camera and you’re in business. However, that’s the theory. Unfortunately, this is where you may hear the dreaded “This Camera Can Only Be Used Within China” voice message or, it may simply fail to pair and the camera goes back to the eternal loop of flashing the orange LED and speaking the pairing message in Chinese.
“This Camera Can Only Be Used Within China” Message
Since around April 2016, XiaoMi started checking the location (via IP, presumably) of the installation of your cameras. It keeps playing back a message in English saying that the camera can only be used in China and just won’t work. This is a big pain. You need to a) downgrade the firmware version and b) inhibit the camera from checking its location or remember to always press ‘Cancel’ on the incessant pop-up messages in the app offering for you to re-upgrade the camera firmware.
Firmware Versions
1.8.5.1B
– No China-only message, almost all new versions of firmware allow you to downgrade to this version. This won’t work with hardware versions 2.1 and newer. This version has RTSP streaming support (see other section in this post what that means.)1.8.5.1K
– No China-only message, but newer firmware may inhibit flashing to this particular version.1.8.5.1L
– Last version without China-only message, but newer firmware may inhibit flashing to this particular version.1.8.5.1M
1.8.6.1B_rtspfix
– Tweaked, non-Xiaomi original firmware – English language voice prompts, RTSP, FTP, Telnet, HTTP file browsing (User: root Password: 1234qwer) etc. (use at your own risk, especially so)
Flashing Firmware
First off, I don’t take any responsibility for this. If you brick your camera following this, your network is compromised, your photos end up being shared on the Internets or anything else bad, it’s your own responsibility.
- Power on camera and stick a cocktail stick (or whatever) in the reset hole at the back of the camera for about 5 seconds until you hear a message.
- Unplug the camera’s USB supply.
- Get a MicroSD card (up to 32GB) formatted with FAT32 and a firmware file (unzipped) (file name
home
) in the root directory. See earlier for firmware downloads – start with the 1.8.5.1K version. - Plug the camera’s USB supply back in. The LED should blink orange for about 5 minutes while the firmware is being flashed and then go to a solid orange LED and the usual Chinese voice messages. If you don’t get this behaviour, then you probably need to go to the earlier B firmware version.
- If all goes well the LED should switch to steady-orange accompanied by the usual series of voice prompts leading to the pairing state (see the pairing section earlier).
- Power cycle twice (pull cable, wait 5s, reinsert cable).
The Workings Of the Camera – Hacks
Surprise, surprise, these are Linux-based devices based on the hi3518 chipset. If you don’t want to use the XiaoMi YI Home app for your Smartphone because security and privacy (and you’d have a good point there), then look no further than this GitHub repository.
RTSP Support
RTSP is a network protocol that allows you to stream video. If you have a firmware version of the Yi camera with RTSP support you don’t have to use the Xiaomi YI Home app to view the video streams across the network. Replace x.x.x.x with your camera’s IP address below (tip: go to your router and set a static IP address for your camera):
- Main stream: rtsp://x.x.x.x:554/ch0_0.h264
- Minor stream: rtsp://x.x.x.x:554/ch0_1.h264
- Audio stream: rtsp://x.x.x.x:554/ch0_3.h264
Here’s what I did on my home automation Linux machine to get snapshots:
#!/usr/bin/python3 import datetime import os import sys import time # Not even close to being my real internal IP's, by the way... CAMERAS = [ {'ip': '192.168.1.xx', 'name': 'camera1'}, {'ip': '192.168.1.yy', 'name': 'camera2'} ] IMAGE_DIRECTORY = '/tmp' datestring = datetime.datetime.now().strftime('%d-%m-%Y__%H-%M-%S') print(datestring) for camera in CAMERAS: # sudo apt-get install libav-tools command = ("avconv -i " + "'rtsp://{}/ch0_0.h264'" + " -f image2 -vframes 1 -pix_fmt yuvj420p {}/{}_{}.jpg").format( camera['ip'], IMAGE_DIRECTORY, camera['name'], datestring) print(command) os.system(command) #Delete previous taken snapshots older than 30 days os.system("find {}/ -name '*.jpg' -mtime +30 -delete".format( IMAGE_DIRECTORY))
Quick Tip: These Things Have a Steel Plate In the Base
Rare Earth magnets + XiaoMi WiFi IP Camera + Fridge = #win. See a photo of this trick in action in the Outside Housing section below.
Quick Tip: Inside the App You Can Turn Off the Front LED
In many cases you don’t want a bright blue ‘Hello!’ LED on your security camera. Turn it off in the app. On the very latest firmware you can also control the IR LED’s on the night vision versions which is particularly useful if your camera is inside an outside housing (the internal IR LED’s reflect from the housing’s glass window).
Outside Housing
The camera doesn’t have any kind of weatherproofing, so I made my own weatherproof outdoor housing. It needed to be non-metalling because WiFi. I used a weatherproof plastic electrical junction box in which I made a hole with an 80mm hole saw.
I epoxied a 77mm UV camera filter into the hole. I used a DC-USB converter module so that I could run a long, rugged, cheap 2-core speaker cable from a 12V supply to the camera box. The 12V came from a chassis-style switched mode power supply, but a wall-wart 12V switched mode supply giving 1.5A+ would do fine. I screwed a steel strap to the inside of the box and used the magnet trick to hold he camera still inside the box as well as give a bit of wiggle for positioning.
I reckon the budget for the outside enclosure is €10 if you get everything from AliExpress and use a wall-wart PSU, €15 if you use a little chassis style PSU. Being 12V you could also run this from a small solar installation as long as you are still within range of your WiFi.
Tip: you may want to add shade and / or snow roof for your enclosure to protect from blazing sun / microwave-impervious snow.
Reliability
I’ve had 5 of these and one started going wrong after about 2 months’ use. The failure mode is that it disconnects from the WiFi and won’t reconnect. Worse, it starts playing back a recorded message in Chinese announcing the fact. I also had one Samsung EVO MicroSD card fail in one of these (the memory card was sourced from a fairly reputable retailer here in Europe.) Surprisingly, the camera that failed wasn’t the one in the outside enclosure in the baking sun (although I wouldn’t be surprised if this were to fail next since the environment is pretty harsh without shade).