rxseger / homebridge-camera-motion

Motion detector camera plugin for Homebridge
MIT License
48 stars 9 forks source link

Fixing snapshot so photo is delivered in notification. #10

Closed ayman closed 6 years ago

ayman commented 6 years ago

Fixes #6. Removing snapshot_path from config as it is now autoset to last snap recorded by motion. Last picture now delivered in notification. Plus removed rogue comma in array.

ayman commented 6 years ago

I should point out:

# Note: A symbolic link called lastsnap.jpg created in the target_dir will always
# point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'

this never worked on my config, hence this p/r.

Minims commented 6 years ago

Can you give your motion package and raspbian version so i can make a new try too.

ayman commented 6 years ago

On a Raspberry Pi ZeroW.

pi@pi0:/tmp $  cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

pi@pi0:/tmp $ motion -h
motion Version 4.0, Copyright 2000-2016 ...

The target dir in the motion config is /home/pi/cam and the chmod of that dir is 777 with motion being run with sudo. So I have no idea why it doesn't writing the symbolic link.

This edit just sets the snapshot to the last thing in the motion-pipe dynamically.

Minims commented 6 years ago

I have tried on a Stretch, it seems symlink doesn't work here. I have tried running motion as pi user, but I have the same issue.