Page 1 of 2

Kindly help requested by using my ip camera as motion sensor

Posted: Saturday 30 January 2016 16:45
by BaliBiker
As this is my first post I would like to introduce myself shortly.
I'm Jeroen, I'm from the Netherlands and using Domoticz with great pleasure. So many thanks to all developers. You all did and do a great job!

I'm trying to get my ip camera working as motion detection as described in the Wiki "1.4 Using your camera as motion sensor".
I can't get this working and as I'm a starter I don't even know were to look. So I hope some of you can help me through.

I followed the wiki.
- I added my camera (Foscam FI9805W) to Domoticz. It shows a proper picture. So I believe the ImageURL I inserd is correct.
- I installed the motion package as expland in the wiki
- I set up a dummy motion-sensor in Domoticz
- I can switch the dummy sensor by "http://192.168.178.21:8080/json.htm?typ ... tchcmd=Off"
- In the file /etc/motion/motion.conf I added at the end
on_event_start /usr/bin/curl -s "http://192.168.178.21:8080/json.htm?typ ... itchcmd=On"
on_event_end /usr/bin/curl -s "http://192.168.178.21:8080/json.htm?typ ... tchcmd=Off"
- In the file /etc/motion/motion.conf I also added the same ImageURL as I added to Domoticz. I placed it under 'Capture device options'

As the dummy sensor doesn't react om any movement in front of my ip camera I'm sure I miss something.
Anyone an idea?

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Saturday 20 February 2016 22:11
by Gabe
Hi everybody,

I have exactly the same problem like BaliBiker. Has anybody a idea?

Thx

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Sunday 21 February 2016 5:02
by nayr
it dont think it works like that, your foscam is doing the motion detection and it has to make the call to Domoticz... motion would have to process your stream and detect motion through its own software algorithms, and there is no way your RPi has the power to do that.

Ive implemented this functionality for Dahua's and here in a few hours Hikvisions too.. personally I'd suggest you get real security cameras instead of those shitty consumer webcams, you have no idea what your missing.

viewtopic.php?f=38&t=10604&p=75502#p75502

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Sunday 21 February 2016 7:54
by Egregius
A Pi2 is perfectly capable of running the motion mmal stuff. At least with the camera connected directly. I have 2 of them operational.
Try searching a IP camera with 5 MP resolution? Good luck with that.
I wouldn't run this on the same Pi as Domoticz, get a dedicated one for the motion stuff.

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Sunday 21 February 2016 9:51
by Gabe
hI Nayr,

Thx for info. i just look in your topic and you speak that maybe also Foscam work with it?!?

Is there a chance to find out how?

tHx

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Sunday 21 February 2016 21:55
by Gabe
Hi everybody,

so it looks that I can now connect to the camera thourgh motion, but now I get follow log:

motion: [1] libjpeg decompression failure on first frame - giving up!

Do anyone has a idea, how I can fix it?

Thanks

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Monday 22 February 2016 2:59
by nayr
is it outputting a mjpeg stream or a x264?

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Monday 22 February 2016 6:10
by Gabe
Mjpeg stream

Thxs

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Tuesday 23 February 2016 12:23
by sundberg84
I have the same setup as you but not the last line:
- In the file /etc/motion/motion.conf I also added the same ImageURL as I added to Domoticz. I placed it under 'Capture device options'
You might have problems with privileges or authorisation. I need to add the user and password as well to json command in motion.conf or it wont work.

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Tuesday 23 February 2016 14:55
by Gabe
Hi Sundberg84,

which camera you have also the Foscam 9805W?

If yes how you get Mjpeg stream?

Which http command you use in the motion.conf?

thanks

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 10:47
by IDANIT
I have the same problem. Everything works as it should, except for motion detection. No issues with Video streaming, taking pictures or voice communication. With MotionEye, motion detection works like charm, so it is not a problem with RPi power.

Domoticz V2.4739
Android Phone with "IP Webcam" software

motin.conf

Code: Select all

daemon on

ffmpeg_video_codec mpeg4

width 1280
height 720

on_event_start /usr/bin/curl -s "http://192.168.1.242:8088/json.htm?type=command&param=switchlight&idx=87&switchcmd=On"

on_event_end /usr/bin/curl -s "http://192.168.1.242:8088/json.htm?type=command&param=switchlight&idx=87&switchcmd=Off"

What we do wrong?

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 10:57
by Gabe
Hi Idanit,

you have check the logs of Motion and Domoticz?

Is there any error? Domotizc camera function for me also well only Motion not...

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 14:02
by IDANIT
Gabe wrote: you have check the logs of Motion and Domoticz?
I'm not an expert when it comes to Domoticz/Linux
Could you be more specific. When I check logs in Domoticz, (web page) I have no errors. But where I should look for Motion logs?

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 14:35
by Gabe
Iam also new as I have Domoticz only since one week, but try help as far as I can ;)

If you start Motion with sudo /etc/init.d/motion start which result you get?

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 14:41
by Gabe
pls aslo check the /var/log/Messages. I think there must be something in

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 17:55
by IDANIT
logs looks fine "motion daemon running" :oops: but it's not.

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Wednesday 24 February 2016 19:52
by Gabe
also noting indicatet in the Messages log???

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Thursday 25 February 2016 14:04
by IDANIT
Gabe wrote:also noting indicatet in the Messages log???
cant find it.
It can be assumed that as in so many cases, this option does not work, it means that in Domoticz Motion Detection does not work at all.
viewtopic.php?f=35&t=922

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Thursday 25 February 2016 15:21
by Gabe
could be I get it also finally not function...

I do it now through a Switch where I put motion on and off, rest will be done from the camera itself...

Re: Kindly help requested by using my ip camera as motion sensor

Posted: Saturday 26 March 2016 12:17
by marmachine
Hi Guys,

Im fairly new to Domoticz and Raspberry in the first place.
I seem to run into similar issues with my Foscam FI9900P; i have it successfully set up in Domoticz, but can't get it to work as a motionsensor which was basically my intention because i would like to send notification on motion.

Anyway, here's what i found, when looking for (didn't know where to find) motion logging;

If you are running motion in daemon mode, the output is logged to:
/var/log/messages (shows the activity of motion, but not generally any error messages, in my case this is empty)
/var/log/syslog (you will generally find the error messages here)

So now syslog gives me some direction;
Mar 26 06:27:20 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
Mar 26 06:27:20 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
Mar 26 06:27:20 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:

Although i have tested my on_event_start and on_event_end commands, i am pretty sure there still is something wrong in /etc/motion/motion.conf

Will look further into this, but any hints could be helpfull... again, i'm new to all this!

Thanks!