Send Motion-user mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."
Today's Topics:
1. Pi4 Motion 4.3.1 track_generic_move not being called (Jon Grant)
2. Re: Pi4 Motion 4.3.1 track_generic_move not being called
(Jon Grant)
3. Re: Pi4 Motion 4.3.1 track_generic_move not being called
(Adam Goryachev)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Feb 2021 12:19:44 +1100
From: Jon Grant <[email protected]>
To: [email protected]
Subject: [Motion-user] Pi4 Motion 4.3.1 track_generic_move not being
called
Message-ID:
<ca+arkkbyp+9w7apuzwpdvckvv9xzjw-ztlnaydpialnwdpy...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hello devs
First, thanks for an awesome solution, the quality from me getting going to
today has been amazing!
I have a question (and assume it is a beginners mistake). I have setup a
call from *track_generic_move* to* motionTrackMove.sh *that is not being
run, however if I call it from the command line (either as user *pi* or via
*sudo*) it works perfectly...
I can see this is being called in the motion.log file (below)
I have tried calling this as:
/home/pi/mlai/motionTrackMove.sh
/usr/bin/sh /home/pi/mlai/motionTrackMove.sh
The bash script motionTrackMove.sh has been set to execute (see below).
Any ideas please?
*tail -f /var/log/motion/motion.log*
[1:ml1] [DBG] [EVT] [Feb 17 00:54:24] generic_move: Executing external
command '/home/pi/mlai/motionTrackMove.sh'
[1:ml1] [DBG] [EVT] [Feb 17 01:02:03] generic_move: Executing external
command '/usr/bin/sh /home/pi/mlai/motionTrackMove.sh'
#!/bin/bash
#file: motionTrackMove.sh
echo 'Called motionTrackMove.sh' >> /home/pi/mlai/log
ls -la motionTrackMove.sh
-rwxr-xr-x 1 pi pi 66 Feb 17 01:01 motionTrackMove.sh
############################################################
# Tracking (Pan/Tilt)
#############################################################
track_type 4
track_auto on
;track_port /dev/ttyS0
;track_motorx 0
;track_motorx_reverse 0
;track_motory 1
;track_motory_reverse 0
;track_maxx 200
;track_minx 50
;track_maxy 200
;track_miny 50
;track_homex 128
;track_homey 128
;track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
*track_generic_move* /usr/bin/sh /home/pi/mlai/motionTrackMove.sh
Pi OS is: PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
Thx!
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Wed, 17 Feb 2021 15:26:02 +1100
From: Jon Grant <[email protected]>
To: [email protected]
Subject: Re: [Motion-user] Pi4 Motion 4.3.1 track_generic_move not
being called
Message-ID:
<CA+ARkkY5H-ffTh18UJ2JcR6nkxB1P_=erki7v1xzzaqrmk6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
OK, must be something to do with the shell? As this works every time,
please consider this request closed by me as using Python is fine.
*track_generic_move* /usr/bin/python3 /home/pi/mlai/movementDetected.py
'[track_generic_move] ***x/y/z etc***'
On Wed, Feb 17, 2021 at 12:19 PM Jon Grant <[email protected]> wrote:
> Hello devs
>
> First, thanks for an awesome solution, the quality from me getting going
> to today has been amazing!
>
> I have a question (and assume it is a beginners mistake). I have setup a
> call from *track_generic_move* to* motionTrackMove.sh *that is not being
> run, however if I call it from the command line (either as user *pi* or
> via *sudo*) it works perfectly...
>
> I can see this is being called in the motion.log file (below)
> I have tried calling this as:
> /home/pi/mlai/motionTrackMove.sh
> /usr/bin/sh /home/pi/mlai/motionTrackMove.sh
> The bash script motionTrackMove.sh has been set to execute (see below).
> Any ideas please?
>
> *tail -f /var/log/motion/motion.log*
> [1:ml1] [DBG] [EVT] [Feb 17 00:54:24] generic_move: Executing external
> command '/home/pi/mlai/motionTrackMove.sh'
> [1:ml1] [DBG] [EVT] [Feb 17 01:02:03] generic_move: Executing external
> command '/usr/bin/sh /home/pi/mlai/motionTrackMove.sh'
>
> #!/bin/bash
> #file: motionTrackMove.sh
> echo 'Called motionTrackMove.sh' >> /home/pi/mlai/log
>
> ls -la motionTrackMove.sh
> -rwxr-xr-x 1 pi pi 66 Feb 17 01:01 motionTrackMove.sh
>
> ############################################################
> # Tracking (Pan/Tilt)
> #############################################################
> track_type 4
> track_auto on
> ;track_port /dev/ttyS0
> ;track_motorx 0
> ;track_motorx_reverse 0
> ;track_motory 1
> ;track_motory_reverse 0
> ;track_maxx 200
> ;track_minx 50
> ;track_maxy 200
> ;track_miny 50
> ;track_homex 128
> ;track_homey 128
> ;track_iomojo_id 0
> track_step_angle_x 10
> track_step_angle_y 10
> track_move_wait 10
> track_speed 255
> track_stepsize 40
> *track_generic_move* /usr/bin/sh /home/pi/mlai/motionTrackMove.sh
>
>
> Pi OS is: PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
>
>
> Thx!
> Jon
>
>
>
--
Cheers
Jon
0404 36 7775
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 3
Date: Wed, 17 Feb 2021 15:34:38 +1100
From: Adam Goryachev <[email protected]>
To: [email protected]
Subject: Re: [Motion-user] Pi4 Motion 4.3.1 track_generic_move not
being called
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
On 17/2/21 15:26, Jon Grant wrote:
> OK, must be something to do with the shell?? As this works every time,
> please consider this request closed by me as using Python is fine.
>
> *track_generic_move* /usr/bin/python3
> /home/pi/mlai/movementDetected.py '[track_generic_move] ***x/y/z etc***'
>
>
> On Wed, Feb 17, 2021 at 12:19 PM Jon Grant <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hello devs
>
> First, thanks for an awesome solution, the quality from me getting
> going to today has been amazing!
>
> I have a question (and assume it is a beginners mistake).? I have
> setup a call from *track_generic_move* to*motionTrackMove.sh *that
> is not being run, however if I call it from the command line
> (either as user /pi/ or via /sudo/) it works perfectly...
>
> I can see this is being called in the motion.log file (below)
> I have tried calling this as:
> /home/pi/mlai/motionTrackMove.sh
> /usr/bin/sh /home/pi/mlai/motionTrackMove.sh
> The bash script motionTrackMove.sh has been set to execute (see
> below).
> Any ideas please?
>
> *tail -f /var/log/motion/motion.log*
> ? ? [1:ml1] [DBG] [EVT] [Feb 17 00:54:24] generic_move: Executing
> external command '/home/pi/mlai/motionTrackMove.sh'
> ? ? [1:ml1] [DBG] [EVT] [Feb 17 01:02:03] generic_move: Executing
> external command '/usr/bin/sh /home/pi/mlai/motionTrackMove.sh'
>
I'm not sure about your system, but I don't think /usr/bin/sh usually
exists, it should be /bin/sh, but since your shell is written in bash,
then it should probably have been /bin/bash.
In any case, seems you have a working solution now. It might be good if
motion logged an error message if the executable doesn't exist, or log
the return code or something, this might have provided a better clue to
the problem.
PPS, maybe the above is wrong, on my pi:
root@pi-03:~# which sh
/usr/bin/sh
root@pi-03:~# ls -l /usr/bin/sh
lrwxrwxrwx 1 root root 4 Oct 22 14:01 /usr/bin/sh -> dash
root@pi-03:~# ls -l /usr/bin/dash
-rwxr-xr-x 1 root root 129536 Mar 30? 2020 /usr/bin/dash
root@pi-03:~# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Oct 22 14:01 /bin/sh -> dash
root@pi-03:~# ls -ld /bin
lrwxrwxrwx 1 root root 7 Oct 22 14:00 /bin -> usr/bin
So, maybe it was a problem with using dash instead of bash... though
again, you could re-configure the system such that sh points to bash...
so overall, maybe motion needs better logging.
To work it out, you could use strace to better see what motion is
calling and why it fails (the syscall and results).
Regards,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------
Subject: Digest Footer
_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user
------------------------------
End of Motion-user Digest, Vol 176, Issue 27
********************************************