Enabling RTSP for XiaoMi IP night vision camera

Basically XiaoMi launched 2 type of IP cameras. The first one was launched 2 years ago, 720P without night vision, and the latest one was launched a year ago that has a night vision feature. Besides that, one of the major difference between these 2 versions is the RTSP protocol. The oldest one was able to be accessed by RTSP protocol, but RTSP protocol was completely disabled by XiaoMi. Which means the latest night vision IP camera cannot be used in Synology Surveillance Station or other NAS operating system.

After referring to a few online guide, I noticed that there is a possibility to implant the RTSP protocol into that latest night vision camera. What we need is a SD-card.

Overall I refer to http://xiaoyi.querex.be/ which is an unofficial web site to download Xiao Mi IP camera firmware.

2 important steps to enable RTSP protocol on XiaoMi IP camera,

  1. Flash the firmware
  2. Add in code to implant the RTSP server file

Beside enabling for RTSP protocol, we are able to enable FTP, Telnet, and HTTP web protocol in a single upgrade. I tested with quite some versions, what I noticed is that not all the version is working fine, but the one that always works is version K.

Which firmware to use?

So far I had already flashed up to 4 Xiao Mi IP camera with version K (http://xiaoyi.querex.be/ So download this firmware and then download (http://xiaoyi.querex.be/ as well.

Extract all the .rar file, and then copy and move the “home” firmware to the root of the SD-card, and move /test/ directory to the root as well. So you should see something like below,


The /test/ directory should have contain below files,


The equip_test.sh is a C++ file responsible to do some tasks during the firmware upgrade. The “rtspsvr” and “server” is RTSP server file which is needed to enable RTSP protocol.

If you open the equip_test.sh file, you would see something like below,

Change the timezone


By default, the time zone would be +0 (China timezone). If you are staying at Malaysia, then you don’t need to change this value.

How to flash another firmware

  1. Disconnect cam
  2. Remove micro SD card
  3. Power on and long press reset button
  4. Disconnect cam
  5. Put “home” firmware file and “test” directory on SD card
  6. Insert micro SD card an power on
  7. Wait around 5 min and try to connect from smartphone app
  8. Check your cam it’s IP address in the router DHCP list

How to check if succeeded?

If you are able to access RTSP address using VLC, means you had just succeeded. If you planned to link it with your Synology NAS, you can follow this detailed guide here to setup your XiaoMi CCTV on Surveillance Station.

25 thoughts on “Enabling RTSP for XiaoMi IP night vision camera”

  1. Hi, can i check on your method of flashing firmware? I also have a night vision xiaomi ip camera and follow ur steps but to no avail. Would you be able to share more tips on how to flash? Can I find out how long is the reset? Any signals to know when i can release the reset button? I followed your steps but it remain the original firmware. Thanks!

    Liked by 1 person

      1. Hi, I managed to update to the version k which you recommended but i’m unable to rtsp the feeds from vlc. Able to find out if you encountered this prob?


  2. Hi, i’m using the same example which you have indicated in your another post using vlc network stream to open “rtsp://″. is my internal ip address assigned to the camera. VLC gave the error ” cannot connect to the address:port


    1. Using mac so cant try the paping command hence use nc – vz 554. it failed with error ” nc: connectx to port 554 (tcp) failed: Operation timed out” but able to coonect n view thru mi app on phone


      1. You remove ur sd card, and then check the content.
        If your upgrade is successful, you should see ur test equip_test.sh file renamed to equip_test.sh.moved.
        Which means indicate the upgrade is successful.

        Can you FTP to ? or HTTP?


  3. Hey @sovietmah, thanks for the detailed post. Just wondering, if it’s still possible to use the xiaomi app after I flash my xiaoyi and hook it up to my synology?

    Because I’d like to record the footages to my nas and my wife loves to use the xiaomi app to view the live feed and use the talkback function.

    Thanks in advance!


    Liked by 1 person

    1. Yes. it is still possible to do that.
      But anyhow the real bottleneck is the wireless connection.
      I hook up with 4 xiaomi ip camera, and it isn’t look so good even with archer c7 and need wireless extender.


      1. Hi

        Thanx for your reply. I followed the time zone guide and changed the value of TZ file and reuploaded it to the camera. It have no effect on the time. I am using this firmware : and using the sd card. When I reset the camera and flash the firmware I keep the sd card recording the video and open the filezilla and change TZ file. I connect through rstp and check if the time zone changed it does not. I reboot the camera download the TZ file from camera to pc and see the time zone have the value which I gave it but still dont change the time. For example I use filezilla and change the value from GMT+5 to GMT+5:30. I then upload it and then check the camera have no effect. I reboot the camera and download the TZ again and see that it have GMT+5:30 in the TZ file on camera but not showing correct timezone. I have changed timezones to several to GMT+0 to GMT+3 but the time again does not change at all. Its stick to the initial. Thanx again.


      2. The key things is this statement:
        Stop accessing the IP camera (Stop Surveillance Station or any source that accessing the IP camera – this is extremely important because I noticed that the timezone will be revert back to original value if we keep accessing the camera, except FTP)


      3. Hi


        I took out memory card, stopped all the services using the camera from IP address, connected through file zilla, downloaded the etc/TZ file and edited to change the contents to GMT+2:30(India timezone according to xiaoyi ants smart camera) still no success. I played around a little bit with different timezones, turns out that if you try to upload the new file or edit the the file directly from any editor it breaks the link of etc/TZ file to camera firmware. So I have to pass command from camera itself which solved my issue. Here is how to do that:

        1. Turn off you camera and take out the sd card.
        2. Format the SD card
        3. Create a folder “test” on the SD card.
        4. In the folder “test” create a file named “equip_test.sh” and put the following contents in the file

        echo “GMT+2:30” > /etc/TZ

        You can calculate your timezone and edit accordingly. The above mentioned is India timezone according to xiaoyi ants camera(timezones are wierd here)

        5. Insert the SD card in the camera and switch it on.
        6. Camera will be hanged on orange light, but don’t worry keep it like that for atleast 3 minutes.
        7. Switch off the camera, remove the SD card, delete the test folder on the SD card, switch on the camera and the timezone will be good now.

        Author of the article please put this resolution in your article as one of the many solutions, don’t know which will work for whom.


        Liked by 1 person

  4. I bought and received a 17CNxxx on – managed to get telnet without the serial hack using SDcard with the CloudAPI (http://ike.twbbs.org/index.php/2014-07-22-09-51-45/34-solved-160622-this-camera-can-only-be-used-in-china), but cannot downgrade firmware.

    I then copied over busybox from firmware (apparently newer ver doesnt work but i didnt try) and update init.d starup scripts.

    Now looking for more help… how to enable RTSP on ?

    My script on /test/factory_test.sh :


    cp /tmp/sd/test/busybox /home/

    echo “#!/bin/sh” > /etc/init.d/S88telnet
    echo “/home/busybox telnetd &” >> /etc/init.d/S88telnet

    echo “#!/bin/sh” > /etc/init.d/S89ftp
    echo “/home/busybox tcpsvd -vE 21 /home/busybox ftpd -w / &” >> /etc/init.d/S89ftp

    mv /tmp/sd/test/factory_test.sh /tmp/sd/test/factory_test-moved.sh


  5. After gaining root access on 17CNxx , how can I downgrade the firmware? It does not recognise home file in the SD card, even though telnet and ftp are running, and “can only be used in China” has been disabled.


  6. After you load custom firmware is there a way you can block it from checking for firmware updates? Its easy to accidentally press “OK” when you load the app – I need RTSP on my cameras and don’t want to have to keep reflashing when this stuff happens.


    1. XiaoMi approach is they always hope customer would use their app and software, so everything is more to marketing and business model point of view.
      If you use their app before, you will noticed that they have advertisement on-going as well as promoting their other products such as purifier, mi rice cooker, or robot vacuum.

      If they enable RTSP, it will only jeopardize their strategy, when everyone buy cheap IP camera and link to synology or NAS.

      I guess that’s the main reason they disable RTSP.


  7. Thank you for sharing this. I tried one XiaoYi camera accroding to this and used for about 6months. After that, I found another solution, it is the HiKam S6 camera on amazon.com. I should say the same hardware and software quality as XiaoYi, and even better. And it support ONVIF/RTSP as native. Just saved me some hours on hacking more cameras….


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s