How to Hack a $30 IP Camera to Fix Out-of-the-Box Limitations

If you are looking for a cheap IP camera with night-vision and 1080P resolution, then the Xiaomi Dafang camera is probably the best candidate to choose. Packed with awesome features at a low price, it’s really hard to say no! However, the cheap price will limit you to using only the Xiaomi’s Mi Home App and Cloud to view footage which can be a bit inconvenient.

The good news is that there’s a way to overcome this limitation so you can do more than what the camera is worth. This article will explain in a few steps about Xiaomi Dafang hacks to get the features you want.

Xiaomi Dafang Existing Features

Xiaomi is a Chinese (meh . . . it has ups and downs) manufacturer known for a large product catalog, including IP cameras, with great price/performance ratio. The Xiaomi Dafang IP camera boasts full HD resolution as well as 6 infrared LEDs at 940nm so you can record footage in dark areas. It’s also great for wide-angle video surveillance applications because of its 120 degree field of view.

You can also install an SD card with up to 32 GB memory to store video recording or images instead of using a cloud service or video recorder. Just like other high-end cameras, you can configure it to capture footage continuously or only when the camera detects motion. Its built-in microphone can record audio from up to 9 meters.

Xiaomi uses its dedicated Mi Home application and cloud to view footage through smartphones and tablets. For some, being tied to using only the Mi Home app can be inconvenient. Some users even reported some issues in the installation process. The app requires lots of permissions to update the firmware. Product availability may also vary per region. And, some users complained about some of the interface  being in Mandarin even if the language was set to English.

If you like the camera because of its low cost and features but want to increase its flexibility, you can follow the simple process below to install an alternative open source firmware.

Xiaomi Dafang Hacks - How to Install the Modified Firmware

You can go and check out the firmware modifications or CFW on GitHub by EliasKotlyar at: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks

To flash the CFW, download the CFW binary file at:

https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/hacks/cfw/dafang/cfw-1.3.bin

The size of the file should be about 11.1 MB. The GitHub file contains the step by step process on how to flash the hacked loader firmware. Take note that the author warns you not to install the latest firmware on your device as it will disable the hacked firmware.

CFW is divided into two parts.

First is the Custom-Firmware contains the altered original firmware that allows you to boot from your microSD. You need to flash this instead of the original firmware. Take note that it doesn’t contain load the modified firmware yet. Do this procedure only once.

The second part are the CFW-Files that contain the modified software. Install this to your microSD once you have completed the previous process. This is also where you can easily change your files on the microSD.

Once everything is set, open your web browser and on the address bar, type the IP address of the camera. You should be able to open a page where you can select the services you want. You can even control some of the functionality of the camera directly from the GPIOs such as motor movements, IR filters, and LEDs.

CFW Features

Below is a summary of the CFW features:

  • Full working RTSP with H264/MJPEG
  • SSH-Server (dropbear)
  • FTP-Server (bftpd)
  • Webserver (boa)
  • Image-Snap (Get Jpeg Image)
  • Horizontal/vertical motor rotation / move to center
  • Turn on/off blue/yellow/IR LEDs/IR-Cut
  • Local h264 recording possible
  • Remote Audio Playback & Recording
  • MQTT
  • Home-Assistant integration

Wrapping it up

The Xiaomi Dafang IP camera is an ideal product if you’re considering both the features and the price. In exchange of its low price, however, you might now want to be stuck using the Mi Home app and cloud to make your camera useful.

Thanks to the work of Elias’ open source firmware, you can now hack the camera and get extra features. It’s definitely worth trying out to get a capable security camera for a great price.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.