Replies: 3 comments 1 reply
-
Motion process is running as
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your suggestion.
This does not work, but it no longer has those permission errors. After trial and error, the configuration that works for me is to run mpg123 with sudo in the script AND add "motion ALL=(ALL) NOPASSWD:ALL" to the end of the "/etc/sudoers" file. With this, the audio file can be in any directory. I use "on_event_start" to trigger the script. When I wave my hand in front of the camera, it seems motion runs two instances of the script. The audio plays over one another with very small delay, but noticeable. I can see two copies of audio playing via journalctl. Any idea as to why?. Also, what is the maximum event number that motion uses to stamp the media filename before it resets?. After restarted, motion starts with 01. Thanks |
Beta Was this translation helpful? Give feedback.
-
After looking into it, it's my own doing for having two instances of the audio playing. Motion works correctly. I have 4 cameras and I set on_event_start in motion.conf. In my case, two cameras see the same event and therefore trigger the script. I moved on_event_start to individual cameraX.conf to avoid this problem. I still need to know the max event ID. |
Beta Was this translation helpful? Give feedback.
-
I am running Motion 4.3.2 on Ubuntu 22.04 LTS and would like to play an mp3 file "on_event_start" using "mpg123" audio player via a simple bash script (myscript.sh) below:
This script runs fine in the terminal (like 'bash myscript.sh') but it does not on the 'on_event_start' trigger from Motion. It has permission error, such as below:
To see what happens after that, I did chmod 755 and chown motion:motion on myaudio.mp3 and myscript.sh...the same errors.
Any help/hint would be greatly appreciated. Thanks.
BTW...what is the motion account default password?.
Beta Was this translation helpful? Give feedback.
All reactions