Advertisements

Xiaomi Dafang Hacks: Motion Detection

Given a camera running Xiaomi Dafang Hacks software, you can set up motion-triggered image capture and save the images either locally or on an FTP server. The latter makes sense, as it automatically plunks the images where they’re more generally available.

Define the FTP server parameters in config/motion.conf:

# Configure FTP snapshots and videos
ftp_snapshot=true
ftp_video=false
ftp_video_duration=10
ftp_host="192.168.1.10"
ftp_port=21
ftp_username="ftp-user-id"
ftp_password="secret-password"
ftp_stills_dir="Cam4"
ftp_videos_dir="Cam4"

The FTP server should have the Cam4 directory in place and shared for read-write access before attempting to plunk files therein. Ahem.

The camera’s Services menu leads to the motion configuration page:

Xiaomi Dafang - Motion Settings page
Xiaomi Dafang – Motion Settings page

Limiting the detection region to the lower-left corner cuts out all the waving-in-the-breeze foliage in the yard, while covering the driveway. High sensitivity detects squirrel-sized objects in the foreground, although your mileage will certainly differ.

The camera seems rate-limited at 5 s/image, which may come from FTP transfer overhead; I don’t know if the code includes a built-in delay or if it just works like that. The NAS drive requires upwards of 7 s to spin up if it hasn’t been used for a while, but afterwards the transfers don’t take that long.

Mounting the NAS drive’s CIFS shared directory from my desktop PC works as before:

sudo mount -v -o rw,credentials=/root/.nas-id,vers=1.0,uid=ed -t cifs //192.168.1.10/Cam4 /mnt/part

Then view / edit / delete images as needed:

Xiaomi Dafang - IR motion capture - 15-04-2019_20.02.06
Xiaomi Dafang – IR motion capture – 15-04-2019_20.02.06

The camera has built-in IR LEDs, but they’re nowhere near powerful enough to illuminate the entire yard.

Motion detection works better in daylight:

Xiaomi Dafang - Daylight motion capture - 16-04-2019_09.53.51
Xiaomi Dafang – Daylight motion capture – 16-04-2019_09.53.51

Unlike the original Wyze firmware, the Xiaomi Dafang Hacks firmware & software keep all the images & metadata within my network and under my control.

Advertisements

  1. #1 by Jason Doege on 2019-04-18 - 10:18

    I wonder what Wyze does with all the pictures of me stumbling around the house at night in my underwear…

    • #2 by Ed on 2019-04-18 - 13:19

      Baffles me, but … hey, there you are! [grin]

      The cameras also recorded video to an SD card, although [I think] the metadata still went to the servers. They were unhappy on our isolated-from-each-other guest network and the app seemed unduly fussy about camera connections, which surely meant my guest-network paranoia paid off at least a little bit.

      • #3 by Jason Doege on 2019-04-18 - 16:35

        In other news, the infrared mode isn’t sufficient to see through clothing. Which is good. Very, very good. For everyone. :-)

        • #4 by Ed on 2019-04-19 - 12:46

          Agreed: some sights are better left unseen.

  1. Samsung EVO Pro 32 GB MicroSD Cards | The Smell of Molten Projects in the Morning

Spam comments always vanish. Comment moderation may cause a delay.

Fill in your details below or click an icon to log in:

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