Open reparator opened 5 years ago
Tried one more thing: Using the pkill-command in a terminal as user pi, the operation is not permitted:
pi@Meisenhaus:/etc/motion $ pkill -SIGTERM -f '^arecord -t wav -D plughw:1,0 /media/RaspiNAS/'
pkill: killing pid 7121 failed: Die Operation ist nicht erlaubt
Any idea? Why does the command work sometimes and sometimes not?
And again: Even a
pi@Meisenhaus:/etc/motion $ sudo pkill 7121
pi@Meisenhaus:/etc/motion $ ps aux | grep arecord
root 7089 0.0 0.0 1900 404 ? Ss 12:55 0:00 sh -c /usr/local/lib/python2.7/dist-packages/motioneye/scripts/relayevent.sh "/etc/motioneye/motioneye.conf" start 2; arecord -t wav -D plughw:1,0 /media/RaspiNAS/2019-10-17/12-55-27.wav &
root 7121 0.1 0.3 6232 2776 ? S 12:55 0:25 arecord -t wav -D plughw:1,0 /media/RaspiNAS/2019-10-17/12-55-27.wav
pi 18783 0.0 0.0 4776 568 pts/0 S+ 16:41 0:00 grep --color=auto arecord
pi@Meisenhaus:/etc/motion $
does not stop the process!
Only a
sudo kill -9 7121
kills the process.
Seems to be more Rasbian related than motioneye related, but anyway,
has someone an advice to fix this?
Found out that it is related to the thread.conf used. I added originally the arecord command to thread of an attached webcam (a Logitech C270 as V4L2 Camera). Here it does not work and the above described problems occurs. If I use the other cam, a RaspberryPi Nightvision Cam as MMAL Camera, then everything works fine and the process stops as expected. For me that helps but it is a little bit dissatisfying if you dont know what the problem really is. It should work with the webcam either....
Hi there, I have a question regarding the "Run a Command" and "Run an End Command" in motioneye. Here my versions: motionEye Version 0.39.3 Motion Version 4.1.1 OS Version Raspbian 9.6 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
MySystem is running for about a year now (on a RaspberryPi 3 B+) to surveil a birdhouse. To get sound recording via a microphone I added the following commands to /etc/motioneye/thread-1.conf:
on_event_start /usr/local/lib/python2.7/dist-packages/motioneye/scripts/relayevent.sh "/etc/motioneye/motioneye.conf" start %t; arecord -t wav -D plughw:1,0 /media/RaspiNAS/%Y-%m-%d/%H-%M-%S.wav
This command starts a recording from the attached USB microphone when a motion is detected. The resulting wave-file is stored on a raspberryPi-NAS connected via cifs. The video-files go to the same storage device. Audio recording starts at the same time a video recording starts (nearly the same, because the date and time differ appr. 2 sec).
on_event_end /usr/local/lib/python2.7/dist-packages/motioneye/scripts/relayevent.sh "/etc/motioneye/motioneye.conf" stop %t; pkill -SIGTERM -f '^arecord -t wav -D plughw:1,0 /media/RaspiNAS/'
This is the end command. It stops recording from the microphone by sendig the termination command.All works most of the time but....
**1. The audio file is always about 30 to 50 sec. longer than the video file. Why that? Takes the pkill such a long time?
This last recording is not terminated and runs forever... If I look to the process list, the process of audio recording is still running even if the video recording has stopped a long time ago (about 4 hours later now):
Has anyone an idea how I could localize the problem and fix it? Why is the arecord-process sometimes not proper terminated? The video recording stops as it should, the Email notification is send, but my audio recording did not get the sigterm-signal. Starting the recording works all the way right.
The problem is also, that if the process runs forever, the device is not free for another motion event to start... Any help would be appreciated! Regards Stefan