installing the motion package... help

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
marmachine
Posts: 133
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

installing the motion package... help

Post by marmachine »

Hi all,

While trying to setup my Foscam (FI9900P) as motionsensor in order to trigger a switch in Domoticz, installation of the "motion" package is required. I'm hoping someone could help me out on - probably basic Linux knowledge - setting up the motion package properly.

Being absolutely no expert in Linux, i however did succeed on installing motion, but when i start/restart motion (sudo /etc/init.d/motion restart), it seems i must have missed something.

I have motion config setup (/etc/motion/motion.conf), below is part of the config file which i think is related to the issue:

Code: Select all

# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
# target_dir /var/www # this returned the same error
target_dir /domoticz/www

# File path for snapshots (jpeg or ppm) relative to target_dir
# Default: %v-%Y%m%d%H%M%S-snapshot
# Default value is equivalent to legacy oldlayout option
# For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
# File extension .jpg or .ppm is automatically added so do not include this.
# 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'
#snapshot_filename %v-%Y%m%d%H%M%S-snapshot
snapshot_filename cam/foscam
Now when i issue "sudo /etc/init.d/motion restart" it returns "OK", but when i go see the logfile (sudo nano /var/log/syslog) it tells me that there is an issue. This is where my knowledge comes short... i assume there is something wrong with the filepath, i did set persmissions to 777 for the "cam" dir.
Here's the logfile:

Code: Select all

Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "netcam_http"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "despeckle"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "gap"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "max_mpeg_time"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_all"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_normal"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ppm"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_new"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "locate"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "jpeg_filename"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_quality"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_maxrate"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_localhost"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_limit"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_localhost"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_html_output"
Apr  3 11:19:34 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Sun Apr  3 11:21:04 2016 [try http://www.rsyslog.com/e/2007 ]
Apr  3 11:22:00 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Sun Apr  3 11:23:30 2016 [try http://www.rsyslog.com/e/2007 ]
Apr  3 11:23:23 raspberrypi systemd[1]: Stopping LSB: Start Motion detection...
Apr  3 11:23:23 raspberrypi motion[2672]: Stopping motion detection daemon: motionNo /usr/bin/motion found running; none killed.
Apr  3 11:23:23 raspberrypi motion[2672]: .
Apr  3 11:23:23 raspberrypi systemd[1]: Starting LSB: Start Motion detection...
Apr  3 11:23:23 raspberrypi motion[2678]: Starting motion detection daemon: motion.
Apr  3 11:23:23 raspberrypi systemd[1]: Started LSB: Start Motion detection.
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] conf_load: Processing thread 0 - config file [b][color=#FF0000]/etc/motion/motion.conf[/color][/b]
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "netcam_http"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "despeckle"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "gap"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "max_mpeg_time"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_all"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_normal"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "output_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ppm"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_new"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "ffmpeg_cap_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "locate"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "jpeg_filename"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_quality"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_motion"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_maxrate"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_localhost"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "webcam_limit"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_localhost"
Apr  3 11:23:24 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option "control_html_output"
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Logging to syslog
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log type (ALL)
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is from /etc/motion/motion.conf
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is device: http://192.168.2.99:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password input -1
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Stream port 0
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 2684
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
Apr  3 11:23:24 raspberrypi motion: [1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (http://192.168.2.99:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=username&pwd=password)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_setup_html: connected, going on to read image.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
Apr  3 11:23:24 raspberrypi motion: [1] [ALR] [NET] netcam_handler_loop: Camera handler thread [2] started
Apr  3 11:23:24 raspberrypi motion: [1] [WRN] [NET] netcam_next: called with no data in buffer
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Logging to syslog
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log type (ALL)
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is from /etc/motion/motion.conf
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is device: http://192.168.2.99:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=marmachine&pwd=637800mvw input -1
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Stream port 0
Apr  3 11:23:24 raspberrypi motion: [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 2684
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
Apr  3 11:23:24 raspberrypi motion: [1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (http://192.168.2.99:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=marmachine&pwd=637800mvw)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_setup_html: connected, going on to read image.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
Apr  3 11:23:24 raspberrypi motion: [1] [ALR] [NET] netcam_handler_loop: Camera handler thread [2] started
Apr  3 11:23:24 raspberrypi motion: [1] [WRN] [NET] netcam_next: called with no data in buffer
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:24 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:25 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:26 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:26 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:26 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:26 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:26 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:27 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:27 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:27 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:27 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:27 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:28 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:28 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:28 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:28 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:28 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:29 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:29 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:29 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:29 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:29 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Content-length present
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
Apr  3 11:23:30 raspberrypi motion: [1] [ERR] [ALL] create_path: [color=#FF0000][b]Problem creating directory /domoticz:[/b][/color]
Apr  3 11:23:30 raspberrypi motion: [1] [ERR] [ALL] put_picture: [color=#FF0000][b]Can't write picture to file /domoticz/www/cam/foscam.jpg - check access rights to target directory#012Thread is going to finish due to this fatal error[/b][/color]:
Apr  3 11:23:30 raspberrypi motion: [1] [ERR] [EVT] event_image_snapshot: Could not create symbolic link [cam/foscam.jpg]:
Apr  3 11:23:30 raspberrypi motion: [1] [NTC] [ALL] motion_loop: Thread exiting
Apr  3 11:23:30 raspberrypi motion: [1] [ALR] [NET] netcam_handler_loop: netcam camera handler: finish set, exiting
Apr  3 11:23:31 raspberrypi motion: [0] [NTC] [ALL] main: Threads finished
Apr  3 11:23:32 raspberrypi motion: [0] [NTC] [ALL] main: [color=#FF0000][b]Motion terminating[/b][/color]
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: installing the motion package... help

Post by safi78 »

Hi marmachine,

I wrote a pretty clear wiki page on 'motion' (http://www.domoticz.com/wiki/Camera_Set ... ion_sensor).

My best guess is that your motion package is the 'specific to raspberry pi'-one, not the full motion package for some reason.

Wouldn't know where to start troubleshooting, but there's also a script that queries the cgi-results of your cam. I don't know your camera but since it's Foscam, the cgi-results will probably work:

viewtopic.php?f=11&t=2554#p64782

And, that could / will work to trigger something when sound is detected (if your cam supports that) as well, and is a lot less time consuming ;)

Script is pretty self explanatory, just run it with cron every bla minutes.
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: installing the motion package... help

Post by Egregius »

Do you want to run motion on the same RPi as Domoticz?
I would not suggest that, motion is extremely CPU intensive.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest