-
Xiaomi Dafang Hacks: Timelapse Images
With the Wyze and Xiamoi Dafang cameras running the Xiaomi-Dafang Hacks firmware and software, I tried the timelapse functions on the yard camera.
The
config/timelapse.conffile:# Interval between snaps, in seconds TIMELAPSE_INTERVAL=10 # Duration of the script should run, in minutes, set to 0 for unlimited TIMELAPSE_DURATION=60 # Save dir config SAVE_DIR_PER_DAY=1 # Enable compression COMPRESSION_QUALITY=100The images, named along the lines of
13-04-2019_191810_001.jpg, appear in theDCIM/timelapsedirectory, tucked into daily directories with names like2019-04-13, a mismatch obviously in need of tweaking. There’s also atime_lapsedirectory which seems like cruft from an earlier revision; you can configure the target directory inscripts/timelapse.sh.Start the script manually or from a
crontabentry, wait until it’s done, then transfer the images to somewhere more convenient with a Bash one-liner:find /system/sdcard/DCIM/timelapse/ -name \*jpg -exec curl -s -n -T {} ftp://192.168.1.10/Timelapse/ \;The
-ssilences allcurloutput; omit it until you’re sure the lashup works as you expect. I always forget the backslash before the semicolon terminating the-execcommand.The
-npulls the userID and password from the~/.netrcfile you previously set up for manualftpsessions:machine 192.168.1.10 login ftp-user-id password secret-passwordThe IP address corresponds to my ancient NAS drive; your mileage may vary.
From my desktop box, mount the NAS drive:
sudo mount -t cifs -o "credentials=/root/.nas-id,vers=1.0,uid=ed" "//nasty/Timelapse" /mnt/partThe drive’s credentials aren’t particularly secret, but tucking them into
/root/.nas-idmeans you could automount the drive with no hassle. The NAS drive requires the oldest possible CIFS version, of course.Then view the pix:
You could set up the camera as an NFS share, but having all the cameras deposit their pix in a common location seems more convenient, particularly after I get around to automating the image transfer. Regrettably, the NAS drive doesn’t support subdirectories.
