Hello Crisan,
at first thanks for the great piece of software, just made a donation las night ;-)
I have been using motioneye with the raspberry (RPi2) and connected another raspberry and a webcam to watch the animals in the garden. certainly my wife is very keen to have a view at the pictures in the morning. I have been using it for 6 months now. I use a Raspberry Pi 2 with motioneye v. 0.24 - was too lazy so far for completely reinstall.
Now my question: On another Raspberry Pi (RPi1)
I want to switch a socke by a shell command defined in the moetioneye admin web interface.
The command is
ssh [email protected] " /usr/local/bin/send 00001 3 1 &"
I had exchanged the certificates between RPi1 and RPi2 i.e. the ssh command works at the command line without password input.
Nevertheless, the same command, generated by motioneye at motion detection, gives and error message in motion.log:
Host key verification failed
Maybe motioneye is run by another user?
It would be great to get this solved.
Have a nice Sunday,
Bernd
Do you use motionEye with Raspbian? Or have you installed motionEyeOS? Or perhaps an older version of motionPie?
Oh that is a quick reply :-)
yes, I work with raspibian
motioneye 0.24 .
Raspbian GNU/Linux 7
BR,
Bernd
Well then this is definitely not something that motioneye controls in any way. motionEye runs with the user you started it (probably with pi). But whenever you reinstall a Linux OS, the ssh keys need to be regenerated (unless you back up the ~/.ssh folder).
Thanks Crisan, for the hint, I wanted to copy it anyway to a flashdisk. Any hint where I could search? As user Pi direct input it works and when the same string is triggered through motioneye - Host key verification failed ?? Any Idea whereelse to search?
Thanks
Bernd
How do you start motionEye?
In the mean time I found out, that the command rather shold be
ssh 192.168.178.59 " /usr/local/bin/send 00001 3 1 &"
because using ssh pi@... I had 2 users Pi
Moreover, from the command line it works too excluding the &
and putting the quotes like this:
ssh 192.168.178.59 /usr/local/bin/send "00001 3 1"
Start motion eye:
in /etc/rc.local there is one line
/home/pi/motioneye/motioneye.py &
that starts the program,
ps shows
399 ? S 2:49 python /home/pi/motioneye/motioneye.py
2556 ? Sl 11:13 /usr/bin/motion -c /home/pi/motioneye/conf/motion.conf -n -d 1
I had another camera connected to an USB port which is not used in the moment.
/var/log/syslog:
Dec 13 16:26:12 raspberrypi2 rc.local[390]: 2015-12-13 16:26:12: ERROR: could not open camera config file: [Errno 2] No such file or directory: '/home/pi/motioneye/conf/thread-1.conf'
Dec 13 16:26:12 raspberrypi2 rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 13 16:26:42 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 13 16:26:12 raspberrypi2 rc.local[390]: 2015-12-13 16:26:12: WARNING: ignoring event for remote camera with id 1 (probably removed)
Dec 13 16:26:57 raspberrypi2 rc.local[390]: 2015-12-13 16:26:57: ERROR: could not open camera config file: [Errno 2] No such file or directory: '/home/pi/motioneye/conf/thread-1.conf'
Dec 13 16:26:57 raspberrypi2 rsyslogd-2007: action 'action 17' suspended, next retry is Sun Dec 13 16:27:27 2015 [try http://www.rsyslog.com/e/2007 ]
Dec 13 16:26:57 raspberrypi2 rc.local[390]: 2015-12-13 16:26:57: WARNING: ignoring event for remote camera with id 1 (probably removed)
This is the motion.cfg
(it does not point to thread-1.conf which actually does not exist in ~/motioneye/conf)
'# @enabled on
'# @show_advanced on
'# @normal_password
'# @admin_username admin
'# @admin_password
'# @normal_username user
(' apostroph: for nicer formattig reasons only here)
control_port 7999
thread thread-2.conf
webcontrol_port 7999
one more thing:
sudo find / -name thread-1.conf
does not show any result
Well you don't have a thread-1.conf and that is not a problem. You probably added two cameras and then removed the first one.
Yes, this might be the case. Actually I had 3: one in the motioneye machine, another in another raspi and a usb-webcam.
what about the start procedure? :
Start motion eye:
in /etc/rc.local there is one line
/home/pi/motioneye/motioneye.py &
that starts the program,
ps shows
399 ? S 2:49 python /home/pi/motioneye/motioneye.py
2556 ? Sl 11:13 /usr/bin/motion -c /home/pi/motioneye/conf/motion.conf -n -d 1
If you start motionEye from /etc/rc.local (which is fine), it runs with root instead of pi. You should probably consider generating those ssh keys for the user root as well.
NOW IT WORKS!!
That was the issue ... I have learnt a lot today :-)
have a nice evening,
Lots of thanks,
Bernd
That's great to hear! You're welcomed.
just one off-topic question: I will have to up-date to ver 0.27 some time, to get the regular up-dates. ist it possible, to maintain the ver 0.24 for a while, say by renaiming the ver 0.24 to motioneye.old , then install the new version from scratch, copy the config-file and when it works fine delete the old version?
Don't. The differences are huge. I strongly advise you to start clean.
I have dlink IP cams connected and visible however motion detect does not seem to be functioning.
I have everything selected as far as the settings go and still no luck.
I have messed with ip cams quite a bit, along with Zoneminder. I am hopeful for this to work to replace zoneminder. Any suggestions?
Please attach your configuration files (removing sensitive data).
Hi,
I have installed motioneye os on a RPI2, that's work well.
But I try to interact with a switch in domoticz with this command:
curl -s "http://192.168.2.11:8080/json.htm?type=command¶m=switchlight&idx=54&switchcmd=On"
This command work in the terminal of motioneye os, but doesn't work in /Motion Notifications/Run a command.
Use a shell script for that, as the command contains a lot of special characters that would probably need escaping.
Hi Ccrisan,
I have installed motioneye on raspbian_os so that I can use some inherent capabilities of the os with motioneye. But nothing happened when I input the directory of my pyhton script under the Motion Notification "run command". Could you please assist me with this?
Thanks in advance.
Regards,
Its my pleasure to receive help from anyone who has resolved issue like this before.
Thanks in anticipation.
@skcareer you should fill in the full path to the python script, not just the directory! Also, make sure it's executable and that it works well outside of motionEye.
Hi Ccrisan,
Thanks for your promt response.
I have created another smaller program with twitter API(just to tweet
'Hello World" to my twitter account). This was tested to be working fine on
my raspberry pi 3.
I typed in the script path as follow on the Motion Notification run
command textbox:
Nothing happens when I simulated motion in front of the raspberry pi camera.
Is there anything I ought to have done that I have not done?
Thanks in advance.
Best Regards,
Sunkanmi.
On Wed, May 10, 2017 at 9:30 AM, Calin Crisan notifications@github.com
wrote:
@skcareer https://github.com/skcareer you should fill in the full path
to the python script, not just the directory! Also, make sure it's
executable and that it works well outside of motionEye.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ccrisan/motioneye/issues/74#issuecomment-300412858,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALfCFW8WSdgfC88L-LzYF4-JyiLKPEEtks5r4XWggaJpZM4G0Slo
.
Got same problem, script are always "Not Found", while they work fine executed manually. I tried to put them at different places (even if I use full path), but no luck
&: 1: &: motionDectection.sh: not found
&: 1: &: /etc/motioneye/motionDectectionCamera1OFF.sh: not found
&: 1: &: /bin/bash /etc/motioneye/motionDectection.sh Camera1 OFF: not found
@kduytsch what's &: 1: &?
That's a copy/paste from the motion.log log file
[6407704:motion] [NTC] [ALL] motion_startup: Logging to syslog
[6407704:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (WRN)
[1:ml1] [WRN] [NET] netcam_next: called with no data in buffer
&: 1: &: motionDectectionCamera1OFF.sh: not found
&: 1: &: motionDectectionCamera1OFF.sh: not found
And are you 100% sure the script is present at /etc/motioneye/motionDectectionCamera1OFF.sh and is executable?
root@raspberrypi:/etc/motioneye# ls -l motionDectectionCamera1OFF.sh
-rwxr-xr-x 1 root root 223 Jul 13 20:58 motionDectectionCamera1OFF.sh
But I just found the problem.... The ^M at the end of the file. In Unix/Linux, usually when you edit with vi, you see them. Was not the case here. I edited via a text editor and changed the EOL from dos to unix and now it does work. Still can't understand why it was working on CLI
So now, I can run a script with full path and even CLI arguments like :
/etc/openhab2/scripts/motionDectection.sh Camera1 ON
Most helpful comment
If you start motionEye from /etc/rc.local (which is fine), it runs with
rootinstead ofpi. You should probably consider generating those ssh keys for the userrootas well.